]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Fixed Regression in NFS Direct I/O path
authorSteve Dickson <steved@redhat.com>
Thu, 28 Oct 2010 12:17:54 +0000 (08:17 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 28 Oct 2010 15:14:05 +0000 (11:14 -0400)
A typo, introduced by commit f11ac8db, in the nfs_direct_write()
routine causes writes with O_DIRECT set to fail with a ENOMEM error.

Found-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/direct.c

index 064a80961677fbf3c62e309a4f15693e391ed7e6..84d3c8b902068a057805e33c9533ffda7f6c0100 100644 (file)
@@ -873,7 +873,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
        dreq->inode = inode;
        dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp));
        dreq->l_ctx = nfs_get_lock_context(dreq->ctx);
-       if (dreq->l_ctx != NULL)
+       if (dreq->l_ctx == NULL)
                goto out_release;
        if (!is_sync_kiocb(iocb))
                dreq->iocb = iocb;