From: Ben Myers <bpm@sgi.com>
To: Alain Renaud <arenaud@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: xfs_vm_writepage clear iomap_valid when !buffer_uptodate (REV2)
Date: Fri, 8 Jun 2012 14:56:47 -0500 [thread overview]
Message-ID: <20120608195647.GQ4721@sgi.com> (raw)
In-Reply-To: <4FD253D6.9060909@sgi.com>
On Fri, Jun 08, 2012 at 03:34:46PM -0400, Alain Renaud wrote:
>
> On filesytems with a block size smaller than PAGE_SIZE we currently have
> a problem with unwritten extents. If a we have multi-block page for
> which an unwritten extent has been allocated, and only some of the
> buffers have been written to, and they are not contiguous, we can expose
> stale data from disk in the blocks between the writes after extent
> conversion.
>
> Example of a page with unwritten and real data.
> buffer content
> 0 empty b_state = 0
> 1 DATA b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
> 2 DATA b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
> 3 empty b_state = 0
> 4 empty b_state = 0
> 5 DATA b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
> 6 DATA b_state = 0x1023 Uptodate,Dirty,Mapped,Unwritten
> 7 empty b_state = 0
>
> Buffers 1, 2, 5, and 6 have been written to, leaving 0, 3, 4, and 7 empty.
> Currently buffers 1, 2, 5, and 6 are added to a single ioend, and when IO has
> completed, extent conversion creates a real extent from block 1 through block
> 6, leaving 0 and 7 unwritten. However buffers 3 and 4 were not written to
> disk, so stale data is exposed from those blocks on a subsequent read.
>
> Fix this by setting iomap_valid = 0 when we find a buffer that is not
> Uptodate. This ensures that buffers 5 and 6 are not added to the same
> ioend as buffers 1 and 2. Later these blocks will be converted into two
> separate real extents, leaving the blocks in between unwritten.
>
> Signed-off-by: Alain Renaud <arenaud@sgi.com>
Looks good to me. It was Dave who had the comments so we'll wait for his
second round before pulling this in. I think that cleaning up PageUptodate
xfs_convert_page and here in xfs_vm_writepage are valid suggestions, but are
better left for a separate patch.
Reviewed-by: Ben Myers <bpm@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-06-08 19:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-01 19:18 [PATCH] xfs: using extsize cause corruption with multi buffer page Alain Renaud
2012-06-05 11:45 ` Dave Chinner
2012-06-05 12:34 ` Alain Renaud
2012-06-08 19:34 ` [PATCH] xfs: xfs_vm_writepage clear iomap_valid when !buffer_uptodate (REV2) Alain Renaud
2012-06-08 19:56 ` Ben Myers [this message]
2012-06-08 23:13 ` Dave Chinner
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=20120608195647.GQ4721@sgi.com \
--to=bpm@sgi.com \
--cc=arenaud@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