diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 2c90d07c0b3a..888398067420 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -725,6 +725,19 @@ out_nls: | |||
725 | goto out; | 725 | goto out; |
726 | } | 726 | } |
727 | 727 | ||
728 | static ssize_t | ||
729 | cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter) | ||
730 | { | ||
731 | ssize_t rc; | ||
732 | struct inode *inode = file_inode(iocb->ki_filp); | ||
733 | |||
734 | rc = cifs_revalidate_mapping(inode); | ||
735 | if (rc) | ||
736 | return rc; | ||
737 | |||
738 | return generic_file_read_iter(iocb, iter); | ||
739 | } | ||
740 | |||
728 | static ssize_t cifs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) | 741 | static ssize_t cifs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) |
729 | { | 742 | { |
730 | struct inode *inode = file_inode(iocb->ki_filp); | 743 | struct inode *inode = file_inode(iocb->ki_filp); |
@@ -881,7 +894,7 @@ const struct inode_operations cifs_symlink_inode_ops = { | |||
881 | const struct file_operations cifs_file_ops = { | 894 | const struct file_operations cifs_file_ops = { |
882 | .read = new_sync_read, | 895 | .read = new_sync_read, |
883 | .write = new_sync_write, | 896 | .write = new_sync_write, |
884 | .read_iter = generic_file_read_iter, | 897 | .read_iter = cifs_loose_read_iter, |
885 | .write_iter = cifs_file_write_iter, | 898 | .write_iter = cifs_file_write_iter, |
886 | .open = cifs_open, | 899 | .open = cifs_open, |
887 | .release = cifs_close, | 900 | .release = cifs_close, |
@@ -939,7 +952,7 @@ const struct file_operations cifs_file_direct_ops = { | |||
939 | const struct file_operations cifs_file_nobrl_ops = { | 952 | const struct file_operations cifs_file_nobrl_ops = { |
940 | .read = new_sync_read, | 953 | .read = new_sync_read, |
941 | .write = new_sync_write, | 954 | .write = new_sync_write, |
942 | .read_iter = generic_file_read_iter, | 955 | .read_iter = cifs_loose_read_iter, |
943 | .write_iter = cifs_file_write_iter, | 956 | .write_iter = cifs_file_write_iter, |
944 | .open = cifs_open, | 957 | .open = cifs_open, |
945 | .release = cifs_close, | 958 | .release = cifs_close, |