Skip to content

Commit

Permalink
nfs: use blocking page_group_lock in add_request
Browse files Browse the repository at this point in the history
__nfs_pageio_add_request was calling nfs_page_group_lock nonblocking, but
this can return -EAGAIN which would end up passing -EIO to the application.

There is no reason not to block in this path, so change the two calls to
do so. Also, there is no need to check the return value of
nfs_page_group_lock when nonblock=false, so remove the error handling code.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Reviewed-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Aug 22, 2014
1 parent bc8a309 commit bfd484a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,8 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
struct nfs_page *subreq;
unsigned int bytes_left = 0;
unsigned int offset, pgbase;
int ret;

ret = nfs_page_group_lock(req, true);
if (ret < 0) {
desc->pg_error = ret;
return 0;
}
nfs_page_group_lock(req, false);

subreq = req;
bytes_left = subreq->wb_bytes;
Expand All @@ -892,11 +887,7 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
if (desc->pg_recoalesce)
return 0;
/* retry add_request for this subreq */
ret = nfs_page_group_lock(req, true);
if (ret < 0) {
desc->pg_error = ret;
return 0;
}
nfs_page_group_lock(req, false);
continue;
}

Expand Down

0 comments on commit bfd484a

Please sign in to comment.