diff options
Diffstat (limited to 'fs/cifs/file.c')
| -rw-r--r-- | fs/cifs/file.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index c249b628fd1c..670ec1e84da0 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
| @@ -1835,10 +1835,20 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode) | |||
| 1835 | open_file = find_writable_file(cifsInode); | 1835 | open_file = find_writable_file(cifsInode); |
| 1836 | 1836 | ||
| 1837 | if(open_file) { | 1837 | if(open_file) { |
| 1838 | struct cifs_sb_info *cifs_sb; | ||
| 1839 | |||
| 1838 | /* there is not actually a write pending so let | 1840 | /* there is not actually a write pending so let |
| 1839 | this handle go free and allow it to | 1841 | this handle go free and allow it to |
| 1840 | be closable if needed */ | 1842 | be closable if needed */ |
| 1841 | atomic_dec(&open_file->wrtPending); | 1843 | atomic_dec(&open_file->wrtPending); |
| 1844 | |||
| 1845 | cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); | ||
| 1846 | if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { | ||
| 1847 | /* since no page cache to corrupt on directio | ||
| 1848 | we can change size safely */ | ||
| 1849 | return 1; | ||
| 1850 | } | ||
| 1851 | |||
| 1842 | return 0; | 1852 | return 0; |
| 1843 | } else | 1853 | } else |
| 1844 | return 1; | 1854 | return 1; |
