History

ocfs2: solve a problem of crossing the boundary in updating backups

In update_backups() there exists a problem of crossing the boundary as follows: we assume that lun will be resized to 1TB(cluster_size is 32kb), it will include 0~33554431 cluster, in update_backups func, it will backup super block in location of 1TB which is the 33554432th cluster, so the phenomenon of crossing the boundary happens.

jiangyiwen committed 10 years ago

Commit 584dca31 parent 35ddf781 file · +1 −1Browse files

Unified · Split

fs/ocfs2/resize.c+1−1
@@ -196,7 +196,7 @@ static int update_backups(struct inode * inode, u32 clusters, char *data) · 195 unmodified lines
196 for (i = 0; i < OCFS2_MAX_BACKUP_SUPERBLOCKS; i++) {196 for (i = 0; i < OCFS2_MAX_BACKUP_SUPERBLOCKS; i++) {
197 blkno = ocfs2_backup_super_blkno(inode->i_sb, i);197 blkno = ocfs2_backup_super_blkno(inode->i_sb, i);
198 cluster = ocfs2_blocks_to_clusters(inode->i_sb, blkno);198 cluster = ocfs2_blocks_to_clusters(inode->i_sb, blkno);
199 if (cluster > clusters)199 if (cluster >= clusters)
200 break;200 break;
201 201
202 ret = ocfs2_read_blocks_sync(osb, blkno, 1, &backup);202 ret = ocfs2_read_blocks_sync(osb, blkno, 1, &backup);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t