提交 71e8cc00 编写于 作者: T Trond Myklebust

NFS: Ensure that we break out of read/write_schedule_segment on error

Currently we do break out of the for() loop, but we also need to
break out of the enclosing do {} while()...
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
上级 68cd6fa4
...@@ -396,7 +396,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_pageio_descriptor *de ...@@ -396,7 +396,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_pageio_descriptor *de
pos += req_len; pos += req_len;
count -= req_len; count -= req_len;
} }
} while (count != 0); } while (count != 0 && result >= 0);
kfree(pagevec); kfree(pagevec);
...@@ -692,6 +692,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d ...@@ -692,6 +692,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d
nfs_release_request(req); nfs_release_request(req);
nfs_direct_release_pages(pagevec + i, nfs_direct_release_pages(pagevec + i,
npages - i); npages - i);
break;
} }
pgbase = 0; pgbase = 0;
bytes -= req_len; bytes -= req_len;
...@@ -700,7 +701,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d ...@@ -700,7 +701,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d
pos += req_len; pos += req_len;
count -= req_len; count -= req_len;
} }
} while (count != 0); } while (count != 0 && result >= 0);
kfree(pagevec); kfree(pagevec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册