diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/direct.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index eadd87f7159f..f8e165c7d5a6 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -188,12 +188,17 @@ static void nfs_direct_req_release(struct nfs_direct_req *dreq) | |||
188 | static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq) | 188 | static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq) |
189 | { | 189 | { |
190 | ssize_t result = -EIOCBQUEUED; | 190 | ssize_t result = -EIOCBQUEUED; |
191 | struct rpc_clnt *clnt; | ||
192 | sigset_t oldset; | ||
191 | 193 | ||
192 | /* Async requests don't wait here */ | 194 | /* Async requests don't wait here */ |
193 | if (dreq->iocb) | 195 | if (dreq->iocb) |
194 | goto out; | 196 | goto out; |
195 | 197 | ||
198 | clnt = NFS_CLIENT(dreq->inode); | ||
199 | rpc_clnt_sigmask(clnt, &oldset); | ||
196 | result = wait_for_completion_interruptible(&dreq->completion); | 200 | result = wait_for_completion_interruptible(&dreq->completion); |
201 | rpc_clnt_sigunmask(clnt, &oldset); | ||
197 | 202 | ||
198 | if (!result) | 203 | if (!result) |
199 | result = dreq->error; | 204 | result = dreq->error; |
@@ -403,9 +408,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, | |||
403 | unsigned long nr_segs, loff_t pos) | 408 | unsigned long nr_segs, loff_t pos) |
404 | { | 409 | { |
405 | ssize_t result = 0; | 410 | ssize_t result = 0; |
406 | sigset_t oldset; | ||
407 | struct inode *inode = iocb->ki_filp->f_mapping->host; | 411 | struct inode *inode = iocb->ki_filp->f_mapping->host; |
408 | struct rpc_clnt *clnt = NFS_CLIENT(inode); | ||
409 | struct nfs_direct_req *dreq; | 412 | struct nfs_direct_req *dreq; |
410 | 413 | ||
411 | dreq = nfs_direct_req_alloc(); | 414 | dreq = nfs_direct_req_alloc(); |
@@ -417,11 +420,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, | |||
417 | if (!is_sync_kiocb(iocb)) | 420 | if (!is_sync_kiocb(iocb)) |
418 | dreq->iocb = iocb; | 421 | dreq->iocb = iocb; |
419 | 422 | ||
420 | rpc_clnt_sigmask(clnt, &oldset); | ||
421 | result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos); | 423 | result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos); |
422 | if (!result) | 424 | if (!result) |
423 | result = nfs_direct_wait(dreq); | 425 | result = nfs_direct_wait(dreq); |
424 | rpc_clnt_sigunmask(clnt, &oldset); | ||
425 | nfs_direct_req_release(dreq); | 426 | nfs_direct_req_release(dreq); |
426 | 427 | ||
427 | return result; | 428 | return result; |
@@ -816,9 +817,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
816 | size_t count) | 817 | size_t count) |
817 | { | 818 | { |
818 | ssize_t result = 0; | 819 | ssize_t result = 0; |
819 | sigset_t oldset; | ||
820 | struct inode *inode = iocb->ki_filp->f_mapping->host; | 820 | struct inode *inode = iocb->ki_filp->f_mapping->host; |
821 | struct rpc_clnt *clnt = NFS_CLIENT(inode); | ||
822 | struct nfs_direct_req *dreq; | 821 | struct nfs_direct_req *dreq; |
823 | size_t wsize = NFS_SERVER(inode)->wsize; | 822 | size_t wsize = NFS_SERVER(inode)->wsize; |
824 | int sync = NFS_UNSTABLE; | 823 | int sync = NFS_UNSTABLE; |
@@ -836,11 +835,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
836 | if (!is_sync_kiocb(iocb)) | 835 | if (!is_sync_kiocb(iocb)) |
837 | dreq->iocb = iocb; | 836 | dreq->iocb = iocb; |
838 | 837 | ||
839 | rpc_clnt_sigmask(clnt, &oldset); | ||
840 | result = nfs_direct_write_schedule_iovec(dreq, iov, nr_segs, pos, sync); | 838 | result = nfs_direct_write_schedule_iovec(dreq, iov, nr_segs, pos, sync); |
841 | if (!result) | 839 | if (!result) |
842 | result = nfs_direct_wait(dreq); | 840 | result = nfs_direct_wait(dreq); |
843 | rpc_clnt_sigunmask(clnt, &oldset); | ||
844 | nfs_direct_req_release(dreq); | 841 | nfs_direct_req_release(dreq); |
845 | 842 | ||
846 | return result; | 843 | return result; |