summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2006-03-20 13:44:35 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:35 -0500
commita37ec012d7fd352648c8455d3396ea24001efcd3 (patch)
tree778182e20ada2cf1ce3a5507ab1eec96c16633b2 /fs/nfs
parent15ce4a0c1ce0d5e288398cb9e5493fd4e55e2025 (diff)
NFS: fix data_update accounting in NFS direct I/O path
^C against "iozone -I" is hitting the assertion in nfs_clear_inode(). Test plan: "iozone -i0 -I -a -c" against a slow server, then control C. This should not cause an oops. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/direct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 3de7c4b07968..737990dd4dfe 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -219,6 +219,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
} else
wake_up(&dreq->wait);
+ iput(dreq->inode);
kref_put(&dreq->kref, nfs_direct_req_release);
}
@@ -374,6 +375,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
dreq->pages = pages;
dreq->npages = nr_pages;
+ igrab(inode);
dreq->inode = inode;
dreq->filp = iocb->ki_filp;
if (!is_sync_kiocb(iocb))
@@ -549,6 +551,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
dreq->pages = pages;
dreq->npages = nr_pages;
+ igrab(inode);
dreq->inode = inode;
dreq->filp = iocb->ki_filp;
if (!is_sync_kiocb(iocb))