aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 75541af4b3db..542e0c874d64 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -299,8 +299,7 @@ int cifs_open(struct inode *inode, struct file *file)
299 int oflags = (int) cifs_posix_convert_flags(file->f_flags); 299 int oflags = (int) cifs_posix_convert_flags(file->f_flags);
300 oflags |= SMB_O_CREAT; 300 oflags |= SMB_O_CREAT;
301 /* can not refresh inode info since size could be stale */ 301 /* can not refresh inode info since size could be stale */
302 rc = cifs_posix_open(full_path, &inode, file->f_path.mnt, 302 rc = cifs_posix_open(full_path, &inode, inode->i_sb,
303 inode->i_sb,
304 cifs_sb->mnt_file_mode /* ignored */, 303 cifs_sb->mnt_file_mode /* ignored */,
305 oflags, &oplock, &netfid, xid); 304 oflags, &oplock, &netfid, xid);
306 if (rc == 0) { 305 if (rc == 0) {
@@ -308,7 +307,16 @@ int cifs_open(struct inode *inode, struct file *file)
308 /* no need for special case handling of setting mode 307 /* no need for special case handling of setting mode
309 on read only files needed here */ 308 on read only files needed here */
310 309
311 pCifsFile = cifs_fill_filedata(file); 310 pCifsFile = cifs_new_fileinfo(inode, netfid, file,
311 file->f_path.mnt,
312 oflags);
313 if (pCifsFile == NULL) {
314 CIFSSMBClose(xid, tcon, netfid);
315 rc = -ENOMEM;
316 goto out;
317 }
318 file->private_data = pCifsFile;
319
312 cifs_posix_open_inode_helper(inode, file, pCifsInode, 320 cifs_posix_open_inode_helper(inode, file, pCifsInode,
313 oplock, netfid); 321 oplock, netfid);
314 goto out; 322 goto out;
@@ -513,8 +521,7 @@ reopen_error_exit:
513 le64_to_cpu(tcon->fsUnixInfo.Capability))) { 521 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
514 int oflags = (int) cifs_posix_convert_flags(file->f_flags); 522 int oflags = (int) cifs_posix_convert_flags(file->f_flags);
515 /* can not refresh inode info since size could be stale */ 523 /* can not refresh inode info since size could be stale */
516 rc = cifs_posix_open(full_path, NULL, file->f_path.mnt, 524 rc = cifs_posix_open(full_path, NULL, inode->i_sb,
517 inode->i_sb,
518 cifs_sb->mnt_file_mode /* ignored */, 525 cifs_sb->mnt_file_mode /* ignored */,
519 oflags, &oplock, &netfid, xid); 526 oflags, &oplock, &netfid, xid);
520 if (rc == 0) { 527 if (rc == 0) {