]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: fstrim: Fix start offset of first cluster group during fstrim
authorAshish Samant <ashish.samant@oracle.com>
Thu, 2 Nov 2017 22:59:37 +0000 (15:59 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 15 Nov 2017 05:12:43 +0000 (00:12 -0500)
commit6af77f7de5a6d47fefc3024a7a8a7f8e738d03b3
treef8a86843d3b27353d65d0c533d323db5fb908084
parent7c046d7f6492b2832ea42d7c72dfa932503c0797
ocfs2: fstrim: Fix start offset of first cluster group during fstrim

From: Ashish Samant <ashish.samant@oracle.com>

Orabug: 27111255

The first cluster group descriptor is not stored at the start of the
group but at an offset from the start.  We need to take this into
account while doing fstrim on the first cluster group.  Otherwise we
will wrongly start fstrim a few blocks after the desired start block and
the range can cross over into the next cluster group and zero out the
group descriptor there.  This can cause filesytem corruption that cannot
be fixed by fsck.

Link: http://lkml.kernel.org/r/1507835579-7308-1-git-send-email-ashish.samant@oracle.com
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Joseph Qi <jiangqi903@gmail.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherrypicked from commit 105ddc93f06ebe3e553f58563d11ed63dbcd59f0)
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
fs/ocfs2/alloc.c