[Top] [All Lists]

Re: [PATCH 07/32] xfs: growfs: use uncached buffers for new headers

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 07/32] xfs: growfs: use uncached buffers for new headers
From: Rich Johnston <rjohnston@xxxxxxx>
Date: Tue, 13 Nov 2012 15:18:46 -0600
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <1352721264-3700-8-git-send-email-david@xxxxxxxxxxxxx>
References: <1352721264-3700-1-git-send-email-david@xxxxxxxxxxxxx> <1352721264-3700-8-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
On 11/12/2012 05:53 AM, Dave Chinner wrote:
From: Dave Chinner <dchinner@xxxxxxxxxx>

When writing the new AG headers to disk, we can't attach write
verifiers because they have a dependency on the struct xfs-perag
being attached to the buffer to be fully initialised and growfs
can't fully initialise them until later in the process.

The simplest way to avoid this problem is to use uncached buffers
for writing the new headers. These buffers don't have the xfs-perag
attached to them, so it's simple to detect in the write verifier and
be able to skip the checks that need the xfs-perag.

This enables us to attach the appropriate buffer ops to the buffer
and hence calculate CRCs on the way to disk. IT also means that the
buffer is torn down immediately, and so the first access to the AG
headers will re-read the header from disk and perform full
verification of the buffer. This way we also can catch corruptions
due to problems that went undetected in growfs.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
  fs/xfs/xfs_fsops.c |   63 ++++++++++++++++++++++++++++++++++------------------
  1 file changed, 41 insertions(+), 22 deletions(-)

Looks good.

Reviewed-by Rich Johnston <rjohnston@xxxxxxx>


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