Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=432409eebcdec38ff6fa949f097b5438d588faa5 Commit: 432409eebcdec38ff6fa949f097b5438d588faa5 Parent: a7aed1c2dc4939d1d61285c738ad32700d791692 Author: Neil Brown <[EMAIL PROTECTED]> AuthorDate: Tue Oct 23 17:09:13 2007 -0400 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Tue Oct 23 16:41:21 2007 -0700
NFS: Fix for bug in handling of errors for O_DIRECT writes Commit eda3cef8dd2b83875affe82595db9d0c278879b2 ("NFS: Fix error handling in nfs_direct_write_result()") ensured that if a WRITE returns an error, then data->res.verf->committed is not tested (as it is not initialised). Then commit 60fa3f769f7651a60125a0f44e3ffe3246d7cf39 ("NFS: Fix two bugs in the O_DIRECT write code") inadvertently reverted this while fixing other problems. So move the test so that we never examine ->committed in an error case, and fix a speeling error while we are there. Cc: Chuck Lever <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> Acked-by: Chuck Lever <[EMAIL PROTECTED]> Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- fs/nfs/direct.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 32fe972..afcab00 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -549,13 +549,13 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata) spin_lock(&dreq->lock); - if (unlikely(dreq->error != 0)) - goto out_unlock; if (unlikely(status < 0)) { - /* An error has occured, so we should not commit */ + /* An error has occurred, so we should not commit */ dreq->flags = 0; dreq->error = status; } + if (unlikely(dreq->error != 0)) + goto out_unlock; dreq->count += data->res.count; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html