]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: Don't wrap growfs AGFL indexes
authorDave Chinner <dchinner@redhat.com>
Tue, 5 Apr 2016 21:06:20 +0000 (07:06 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 01:18:53 +0000 (18:18 -0700)
commitdf89f87aea3045754d1317d1c77a018b477f348e
tree1df019aaba70c1d0e2e02bcacb689a37ecf54279
parent80d8d896b434bfeeb48592a19c74c90ef61d2f0a
xfs: Don't wrap growfs AGFL indexes

commit ad747e3b299671e1a53db74963cc6c5f6cdb9f6d upstream.

Commit 96f859d ("libxfs: pack the agfl header structure so
XFS_AGFL_SIZE is correct") allowed the freelist to use the empty
slot at the end of the freelist on 64 bit systems that was not
being used due to sizeof() rounding up the structure size.

This has caused versions of xfs_repair prior to 4.5.0 (which also
has the fix) to report this as a corruption once the filesystem has
been grown. Older kernels can also have problems (seen from a whacky
container/vm management environment) mounting filesystems grown on a
system with a newer kernel than the vm/container it is deployed on.

To avoid this problem, change the initial free list indexes not to
wrap across the end of the AGFL, hence avoiding the initialisation
of agf_fllast to the last index in the AGFL.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_fsops.c