]> git.karo-electronics.de Git - linux-beck.git/commit
xfs: don't call xfs_sb_quota_from_disk twice
authorEric Sandeen <sandeen@redhat.com>
Tue, 8 Nov 2016 00:58:55 +0000 (11:58 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 8 Nov 2016 00:58:55 +0000 (11:58 +1100)
commite6fc6fcf4447c9266038c55c25e4c7c14bee110c
tree871133b430c250a5d57422366b16a5916aeaf5b0
parent523b2e76e3ecb54e0ec8651e32291bdaefc5f866
xfs: don't call xfs_sb_quota_from_disk twice

Source xfsprogs commit: ee3754254e8c186c99b6cdd4d59f741759d04acb

Kernel commit 5ef828c4 ("xfs: avoid false quotacheck after unclean
shutdown") made xfs_sb_from_disk() also call xfs_sb_quota_from_disk
by default.

However, when this was merged to libxfs, existing separate
calls to libxfs_sb_quota_from_disk remained, and calling it
twice in a row on a V4 superblock leads to issues, because:

        if (sbp->sb_qflags & XFS_PQUOTA_ACCT)  {
...
                sbp->sb_pquotino = sbp->sb_gquotino;
                sbp->sb_gquotino = NULLFSINO;

and after the second call, we have set both pquotino and gquotino
to NULLFSINO.

Fix this by making it safe to call twice, and also remove the extra
calls to libxfs_sb_quota_from_disk.

This is only spotted when running xfstests with "-m crc=0" because
the sb_from_disk change came about after V5 became default, and
the above behavior only exists on a V4 superblock.

Reported-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_sb.c