Skip to content

Commit

Permalink
AFS: further write support fixes
Browse files Browse the repository at this point in the history
Further fixes for AFS write support:

 (1) The afs_send_pages() outer loop must do an extra iteration if it ends
     with 'first == last' because 'last' is inclusive in the page set
     otherwise it fails to send the last page and complete the RxRPC op under
     some circumstances.

 (2) Similarly, the outer loop in afs_pages_written_back() must also do an
     extra iteration if it ends with 'first == last', otherwise it fails to
     clear PG_writeback on the last page under some circumstances.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and Linus Torvalds committed May 10, 2007
1 parent b9b1f8d commit 5bbf5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/afs/rxrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ int afs_send_pages(struct afs_call *call, struct msghdr *msg, struct kvec *iov)
put_page(pages[loop]);
if (ret < 0)
break;
} while (first < last);
} while (first <= last);

_leave(" = %d", ret);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions fs/afs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call)
pagevec_init(&pv, 0);

do {
_debug("attach %lx-%lx", first, last);
_debug("done %lx-%lx", first, last);

count = last - first + 1;
if (count > PAGEVEC_SIZE)
Expand Down Expand Up @@ -701,7 +701,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call)
}

__pagevec_release(&pv);
} while (first < last);
} while (first <= last);

_leave("");
}
Expand Down

0 comments on commit 5bbf5d3

Please sign in to comment.