From: Lachlan McIlroy <lachlan@sgi.com>
To: David Chinner <dgc@sgi.com>
Cc: xfs-dev@sgi.com, xfs@oss.sgi.com
Subject: Re: Review: Fix sub-page zeroing for buffered writes into unwritten extents
Date: Mon, 29 Jan 2007 12:55:51 +0000 [thread overview]
Message-ID: <45BDEED7.4040500@sgi.com> (raw)
In-Reply-To: <20070128222249.GL33919298@melbourne.sgi.com>
David Chinner wrote:
> On Wed, Jan 24, 2007 at 04:44:04PM +0000, Lachlan McIlroy wrote:
>
>>Dave,
>>
>>I'm trying to understand what the sequence of events is here.
>>
>>If we write to an unwritten extent then will __xfs_get_blocks()
>>be called with create=1 and flags=BMAPI_WRITE?
>
>
> Yup.
>
>
>>And calling
>>bhv_vop_bmap() with flags set to BMAPI_WRITE will cause xfs_iomap()
>>to set iomap_flags to IOMAP_NEW?
>
>
> Only if we allocate an extent in xfs_iomap:
>
> In xfs_iomap:
>
> 258 phase2:
> 259 switch (flags & (BMAPI_WRITE|BMAPI_ALLOCATE|BMAPI_UNWRITTEN)) {
> 260 case BMAPI_WRITE:
> 261 /* If we found an extent, return it */
> 262 if (nimaps &&
> 263 (imap.br_startblock != HOLESTARTBLOCK) &&
> 264 (imap.br_startblock != DELAYSTARTBLOCK)) {
> 265 xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, io,
> 266 offset, count, iomapp, &imap, flags);
> 267 break;
> 268 }
>
>
> We found an extent - an unwritten extent - which means we have a map
> and the startblock is a real number (i.e. not a hole or delalloc region).
> Hence we break here and never set the IOMAP_NEW flag which is correct
> because we didn't just do an allocation.
I must have skimmed over the break statement. Your fix makes sense to me now.
>
>
>>The combination of create=1 and
>>iomap_flags=IOMAP_NEW in __xfs_get_blocks() should result in calling
>>set_buffer_new(), right?
>
>
> Yes, it would, but unwritten extents are not new extents.....
>
> Cheers,
>
> Dave.
prev parent reply other threads:[~2007-01-29 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 22:47 Review: Fix sub-page zeroing for buffered writes into unwritten extents David Chinner
2007-01-24 16:44 ` Lachlan McIlroy
2007-01-28 22:22 ` David Chinner
2007-01-29 12:55 ` Lachlan McIlroy [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=45BDEED7.4040500@sgi.com \
--to=lachlan@sgi.com \
--cc=dgc@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