From: Benjamin Coddington <bcodding@redhat.com>
To: Christoph Hellwig <hch@infradead.org>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] pnfs/blocklayout: last_write_offset incorrectly set to end of extent
Date: Tue, 20 Sep 2016 08:22:37 -0400 [thread overview]
Message-ID: <ffe9a2cc97ead5b73b985aa4c16219351cac29d5.1474372904.git.bcodding@redhat.com> (raw)
In-Reply-To: <9FD74439-878E-464E-9334-5F6782145248@redhat.com>
On 19 Sep 2016, at 15:40, Benjamin Coddington wrote:
> On 19 Sep 2016, at 15:06, Christoph Hellwig wrote:
>
>> On Mon, Sep 19, 2016 at 03:04:52PM -0400, Benjamin Coddington wrote:
>>> Are you sure this patch is the problem? I just tested and things are
>>> broken for me too, but I think it has something to do with the client
>>> choosing the block layout over SCSI now that the server is returning
>>> multiple layout types.
>>
>> Yes, this is my local kvm test setup which only uses the block layout
>> for now (and doesn't even have the SCSI layout compiled in on the
>> server).
>>
>>> Just wondering if you reverted this patch and saw the problem go away.
>>
>> Yes, it does.
>
> Rats.. well, I will investigate.
> diff --git a/fs/nfs/blocklayout/blocklayout.c
> b/fs/nfs/blocklayout/blocklayout.c
> index 17a42e4eb872..25cdd559831c 100644
> --- a/fs/nfs/blocklayout/blocklayout.c
> +++ b/fs/nfs/blocklayout/blocklayout.c
> @@ -344,7 +344,7 @@ static void bl_write_cleanup(struct work_struct
> *work)
> PAGE_SIZE - 1) & (loff_t)PAGE_MASK;
>
> ext_tree_mark_written(bl, start >> SECTOR_SHIFT,
> - (end - start) >> SECTOR_SHIFT);
> + (end - start) >> SECTOR_SHIFT, end);
> }
I have stupidly made this mistake twice now.. end is not the end of the
write here, but rather the end of the extent. My testing is broken as it's
not catching this, so now going to figure that out.
Ben
8<--------------------------------------------------------------------------------------
Commit 41963c10c47a35185e68cb9049f7a3493c94d2d7 sets the block layout's
last written byte to the offset of the end of the extent rather than the
end of the write which incorrectly updates the inode's size for
partial-page writes.
Fixes: 41963c10c47a ("pnfs/blocklayout: update last_write_offset atomically with extents")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
fs/nfs/blocklayout/blocklayout.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 217847679f0e..2905479f214a 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -344,9 +344,10 @@ static void bl_write_cleanup(struct work_struct *work)
u64 start = hdr->args.offset & (loff_t)PAGE_MASK;
u64 end = (hdr->args.offset + hdr->args.count +
PAGE_SIZE - 1) & (loff_t)PAGE_MASK;
+ u64 lwb = hdr->args.offset + hdr->args.count;
ext_tree_mark_written(bl, start >> SECTOR_SHIFT,
- (end - start) >> SECTOR_SHIFT, end);
+ (end - start) >> SECTOR_SHIFT, lwb);
}
pnfs_ld_write_done(hdr);
--
2.5.5
next prev parent reply other threads:[~2016-09-20 12:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 15:55 [PATCH] pnfs/blocklayout: update last_write_offset atomically with extents Benjamin Coddington
2016-08-18 18:19 ` Trond Myklebust
2016-08-18 18:46 ` Benjamin Coddington
2016-08-22 13:48 ` [PATCH v2] " Benjamin Coddington
2016-08-22 15:34 ` Trond Myklebust
2016-08-22 16:22 ` Benjamin Coddington
2016-08-22 18:11 ` [PATCH v3] " Benjamin Coddington
2016-09-19 14:58 ` Christoph Hellwig
2016-09-19 19:04 ` Benjamin Coddington
2016-09-19 19:06 ` Christoph Hellwig
2016-09-19 19:40 ` Benjamin Coddington
2016-09-20 12:22 ` Benjamin Coddington [this message]
2016-09-20 16:38 ` [PATCH] pnfs/blocklayout: last_write_offset incorrectly set to end of extent Christoph Hellwig
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=ffe9a2cc97ead5b73b985aa4c16219351cac29d5.1474372904.git.bcodding@redhat.com \
--to=bcodding@redhat.com \
--cc=anna.schumaker@netapp.com \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.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).