Re: [PATCH 5/6] repair: fix quota inode handling in secondary superblocks

Christoph Hellwig
2014-07-04T14:36:01Z

On Fri, Jul 04, 2014 at 03:57:14PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> 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>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>