Skip to content

Commit

Permalink
NFS: fix data_update accounting in NFS direct I/O path
Browse files Browse the repository at this point in the history
^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>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Mar 20, 2006
1 parent 15ce4a0 commit a37ec01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit a37ec01

Please sign in to comment.