diff options
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r-- | fs/9p/vfs_file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 78bcb97c3425..3337d58d0fc5 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -90,6 +90,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
90 | } | 90 | } |
91 | 91 | ||
92 | file->private_data = fid; | 92 | file->private_data = fid; |
93 | mutex_lock(&v9inode->v_mutex); | ||
93 | if (v9ses->cache && !v9inode->writeback_fid) { | 94 | if (v9ses->cache && !v9inode->writeback_fid) { |
94 | /* | 95 | /* |
95 | * clone a fid and add it to writeback_fid | 96 | * clone a fid and add it to writeback_fid |
@@ -101,10 +102,12 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
101 | fid = v9fs_writeback_fid(file->f_path.dentry); | 102 | fid = v9fs_writeback_fid(file->f_path.dentry); |
102 | if (IS_ERR(fid)) { | 103 | if (IS_ERR(fid)) { |
103 | err = PTR_ERR(fid); | 104 | err = PTR_ERR(fid); |
105 | mutex_unlock(&v9inode->v_mutex); | ||
104 | goto out_error; | 106 | goto out_error; |
105 | } | 107 | } |
106 | v9inode->writeback_fid = (void *) fid; | 108 | v9inode->writeback_fid = (void *) fid; |
107 | } | 109 | } |
110 | mutex_unlock(&v9inode->v_mutex); | ||
108 | #ifdef CONFIG_9P_FSCACHE | 111 | #ifdef CONFIG_9P_FSCACHE |
109 | if (v9ses->cache) | 112 | if (v9ses->cache) |
110 | v9fs_cache_inode_set_cookie(inode, file); | 113 | v9fs_cache_inode_set_cookie(inode, file); |