Commit d02d81ef authored by Trond Myklebust's avatar Trond Myklebust

NFS: Don't loop forever in nfs_do_recoalesce()

If __nfs_pageio_add_request() fails to add the request, it will return
with either desc->pg_error < 0, or mirror->pg_recoalesce will be set, so
we are guaranteed either to exit the function altogether, or to loop.

However if there is nothing left in mirror->pg_list to coalesce, we must
exit, so make sure that we clear mirror->pg_recoalesce every time we
loop.
Reported-by: default avatarOlga Kornievskaia <aglo@umich.edu>
Fixes: 70536bf4 ("NFS: Clean up reset of the mirror accounting variables")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent ebbe7887
...@@ -1218,6 +1218,7 @@ static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc) ...@@ -1218,6 +1218,7 @@ static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc)
do { do {
list_splice_init(&mirror->pg_list, &head); list_splice_init(&mirror->pg_list, &head);
mirror->pg_recoalesce = 0;
while (!list_empty(&head)) { while (!list_empty(&head)) {
struct nfs_page *req; struct nfs_page *req;
......
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