Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232687
b: refs/heads/master
c: 839f7ad
h: refs/heads/master
i:
  232685: 3bd04db
  232683: 9909c8e
  232679: 9c65a44
  232671: a047710
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 25, 2011
1 parent 9e1540e commit 6fb5aed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad3d2eedf0ed3611f5f86b9e4d0d15cc76c63465
refs/heads/master: 839f7ad6932d95f4d5ae7267b95c574714ff3d5b
34 changes: 20 additions & 14 deletions trunk/fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,18 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
pos += vec->iov_len;
}

/*
* If no bytes were started, return the error, and let the
* generic layer handle the completion.
*/
if (requested_bytes == 0) {
nfs_direct_req_release(dreq);
return result < 0 ? result : -EIO;
}

if (put_dreq(dreq))
nfs_direct_complete(dreq);

if (requested_bytes != 0)
return 0;

if (result < 0)
return result;
return -EIO;
return 0;
}

static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
Expand Down Expand Up @@ -841,15 +844,18 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
pos += vec->iov_len;
}

/*
* If no bytes were started, return the error, and let the
* generic layer handle the completion.
*/
if (requested_bytes == 0) {
nfs_direct_req_release(dreq);
return result < 0 ? result : -EIO;
}

if (put_dreq(dreq))
nfs_direct_write_complete(dreq, dreq->inode);

if (requested_bytes != 0)
return 0;

if (result < 0)
return result;
return -EIO;
return 0;
}

static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
Expand Down

0 comments on commit 6fb5aed

Please sign in to comment.