xfs
[Top] [All Lists]

Re: [PATCH] xfs: don't hold onto reserved blocks on remount,ro

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: don't hold onto reserved blocks on remount,ro
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 25 Jan 2010 06:44:33 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1264397572-18230-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1264397572-18230-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Mon, Jan 25, 2010 at 04:32:52PM +1100, Dave Chinner wrote:
> If we hold onto reserved blocks when doing a remount,ro we end
> up writing the blocks used count to disk that includes the reserved
> blocks. Reserved blocks are not actually used, so this results in
> the values in the superblock being incorrect.
> 
> Hence if we run xfs_check or xfs_repair -n while the filesystem is
> mounted remount,ro we end up with an inconsistent filesystem being
> reported. Also, running xfs_copy on the remount,ro filesystem will
> result in an inconsistent image being generated.
> 
> To fix this, unreserve the blocks when doing the remount,ro, and
> reserved them again on remount,rw. This way a remount,ro filesystem
> will appear consistent on disk to all utilities.

Looks good to me, the only thing that was rather confusing when trying
to read the patch is the m_resblks_ro field in struct xfs_mount, it's
more a m_resblks_save, as in the saved value before we modified the
block count during remount,ro.

<Prev in Thread] Current Thread [Next in Thread>