diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-09 21:11:08 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-15 22:04:27 +0300 |
commit | 65a4a1cad7c56e7056fb4b35ac2d93695612612c (patch) | |
tree | 4003fa611739da71f5ebdfe323f1f294743ebf35 /fs/nfs/file.c | |
parent | 7da839c475894ea872ec909a5d2e83dddccff5be (diff) | |
download | linux-65a4a1cad7c56e7056fb4b35ac2d93695612612c.tar.xz |
nfs: generic_write_checks() shouldn't be done on swapout...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r-- | fs/nfs/file.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 14364dc001f7..c40e4363e746 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -674,17 +674,20 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) unsigned long written = 0; ssize_t result; size_t count = iov_iter_count(from); - loff_t pos = iocb->ki_pos; result = nfs_key_timeout_notify(file, inode); if (result) return result; - if (iocb->ki_flags & IOCB_DIRECT) - return nfs_file_direct_write(iocb, from, pos); + if (iocb->ki_flags & IOCB_DIRECT) { + result = generic_write_checks(iocb, from); + if (result <= 0) + return result; + return nfs_file_direct_write(iocb, from); + } dprintk("NFS: write(%pD2, %zu@%Ld)\n", - file, count, (long long) pos); + file, count, (long long) iocb->ki_pos); result = -EBUSY; if (IS_SWAPFILE(inode)) |