public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Ben Myers <bpm@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: xfs_bmap_add_attrfork_local is too generic
Date: Thu, 28 Feb 2013 11:10:34 +1100	[thread overview]
Message-ID: <20130228001034.GI5551@dastard> (raw)
In-Reply-To: <20130214234244.GM22182@sgi.com>

On Thu, Feb 14, 2013 at 05:42:44PM -0600, Ben Myers wrote:
> On Mon, Feb 11, 2013 at 03:58:13PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > When we are converting local data to an extent format as a result of
> > adding an attribute, the type of data contained in the local fork
> > determines the behaviour that needs to occur.
> > 
> > xfs_bmap_add_attrfork_local() already handles the directory data
> > case specially by using S_ISDIR() and calling out to
> > xfs_dir2_sf_to_block(), but with verifiers we now need to handle
> > each different type of metadata specially and different metadata
> > formats require different verifiers (and eventually block header
> > initialisation).
> > 
> > There is only a single place that we add and attribute fork to
> > the inode, but that is in the attribute code and it knows nothing
> > about the specific contents of the data fork. It is only the case of
> > local data that is the issue here, so adding code to hadnle this
> > case in the attribute specific code is wrong. Hence we are really
> > stuck trying to detect the data fork contents in
> > xfs_bmap_add_attrfork_local() and performing the correct callout
> > there.
> > 
> > Luckily the current cases can be determined by S_IS* macros, and we
> > can push the work off to data specific callouts, but each of those
> > callouts does a lot of work in common with
> > xfs_bmap_local_to_extents(). The only reason that this fails for
> > symlinks right now is is that xfs_bmap_local_to_extents() assumes
> > the data fork contains extent data, and so attaches a a bmap extent
> > data verifier to the buffer and simply copies the data fork
> > information straight into it.
> > 
> > To fix this, allow us to pass a "formatting" callback into
> > xfs_bmap_local_to_extents() which is responsible for setting the
> > buffer type, initialising it and copying the data fork contents over
> > to the new buffer. This allows callers to specify how they want to
> > format the new buffer (which is necessary for the upcoming CRC
> > enabled metadata blocks) and hence make xfs_bmap_local_to_extents()
> > useful for any type of data fork content.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> 
> Applied.  We'd like this one in 3.8, one way or the other.

Ben, seeing as this missed the 3.8 release, can you push it back to
the 3.8.y stable series? It's already been hit out in the wild, so
it needs fixing....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2013-02-28  0:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11  4:58 [PATCH] xfs: xfs_bmap_add_attrfork_local is too generic Dave Chinner
2013-02-14 21:19 ` Mark Tinguely
2013-02-14 23:42 ` Ben Myers
2013-02-28  0:10   ` Dave Chinner [this message]
2013-02-28 15:26     ` Ben Myers

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=20130228001034.GI5551@dastard \
    --to=david@fromorbit.com \
    --cc=bpm@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox