aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e9dcf5ee29a2..07ff9351e9ee 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1954,7 +1954,7 @@ static int cifs_readpage(struct file *file, struct page *page)
1954 refreshing the inode only on increases in the file size 1954 refreshing the inode only on increases in the file size
1955 but this is tricky to do without racing with writebehind 1955 but this is tricky to do without racing with writebehind
1956 page caching in the current Linux kernel design */ 1956 page caching in the current Linux kernel design */
1957int is_size_safe_to_change(struct cifsInodeInfo *cifsInode) 1957int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
1958{ 1958{
1959 struct cifsFileInfo *open_file = NULL; 1959 struct cifsFileInfo *open_file = NULL;
1960 1960
@@ -1976,6 +1976,9 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode)
1976 return 1; 1976 return 1;
1977 } 1977 }
1978 1978
1979 if(i_size_read(&cifsInode->vfs_inode) < end_of_file)
1980 return 1;
1981
1979 return 0; 1982 return 0;
1980 } else 1983 } else
1981 return 1; 1984 return 1;