diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_file.c | 3 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 3 | ||||
-rw-r--r-- | fs/9p/vfs_inode_dotl.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3337d58d0fc5..6997eb62fbba 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -91,7 +91,8 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
91 | 91 | ||
92 | file->private_data = fid; | 92 | file->private_data = fid; |
93 | mutex_lock(&v9inode->v_mutex); | 93 | mutex_lock(&v9inode->v_mutex); |
94 | if (v9ses->cache && !v9inode->writeback_fid) { | 94 | if (v9ses->cache && !v9inode->writeback_fid && |
95 | ((file->f_flags & O_ACCMODE) != O_RDONLY)) { | ||
95 | /* | 96 | /* |
96 | * clone a fid and add it to writeback_fid | 97 | * clone a fid and add it to writeback_fid |
97 | * we do it during open time instead of | 98 | * we do it during open time instead of |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 0afbbb450faf..774a20af01ea 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -652,7 +652,8 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
652 | if (nd && nd->flags & LOOKUP_OPEN) { | 652 | if (nd && nd->flags & LOOKUP_OPEN) { |
653 | v9inode = V9FS_I(dentry->d_inode); | 653 | v9inode = V9FS_I(dentry->d_inode); |
654 | mutex_lock(&v9inode->v_mutex); | 654 | mutex_lock(&v9inode->v_mutex); |
655 | if (v9ses->cache && !v9inode->writeback_fid) { | 655 | if (v9ses->cache && !v9inode->writeback_fid && |
656 | ((flags & O_ACCMODE) != O_RDONLY)) { | ||
656 | /* | 657 | /* |
657 | * clone a fid and add it to writeback_fid | 658 | * clone a fid and add it to writeback_fid |
658 | * we do it during open time instead of | 659 | * we do it during open time instead of |
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 0a0ac30d51d6..8b616dc3567a 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c | |||
@@ -246,7 +246,8 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, | |||
246 | 246 | ||
247 | v9inode = V9FS_I(inode); | 247 | v9inode = V9FS_I(inode); |
248 | mutex_lock(&v9inode->v_mutex); | 248 | mutex_lock(&v9inode->v_mutex); |
249 | if (v9ses->cache && !v9inode->writeback_fid) { | 249 | if (v9ses->cache && !v9inode->writeback_fid && |
250 | ((flags & O_ACCMODE) != O_RDONLY)) { | ||
250 | /* | 251 | /* |
251 | * clone a fid and add it to writeback_fid | 252 | * clone a fid and add it to writeback_fid |
252 | * we do it during open time instead of | 253 | * we do it during open time instead of |