Skip to content

Commit 1bd5d6d

Browse files
committed
NFS: Count the bytes of skipped subrequests in nfs_lock_and_join_requests()
If we skip a subrequest due to a zero refcount, we should still count the byte range that it covered so that we accurately reconstruct the original request size. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 8b77484 commit 1bd5d6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/nfs/write.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,12 @@ nfs_lock_and_join_requests(struct page *page)
504504
for (subreq = head->wb_this_page; subreq != head;
505505
subreq = subreq->wb_this_page) {
506506

507-
if (!kref_get_unless_zero(&subreq->wb_kref))
507+
if (!kref_get_unless_zero(&subreq->wb_kref)) {
508+
if (subreq->wb_offset == head->wb_offset + total_bytes)
509+
total_bytes += subreq->wb_bytes;
508510
continue;
511+
}
512+
509513
while (!nfs_lock_request(subreq)) {
510514
/*
511515
* Unlock page to allow nfs_page_group_sync_on_bit()

0 commit comments

Comments
 (0)