diff options
-rw-r--r-- | fs/cifs/cifsglob.h | 1 | ||||
-rw-r--r-- | fs/cifs/dir.c | 1 | ||||
-rw-r--r-- | fs/cifs/file.c | 11 |
3 files changed, 3 insertions, 10 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index b746dec88396..9f99afab9a04 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -388,7 +388,6 @@ struct cifsFileInfo { | |||
388 | __u16 netfid; /* file id from remote */ | 388 | __u16 netfid; /* file id from remote */ |
389 | /* BB add lock scope info here if needed */ ; | 389 | /* BB add lock scope info here if needed */ ; |
390 | /* lock scope id (0 if none) */ | 390 | /* lock scope id (0 if none) */ |
391 | struct file *pfile; /* needed for writepage */ | ||
392 | struct dentry *dentry; | 391 | struct dentry *dentry; |
393 | unsigned int f_flags; | 392 | unsigned int f_flags; |
394 | struct tcon_link *tlink; | 393 | struct tcon_link *tlink; |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 3c23d882a44c..600eac18cb21 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -148,7 +148,6 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file, | |||
148 | pCifsFile->uid = current_fsuid(); | 148 | pCifsFile->uid = current_fsuid(); |
149 | pCifsFile->dentry = dget(dentry); | 149 | pCifsFile->dentry = dget(dentry); |
150 | pCifsFile->f_flags = file->f_flags; | 150 | pCifsFile->f_flags = file->f_flags; |
151 | pCifsFile->pfile = file; | ||
152 | pCifsFile->invalidHandle = false; | 151 | pCifsFile->invalidHandle = false; |
153 | pCifsFile->closePend = false; | 152 | pCifsFile->closePend = false; |
154 | pCifsFile->tlink = cifs_get_tlink(tlink); | 153 | pCifsFile->tlink = cifs_get_tlink(tlink); |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d5f3007364e3..7935816fa111 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1144,8 +1144,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, | |||
1144 | continue; | 1144 | continue; |
1145 | if (fsuid_only && open_file->uid != current_fsuid()) | 1145 | if (fsuid_only && open_file->uid != current_fsuid()) |
1146 | continue; | 1146 | continue; |
1147 | if (open_file->pfile && ((open_file->pfile->f_flags & O_RDWR) || | 1147 | if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) { |
1148 | (open_file->pfile->f_flags & O_RDONLY))) { | ||
1149 | if (!open_file->invalidHandle) { | 1148 | if (!open_file->invalidHandle) { |
1150 | /* found a good file */ | 1149 | /* found a good file */ |
1151 | /* lock it so it will not be closed on us */ | 1150 | /* lock it so it will not be closed on us */ |
@@ -1194,9 +1193,7 @@ refind_writable: | |||
1194 | continue; | 1193 | continue; |
1195 | if (fsuid_only && open_file->uid != current_fsuid()) | 1194 | if (fsuid_only && open_file->uid != current_fsuid()) |
1196 | continue; | 1195 | continue; |
1197 | if (open_file->pfile && | 1196 | if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { |
1198 | ((open_file->pfile->f_flags & O_RDWR) || | ||
1199 | (open_file->pfile->f_flags & O_WRONLY))) { | ||
1200 | cifsFileInfo_get(open_file); | 1197 | cifsFileInfo_get(open_file); |
1201 | 1198 | ||
1202 | if (!open_file->invalidHandle) { | 1199 | if (!open_file->invalidHandle) { |
@@ -2160,9 +2157,7 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode) | |||
2160 | list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { | 2157 | list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { |
2161 | if (open_file->closePend) | 2158 | if (open_file->closePend) |
2162 | continue; | 2159 | continue; |
2163 | if (open_file->pfile && | 2160 | if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { |
2164 | ((open_file->pfile->f_flags & O_RDWR) || | ||
2165 | (open_file->pfile->f_flags & O_WRONLY))) { | ||
2166 | read_unlock(&GlobalSMBSeslock); | 2161 | read_unlock(&GlobalSMBSeslock); |
2167 | return 1; | 2162 | return 1; |
2168 | } | 2163 | } |