diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-30 13:22:54 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-30 14:33:51 -0400 |
commit | 71e8cc00c63e8518ce86b4079355fc9086a4869d (patch) | |
tree | c48dd887cbb8e3228652992acbfc558a1a066f0e /fs/nfs/direct.c | |
parent | 68cd6fa4f3be07ba648e22617dfa16a40d671d19 (diff) |
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index e83545c4d36f..f30d5c26a763 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -396,7 +396,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_pageio_descriptor *de | |||
396 | pos += req_len; | 396 | pos += req_len; |
397 | count -= req_len; | 397 | count -= req_len; |
398 | } | 398 | } |
399 | } while (count != 0); | 399 | } while (count != 0 && result >= 0); |
400 | 400 | ||
401 | kfree(pagevec); | 401 | kfree(pagevec); |
402 | 402 | ||
@@ -692,6 +692,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d | |||
692 | nfs_release_request(req); | 692 | nfs_release_request(req); |
693 | nfs_direct_release_pages(pagevec + i, | 693 | nfs_direct_release_pages(pagevec + i, |
694 | npages - i); | 694 | npages - i); |
695 | break; | ||
695 | } | 696 | } |
696 | pgbase = 0; | 697 | pgbase = 0; |
697 | bytes -= req_len; | 698 | bytes -= req_len; |
@@ -700,7 +701,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d | |||
700 | pos += req_len; | 701 | pos += req_len; |
701 | count -= req_len; | 702 | count -= req_len; |
702 | } | 703 | } |
703 | } while (count != 0); | 704 | } while (count != 0 && result >= 0); |
704 | 705 | ||
705 | kfree(pagevec); | 706 | kfree(pagevec); |
706 | 707 | ||