summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <bcrl@kvack.org>2014-07-14 13:14:27 -0400
committerBenjamin LaHaise <bcrl@kvack.org>2014-07-14 13:14:27 -0400
commit6e830d53717cf3d5c30c1afce3773ef97e436cd9 (patch)
tree9376a0424b8f9fff12d107aa2498e775da20e85d /fs/cifs/cifsfs.c
parent855ef0dec7271ff7be7381feaaf3f4aed80bd503 (diff)
parent263782c1c95bbddbb022dc092fd89a36bb8d5577 (diff)
downloadop-kernel-dev-6e830d53717cf3d5c30c1afce3773ef97e436cd9.zip
op-kernel-dev-6e830d53717cf3d5c30c1afce3773ef97e436cd9.tar.gz
Merge ../aio-fixes
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 2c90d07..8883980 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -725,6 +725,19 @@ out_nls:
goto out;
}
+static ssize_t
+cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter)
+{
+ ssize_t rc;
+ struct inode *inode = file_inode(iocb->ki_filp);
+
+ rc = cifs_revalidate_mapping(inode);
+ if (rc)
+ return rc;
+
+ return generic_file_read_iter(iocb, iter);
+}
+
static ssize_t cifs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct inode *inode = file_inode(iocb->ki_filp);
@@ -881,7 +894,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const struct file_operations cifs_file_ops = {
.read = new_sync_read,
.write = new_sync_write,
- .read_iter = generic_file_read_iter,
+ .read_iter = cifs_loose_read_iter,
.write_iter = cifs_file_write_iter,
.open = cifs_open,
.release = cifs_close,
@@ -939,7 +952,7 @@ const struct file_operations cifs_file_direct_ops = {
const struct file_operations cifs_file_nobrl_ops = {
.read = new_sync_read,
.write = new_sync_write,
- .read_iter = generic_file_read_iter,
+ .read_iter = cifs_loose_read_iter,
.write_iter = cifs_file_write_iter,
.open = cifs_open,
.release = cifs_close,
OpenPOWER on IntegriCloud