Skip to content

Commit

Permalink
cifs_iovec_read(): resubmit shouldn't restart the loop
Browse files Browse the repository at this point in the history
... by that point the request we'd just resent is in the
head of the list anyway.  Just return to the beginning of
the loop body...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 2, 2014
1 parent 6e58e79 commit 74027f4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2918,29 +2918,29 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
rc = 0;

/* the loop below should proceed in the order of increasing offsets */
restart_loop:
list_for_each_entry_safe(rdata, tmp, &rdata_list, list) {
again:
if (!rc) {
ssize_t copied;

/* FIXME: freezable sleep too? */
rc = wait_for_completion_killable(&rdata->done);
if (rc)
rc = -EINTR;
else if (rdata->result)
else if (rdata->result) {
rc = rdata->result;
else {
/* resend call if it's a retryable error */
if (rc == -EAGAIN) {
rc = cifs_retry_async_readv(rdata);
goto again;
}
} else {
rc = cifs_readdata_to_iov(rdata, iov,
nr_segs, *poffset,
&copied);
total_read += copied;
}

/* resend call if it's a retryable error */
if (rc == -EAGAIN) {
rc = cifs_retry_async_readv(rdata);
goto restart_loop;
}
}
list_del_init(&rdata->list);
kref_put(&rdata->refcount, cifs_uncached_readdata_release);
Expand Down

0 comments on commit 74027f4

Please sign in to comment.