]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - repair/sb.c
repair: fix quota inode handling in secondary superblocks
authorDave Chinner <dchinner@redhat.com>
Tue, 8 Jul 2014 00:36:39 +0000 (10:36 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 8 Jul 2014 00:36:39 +0000 (10:36 +1000)
commitd085fb486f8b33304f2fdf704411313ffc8bcc0c
tree608ba62c9cbea5d1fb53546231fb6762219cccb8
parent6af7c1eacfc3bf4fb4b782f9ab926cc8263886d7
repair: fix quota inode handling in secondary superblocks

Changes to support separate project quota inodes changed the way
quota inodes got written to the superblock. The current code is
tailored for the needs to the kernel, where the inodes should only
be written if certain falgs are set saying a quota type is enabled.

Unfortunately, when recovering a corrupt secondary superblock, we
need to unconditionally write the quota inode fields after we
unconditionally zero the quota flags field. The result of this bug
is that the bad quota inode fields cannot be cleared and hence
always are reported by bad by repair in subsequent runs.

Fix this by directly clearing the quota inodes in the superblock
buffers so that we do need to set special flags to get
xfs_sb_to_disk() to do the right thing as setting flags leave bad
flag values in the superblock instead of bad inode numbers....

Also, when clearing the inode numbers, write them as NULLFSINO
rather than 0 as this is what the kernel will write them as if quota
is turned off.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h
libxfs/rdwr.c
repair/agheader.c
repair/sb.c
repair/scan.c