From: Dave Chinner <david@fromorbit.com>
To: Tao Ma <tao.ma@oracle.com>
Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org,
Alex Elder <aelder@sgi.com>, Christoph Hellwig <hch@lst.de>,
Eric Sandeen <sandeen@redhat.com>
Subject: Re: [PATCH v2] xfs: Make fiemap works with sparse file.
Date: Fri, 18 Jun 2010 16:22:25 +1000 [thread overview]
Message-ID: <20100618062225.GC6590@dastard> (raw)
In-Reply-To: <4C1AD9A5.8010600@oracle.com>
On Fri, Jun 18, 2010 at 10:27:49AM +0800, Tao Ma wrote:
> >>This patch add a new parameter BMV_IF_NO_HOLES for bvm_iflags.
> >>So with this flags, we don't use our 'out' in xfs_getbmap for
> >>a hole. The solution is a bit ugly by just don't increasing
> >>index of 'out' vector. I felt that it is not easy to skip it
> >>at the very beginning since we have the complicated check and
> >>some function like xfs_getbmapx_fix_eof_hole to adjust 'out'.
> >
> >... because I think we can safely skip xfs_getbmapx_fix_eof_hole()
> >it only modifies the hole. Hence just adding a check after the
> >attribute fork end check (which needs to detect a hole to terminate)
> >should be fine: e.g something like:
> >
> > if (map[i].br_startblock == HOLESTARTBLOCK&&
> > whichfork == XFS_ATTR_FORK) {
> > /* came to the end of attribute fork */
> > out[cur_ext].bmv_oflags |= BMV_OF_LAST;
> > goto out_free_map;
> > }
> >+ if (map[i].br_startblock == HOLESTARTBLOCK&&
> >+ (iflags& BMV_IF_NO_HOLES)) {
> >+ memset(&out[cur_ext], 0, sizeof(out[cur_ext]));
> >+ continue;
> >+ }
> >
> >Should work and avoid the worst of the ugliness.
> I am afraid it doesn't work, at least from my test. It enters a dead loop.
> I think the root cause is that your change doesn't update bmv_offset
> and bmv_length for a hole. So in the large loop,
Yes, you are right - I didn't consider the outer loop termination
properly. My bad.
I'll add your patch to my qa list and move it onwards. Thanks.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2010-06-18 6:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-12 2:08 [PATCH v2] xfs: Make fiemap works with sparse file Tao Ma
2010-06-14 0:27 ` Dave Chinner
2010-06-14 5:53 ` Tao Ma
2010-06-14 12:29 ` Dave Chinner
2010-06-14 13:37 ` Tao Ma
2010-06-17 8:53 ` Tao Ma
2010-06-18 0:47 ` Dave Chinner
2010-06-18 2:27 ` Tao Ma
2010-06-18 6:22 ` Dave Chinner [this message]
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=20100618062225.GC6590@dastard \
--to=david@fromorbit.com \
--cc=aelder@sgi.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tao.ma@oracle.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;
as well as URLs for NNTP newsgroup(s).