xfs
[Top] [All Lists]

Re: [PATCH V3] xfs: skip verification on initial "guess" superblock read

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH V3] xfs: skip verification on initial "guess" superblock read
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 14 Feb 2014 11:27:08 +1100
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <52FD55FC.1000103@xxxxxxxxxxx>
References: <52FD3C59.3050400@xxxxxxxxxx> <52FD55FC.1000103@xxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Feb 13, 2014 at 05:32:12PM -0600, Eric Sandeen wrote:
> When xfs_readsb() does the very first read of the superblock,
> it makes a guess at the length of the buffer, based on the
> sector size of the underlying storage.  This may or may
> not match the filesystem sector size in sb_sectsize, so
> we can't i.e. do a CRC check on it; it might be too short.
> 
> In fact, mounting a filesystem with sb_sectsize larger
> than the device sector size will cause a mount failure
> if CRCs are enabled, because we are checksumming a length
> which exceeds the buffer passed to it.
> 
> So always read twice; the first time we read with NULL
> buffer ops to skip verification; then set the proper
> read length, hook up the proper verifier, and give it
> another go.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Looks fine. I'll run it through some testing and we can go from
there. FWIW, does this make your "check the sector size in the sb
verifier" patch redundant?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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