summaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-11-04 05:32:04 -0500
committerThomas Gleixner <tglx@linutronix.de>2019-11-04 05:32:04 -0500
commitca8888d7ae6fa18454c9e4f192c56bc6c8ca9b33 (patch)
treec2b86b162f8fc2adf8a98f7e074500bee155d603 /fs/fuse/file.c
parentdb616173d787395787ecc93eef075fa975227b10 (diff)
parenta99d8080aaf358d5d23581244e5da23b35e340b9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
to pick up the KVM fix which is required for the NX series.
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 0f0225686aee..db48a5cf8620 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -217,7 +217,7 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
217{ 217{
218 struct fuse_conn *fc = get_fuse_conn(inode); 218 struct fuse_conn *fc = get_fuse_conn(inode);
219 int err; 219 int err;
220 bool lock_inode = (file->f_flags & O_TRUNC) && 220 bool is_wb_truncate = (file->f_flags & O_TRUNC) &&
221 fc->atomic_o_trunc && 221 fc->atomic_o_trunc &&
222 fc->writeback_cache; 222 fc->writeback_cache;
223 223
@@ -225,16 +225,20 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
225 if (err) 225 if (err)
226 return err; 226 return err;
227 227
228 if (lock_inode) 228 if (is_wb_truncate) {
229 inode_lock(inode); 229 inode_lock(inode);
230 fuse_set_nowrite(inode);
231 }
230 232
231 err = fuse_do_open(fc, get_node_id(inode), file, isdir); 233 err = fuse_do_open(fc, get_node_id(inode), file, isdir);
232 234
233 if (!err) 235 if (!err)
234 fuse_finish_open(inode, file); 236 fuse_finish_open(inode, file);
235 237
236 if (lock_inode) 238 if (is_wb_truncate) {
239 fuse_release_nowrite(inode);
237 inode_unlock(inode); 240 inode_unlock(inode);
241 }
238 242
239 return err; 243 return err;
240} 244}
@@ -1997,7 +2001,7 @@ static int fuse_writepages_fill(struct page *page,
1997 2001
1998 if (!data->ff) { 2002 if (!data->ff) {
1999 err = -EIO; 2003 err = -EIO;
2000 data->ff = fuse_write_file_get(fc, get_fuse_inode(inode)); 2004 data->ff = fuse_write_file_get(fc, fi);
2001 if (!data->ff) 2005 if (!data->ff)
2002 goto out_unlock; 2006 goto out_unlock;
2003 } 2007 }
@@ -2042,8 +2046,6 @@ static int fuse_writepages_fill(struct page *page,
2042 * under writeback, so we can release the page lock. 2046 * under writeback, so we can release the page lock.
2043 */ 2047 */
2044 if (data->wpa == NULL) { 2048 if (data->wpa == NULL) {
2045 struct fuse_inode *fi = get_fuse_inode(inode);
2046
2047 err = -ENOMEM; 2049 err = -ENOMEM;
2048 wpa = fuse_writepage_args_alloc(); 2050 wpa = fuse_writepage_args_alloc();
2049 if (!wpa) { 2051 if (!wpa) {