Commit 1bd5d6d0 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 8b77484f
...@@ -504,8 +504,12 @@ nfs_lock_and_join_requests(struct page *page) ...@@ -504,8 +504,12 @@ nfs_lock_and_join_requests(struct page *page)
for (subreq = head->wb_this_page; subreq != head; for (subreq = head->wb_this_page; subreq != head;
subreq = subreq->wb_this_page) { subreq = subreq->wb_this_page) {
if (!kref_get_unless_zero(&subreq->wb_kref)) if (!kref_get_unless_zero(&subreq->wb_kref)) {
if (subreq->wb_offset == head->wb_offset + total_bytes)
total_bytes += subreq->wb_bytes;
continue; continue;
}
while (!nfs_lock_request(subreq)) { while (!nfs_lock_request(subreq)) {
/* /*
* Unlock page to allow nfs_page_group_sync_on_bit() * Unlock page to allow nfs_page_group_sync_on_bit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment