xfs/007: fix regressions on V4 filesystems
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 20:00:45 +0000 (13:00 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Aug 2021 13:16:29 +0000 (21:16 +0800)
commit6d8a6d743a7d824cce61ffa4545d595587c90788
tree574c6bfd992156faab5be234953b256e0061b199
parent4fdd27ce193ec2a388d0b7d0f5ea1067c3cc876d
xfs/007: fix regressions on V4 filesystems

Following commit eae40404, I noticed the following regression when
running a V4 fstests run on an 5.13 kernel:

  --- /tmp/fstests/tests/xfs/007.out      2021-05-13 11:47:55.793859995 -0700
  +++ /var/tmp/fstests/xfs/007.out.bad    2021-07-28 09:23:42.856000000 -0700
  @@ -16,4 +16,4 @@
   *** umount
   *** Usage after quotarm ***
   core.nblocks = 0
  -core.nblocks = 0
  +core.nblocks = 1

The underlying cause of this problem is the fact that we now remount the
filesystem with no quota options because that will (soon) become the
only means to turn off quota accounting on XFS.  Because V4 filesystems
don't support simultaneous project and group quotas and play weird
remapping games with the incore superblock field, we actually have to
issue a remove command for the group quota file if we're trying to
truncate the project quota file on a V4 filesystem.

Due to stupid limitations in xfs_quota we actually have to issue a
separate 'remove' command.

Fixes: eae40404 ("xfs/007: unmount after disabling quota")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/007