From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 2/8] xfs: fix incorrect b_offset initialisation
Date: Thu, 29 Mar 2012 23:23:49 +1100 [thread overview]
Message-ID: <1333023835-12856-3-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1333023835-12856-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
Because we no longer use the page cache for buffering, there is no
direct block number to page offset relationship anymore.
xfs_buf_get_pages is still setting up b_offset as if there was some
relationship, and that is leading to incorrectly setting up
*uncached* buffers that don't overwrite b_offset once they've had
pages allocated.
For cached buffers, the first block of the buffer is always at offset
zero into the allocated memory. This is true for sub-page sized
buffers, as well as for multiple-page buffers.
For uncached buffers, b_offset is only non-zero when we are
associating specific memory to the buffers, and that is set
correctly by the code setting up the buffer.
Hence remove the setting of b_offset in xfs_buf_get_pages, because
it is now always the wrong thing to do.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/xfs_buf.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 2122b0f..9063461 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -221,7 +221,6 @@ _xfs_buf_get_pages(
{
/* Make sure that we have a page list */
if (bp->b_pages == NULL) {
- bp->b_offset = xfs_buf_poff(bp->b_file_offset);
bp->b_page_count = page_count;
if (page_count <= XB_PAGES) {
bp->b_pages = bp->b_page_array;
--
1.7.9
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-03-29 12:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 12:23 [PATCH 0/8] xfs: clean up unit usage in xfs_buf V2 Dave Chinner
2012-03-29 12:23 ` [PATCH 1/8] xfs: check for buffer errors before waiting Dave Chinner
2012-03-29 19:04 ` Mark Tinguely
2012-03-29 21:10 ` Dave Chinner
2012-03-29 21:48 ` Mark Tinguely
2012-03-29 22:07 ` Dave Chinner
2012-03-29 19:12 ` Christoph Hellwig
2012-03-29 21:17 ` Dave Chinner
2012-03-29 12:23 ` Dave Chinner [this message]
2012-03-29 19:13 ` [PATCH 2/8] xfs: fix incorrect b_offset initialisation Christoph Hellwig
2012-03-29 20:43 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 3/8] xfs: use kmem_zone_zalloc for buffers Dave Chinner
2012-03-29 19:14 ` Christoph Hellwig
2012-03-29 20:45 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 4/8] xfs: clean up buffer get/read call API Dave Chinner
2012-03-30 19:12 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 5/8] xfs: kill b_file_offset Dave Chinner
2012-03-30 19:12 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 6/8] xfs: use blocks for counting length of buffers Dave Chinner
2012-03-29 19:16 ` Christoph Hellwig
2012-03-30 19:13 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 7/8] xfs: use blocks for storing the desired IO size Dave Chinner
2012-03-30 19:13 ` Mark Tinguely
2012-03-29 12:23 ` [PATCH 8/8] xfs: kill xfs_buf_btoc Dave Chinner
2012-03-29 19:18 ` Christoph Hellwig
2012-03-30 19:13 ` Mark Tinguely
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=1333023835-12856-3-git-send-email-david@fromorbit.com \
--to=david@fromorbit.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