[CIFS] Allow update of EOF on remote extend of file
[linux-block.git] / fs / cifs / file.c
index e9dcf5ee29a25bb42e765c57b5a916b84cd777c8..07ff9351e9ee71d5586f47827f92f1f9c1f7b4ff 100644 (file)
@@ -1954,7 +1954,7 @@ static int cifs_readpage(struct file *file, struct page *page)
    refreshing the inode only on increases in the file size 
    but this is tricky to do without racing with writebehind
    page caching in the current Linux kernel design */
-int is_size_safe_to_change(struct cifsInodeInfo *cifsInode)
+int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
 {
        struct cifsFileInfo *open_file = NULL;
 
@@ -1976,6 +1976,9 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode)
                        return 1;
                }
 
+               if(i_size_read(&cifsInode->vfs_inode) < end_of_file)
+                       return 1;
+
                return 0;
        } else
                return 1;