]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ocfs2: solve a problem of crossing the boundary in updating backups
authorjiangyiwen <jiangyiwen@huawei.com>
Fri, 25 Mar 2016 21:21:35 +0000 (14:21 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 26 Nov 2016 23:43:27 +0000 (15:43 -0800)
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.

Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Xue jiufei <xuejiufei@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 584dca3440732afa84fbca07567bb66e1453936a)

Orabug: 24939243

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/resize.c

index 79b8021302b3eed84b9c59637cddd0e4844eb78b..5ff425e76203ee4e9354fbb0a7aaa8b59d3108f9 100644 (file)
@@ -196,7 +196,7 @@ static int update_backups(struct inode * inode, u32 clusters, char *data)
        for (i = 0; i < OCFS2_MAX_BACKUP_SUPERBLOCKS; i++) {
                blkno = ocfs2_backup_super_blkno(inode->i_sb, i);
                cluster = ocfs2_blocks_to_clusters(inode->i_sb, blkno);
-               if (cluster > clusters)
+               if (cluster >= clusters)
                        break;
 
                ret = ocfs2_read_blocks_sync(osb, blkno, 1, &backup);