提交 a37ec012 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

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: NChuck Lever <cel@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 15ce4a0c
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册