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