All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>, Eric Sandeen <sandeen@redhat.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_mdrestore: initialize sb prior to xfs_sb_from_disk()
Date: Thu, 05 Jun 2014 21:53:19 -0500	[thread overview]
Message-ID: <53912D1F.6010609@sandeen.net> (raw)
In-Reply-To: <20140606014256.GD4453@dastard>

On 6/5/14, 8:42 PM, Dave Chinner wrote:
> 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.

Actually, a memset() seems like overkill - every field except
sb_crc is explicitly filled in in the function.

Maybe better to just set sb_crc to 0, with a comment as to why?
I think I'll whip that one up.

-Eric

> *nod*
> 
> Cheers,
> 
> Dave.
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-06-06  2:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 23:09 [PATCH] xfs_mdrestore: initialize sb prior to xfs_sb_from_disk() Eric Sandeen
2014-06-05 23:56 ` Dave Chinner
2014-06-06  0:00   ` Eric Sandeen
2014-06-06  1:42     ` Dave Chinner
2014-06-06  2:53       ` Eric Sandeen [this message]
2014-06-09 20:58         ` Eric Sandeen
2014-06-09 21:30 ` [PATCH V2] xfs: fix crc field handling in xfs_sb_to/from_disk Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53912D1F.6010609@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=david@fromorbit.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.