From: David Chinner <dgc@sgi.com>
To: Timothy Shimmin <tes@sgi.com>
Cc: David Chinner <dgc@sgi.com>, xfs-dev <xfs-dev@sgi.com>,
xfs-oss <xfs@oss.sgi.com>
Subject: Re: Review: ensure EOF writes into existing extents update filesize
Date: Tue, 22 May 2007 10:44:14 +1000 [thread overview]
Message-ID: <20070522004414.GL85884050@sgi.com> (raw)
In-Reply-To: <738172E9F9634F7FC01B5B3C@timothy-shimmins-power-mac-g5.local>
On Mon, May 21, 2007 at 04:34:26PM +1000, Timothy Shimmin wrote:
> Hi,
>
> Trying to understand how the initialisers prior to the loop
> are used during the loop.
> It looks like the initial "type" isn't used now with this change
> as we always assign to it near to where we access it.
Yes.
> Previously, we did access it in the already mapped case (type !=
> IOMAP_READ).
> So why do we initialise "type" prior to the loop then?
Because it's good practise - it's not obvious that it gets
initialised in all cases within the loop, so lets make sure
that it is....
> The inited "flags" var is 1st accessed in the unmapped/allocated
> codepath to set iomap_valid to zero on BMAPI_READ
> or now also in the other path where it is already mapped.
.....
> Nor sure if there are any ramifications of this but just trying to see
> differences.
There is no difference in behaviour....
> So, xfs_add_to_ioend() sets up the io completion handlers.
> Previously, we would have set up xfs_end_bio_read (for IOMAP_READ)
> and now we set up xfs_end_bio_written (for IOMAP_NEW).
> xfs_end_bio_written does an xfs_setfilesize(ioend)
> which an xfs_end_bio_read does not.
> Which I guess is the crux of this change and
> that is apparent.
Yes.
> I'm having trouble following the existing code to understand what
> it is currently doing. So you are better off with a reviewer that
> knows this code (but thought I'd have a look:)
It's not obvious at all, is it?
> We seem to be continually testing for iomap_valid which I believe
> checks whether the offset is within the mapped range. If the
> offset is not within the mapping then we try mapping the <offset,
> size> and then retest for validity. So what happens when it is
> not valid even after mapping and why wouldn't it be valid. I need
> a better understanding of the background code I guess.
The iomap that we get is a mapping of a range that is the same type
as the current bufferhead we are processing. Hence the mapping may
extend much further than the current buffer (e.g. delalloc or
unwritten mapping will extend to the end of the extent). therefore
as we walk each buffer, we need to check that it falls within the
current mapping and if it doesn't we need to map a new range.
We also need to invalidate the mapping if the buffer changes from
a mapped buffer to an unmapped/unwritten/delalloc buffer as we
need to do extra work there....
I guess I need to ping Christoph and Nathan on this one....
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2007-05-22 0:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-20 23:34 Review: ensure EOF writes into existing extents update filesize David Chinner
2007-05-20 23:40 ` Chris Wedgwood
2007-05-20 23:44 ` David Chinner
2007-05-21 6:34 ` Timothy Shimmin
2007-05-22 0:44 ` David Chinner [this message]
2007-05-22 1:02 ` Nathan Scott
2007-05-22 1:03 ` David Chinner
2007-05-22 4:10 ` Nathan Scott
2007-05-22 6:05 ` David Chinner
2007-05-23 0:02 ` David Chinner
2007-05-23 0:15 ` Nathan Scott
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=20070522004414.GL85884050@sgi.com \
--to=dgc@sgi.com \
--cc=tes@sgi.com \
--cc=xfs-dev@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