xfs
[Top] [All Lists]

Re: [PATCH] xfs_mdrestore: initialize sb prior to xfs_sb_from_disk()

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH] xfs_mdrestore: initialize sb prior to xfs_sb_from_disk()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 6 Jun 2014 11:42:56 +1000
Cc: xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <53910482.1030909@xxxxxxxxxx>
References: <5390F89C.2050305@xxxxxxxxxx> <20140605235633.GC4453@dastard> <53910482.1030909@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Jun 05, 2014 at 07:00:02PM -0500, Eric Sandeen wrote:
> On 6/5/14, 6:56 PM, Dave Chinner wrote:
> > On Thu, Jun 05, 2014 at 06:09:16PM -0500, Eric Sandeen wrote:
> 
> ...
> 
> >> But ... should we maybe just do this once and for all in
> >> xfs_sb_from_disk?  I'm not sure leaving it up to every
> >> caller is a good idea, unless somebody ahs a reason to
> >> pre-populate some fields - I can't imagine why that would
> >> be, though...
> > 
> > We don't ever read in the CRC field into the in-memory structures
> > because it has no meaning in memory. Simiarly, we don't ever write
> > the CRC field from the in-core structure because we always
> > re-calculate it in the IO path if CRCs are configured. That is
> > consistent behaviour across the entire code-base.
> 
> <snip stuff>
> 
> > Perhaps we should move the memset() to within xfs_sb_from_disk()
> > to make this explicit?
> 
> Yes, that's what I meant by "this" in "do this once and for all" - 
> sorry, that wasn't clear.  memset(0) in xfs_sb_from_disk().

I didn't read it clearly. my fault.

> Yeah, the more I think about it, the more I think that's probably
> the obviously correct thing to do.

*nod*

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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