diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-22 14:38:06 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-05 19:11:02 -0400 |
commit | 2f3c7d87a347b12f725f6128b3097727b91b230e (patch) | |
tree | 6fec9e3cabc70450c148627da8ae3d2e89ab66d2 /fs | |
parent | a5314a74928fa6dbc4503a8c64f43bb5c1c12ac1 (diff) | |
download | linux-stable-2f3c7d87a347b12f725f6128b3097727b91b230e.tar.gz linux-stable-2f3c7d87a347b12f725f6128b3097727b91b230e.tar.bz2 linux-stable-2f3c7d87a347b12f725f6128b3097727b91b230e.zip |
NFS: Remove racy size manipulations in O_DIRECT
On success, the RPC callbacks will ensure that we make the appropriate calls
to nfs_writeback_update_inode()
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/direct.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index fb659bb50678..826d4dace0e5 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -376,15 +376,6 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq, bool write) { struct inode *inode = dreq->inode; - if (dreq->iocb && write) { - loff_t pos = dreq->iocb->ki_pos + dreq->count; - - spin_lock(&inode->i_lock); - if (i_size_read(inode) < pos) - i_size_write(inode, pos); - spin_unlock(&inode->i_lock); - } - if (write) nfs_zap_mapping(inode, inode->i_mapping); @@ -1058,14 +1049,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter) if (!result) { result = nfs_direct_wait(dreq); if (result > 0) { - struct inode *inode = mapping->host; - iocb->ki_pos = pos + result; - spin_lock(&inode->i_lock); - if (i_size_read(inode) < iocb->ki_pos) - i_size_write(inode, iocb->ki_pos); - spin_unlock(&inode->i_lock); - /* XXX: should check the generic_write_sync retval */ generic_write_sync(iocb, result); } |