diff options
-rw-r--r-- | fs/cifs/dir.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index d791d0763a9c..bd363df19b3f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -129,6 +129,12 @@ cifs_bp_rename_retry: | |||
129 | return full_path; | 129 | return full_path; |
130 | } | 130 | } |
131 | 131 | ||
132 | /* | ||
133 | * When called with struct file pointer set to NULL, there is no way we could | ||
134 | * update file->private_data, but getting it stuck on openFileList provides a | ||
135 | * way to access it from cifs_fill_filedata and thereby set file->private_data | ||
136 | * from cifs_open. | ||
137 | */ | ||
132 | struct cifsFileInfo * | 138 | struct cifsFileInfo * |
133 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | 139 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, |
134 | struct file *file, struct vfsmount *mnt, unsigned int oflags) | 140 | struct file *file, struct vfsmount *mnt, unsigned int oflags) |
@@ -251,6 +257,10 @@ int cifs_posix_open(char *full_path, struct inode **pinode, | |||
251 | cifs_fattr_to_inode(*pinode, &fattr); | 257 | cifs_fattr_to_inode(*pinode, &fattr); |
252 | } | 258 | } |
253 | 259 | ||
260 | /* | ||
261 | * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to | ||
262 | * file->private_data. | ||
263 | */ | ||
254 | if (mnt) | 264 | if (mnt) |
255 | cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags); | 265 | cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags); |
256 | 266 | ||
@@ -466,8 +476,12 @@ cifs_create_set_dentry: | |||
466 | /* mknod case - do not leave file open */ | 476 | /* mknod case - do not leave file open */ |
467 | CIFSSMBClose(xid, tcon, fileHandle); | 477 | CIFSSMBClose(xid, tcon, fileHandle); |
468 | } else if (!(posix_create) && (newinode)) { | 478 | } else if (!(posix_create) && (newinode)) { |
469 | cifs_new_fileinfo(newinode, fileHandle, NULL, | 479 | /* |
470 | nd->path.mnt, oflags); | 480 | * cifs_fill_filedata() takes care of setting cifsFileInfo |
481 | * pointer to file->private_data. | ||
482 | */ | ||
483 | cifs_new_fileinfo(newinode, fileHandle, NULL, nd->path.mnt, | ||
484 | oflags); | ||
471 | } | 485 | } |
472 | cifs_create_out: | 486 | cifs_create_out: |
473 | kfree(buf); | 487 | kfree(buf); |