diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-29 18:30:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-29 18:30:26 -0400 |
commit | e7bdea7750eb2a64aea4a08fa5c0a31719c8155d (patch) | |
tree | 1a4bb5307a59a21269f045c69695dbbd811de79f /fs/nfs/direct.c | |
parent | 89a82a9218fabd753979847f494565f1fa91d7a8 (diff) | |
parent | e547f2628327fec6afd2e03b46f113f614cca05b (diff) |
Merge tag 'nfs-for-4.7-2' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client bugfixes from Anna Schumaker:
"Stable bugfixes:
- Fix _cancel_empty_pagelist
- Fix a double page unlock
- Make nfs_atomic_open() call d_drop() on all ->open_context() errors.
- Fix another OPEN_DOWNGRADE bug
Other bugfixes:
- Ensure we handle delegation errors in nfs4_proc_layoutget()
- Layout stateids start out as being invalid
- Add sparse lock annotations for pnfs_find_alloc_layout
- Handle bad delegation stateids in nfs4_layoutget_handle_exception
- Fix up O_DIRECT results
- Fix potential use after free of state in nfs4_do_reclaim.
- Mark the layout stateid invalid when all segments are removed
- Don't let readdirplus revalidate an inode that was marked as stale
- Fix potential race in nfs_fhget()
- Fix an unused variable warning"
* tag 'nfs-for-4.7-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
NFS: Fix another OPEN_DOWNGRADE bug
make nfs_atomic_open() call d_drop() on all ->open_context() errors.
NFS: Fix an unused variable warning
NFS: Fix potential race in nfs_fhget()
NFS: Don't let readdirplus revalidate an inode that was marked as stale
NFSv4.1/pnfs: Mark the layout stateid invalid when all segments are removed
NFS: Fix a double page unlock
pnfs_nfs: fix _cancel_empty_pagelist
nfs4: Fix potential use after free of state in nfs4_do_reclaim.
NFS: Fix up O_DIRECT results
NFS/pnfs: handle bad delegation stateids in nfs4_layoutget_handle_exception
NFSv4.1/pnfs: Add sparse lock annotations for pnfs_find_alloc_layout
NFSv4.1/pnfs: Layout stateids start out as being invalid
NFSv4.1/pnfs: Ensure we handle delegation errors in nfs4_proc_layoutget()
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 979b3c4dee6a..c7326c2af2c3 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -353,10 +353,12 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq) | |||
353 | 353 | ||
354 | result = wait_for_completion_killable(&dreq->completion); | 354 | result = wait_for_completion_killable(&dreq->completion); |
355 | 355 | ||
356 | if (!result) { | ||
357 | result = dreq->count; | ||
358 | WARN_ON_ONCE(dreq->count < 0); | ||
359 | } | ||
356 | if (!result) | 360 | if (!result) |
357 | result = dreq->error; | 361 | result = dreq->error; |
358 | if (!result) | ||
359 | result = dreq->count; | ||
360 | 362 | ||
361 | out: | 363 | out: |
362 | return (ssize_t) result; | 364 | return (ssize_t) result; |
@@ -386,8 +388,10 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq, bool write) | |||
386 | 388 | ||
387 | if (dreq->iocb) { | 389 | if (dreq->iocb) { |
388 | long res = (long) dreq->error; | 390 | long res = (long) dreq->error; |
389 | if (!res) | 391 | if (dreq->count != 0) { |
390 | res = (long) dreq->count; | 392 | res = (long) dreq->count; |
393 | WARN_ON_ONCE(dreq->count < 0); | ||
394 | } | ||
391 | dreq->iocb->ki_complete(dreq->iocb, res, 0); | 395 | dreq->iocb->ki_complete(dreq->iocb, res, 0); |
392 | } | 396 | } |
393 | 397 | ||