diff options
author | Steve French <sfrench@us.ibm.com> | 2009-05-07 23:04:30 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-05-07 23:04:30 -0400 |
commit | 90e4ee5d311d4e0729daa676b1d7f754265b5874 (patch) | |
tree | d1731b21e054dab9edde4f6132e8999d9f269063 /fs/cifs/dir.c | |
parent | ac68392460ffefed13020967bae04edc4d3add06 (diff) |
[CIFS] Fix double list addition in cifs posix open code
Remove adding open file entry twice to lists in the file
Do not fill file info twice in case of posix opens and creates
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 461750e01364..11431ed72a7f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -281,6 +281,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
281 | int create_options = CREATE_NOT_DIR; | 281 | int create_options = CREATE_NOT_DIR; |
282 | int oplock = 0; | 282 | int oplock = 0; |
283 | int oflags; | 283 | int oflags; |
284 | bool posix_create = false; | ||
284 | /* | 285 | /* |
285 | * BB below access is probably too much for mknod to request | 286 | * BB below access is probably too much for mknod to request |
286 | * but we have to do query and setpathinfo so requesting | 287 | * but we have to do query and setpathinfo so requesting |
@@ -328,11 +329,13 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
328 | negotation. EREMOTE indicates DFS junction, which is not | 329 | negotation. EREMOTE indicates DFS junction, which is not |
329 | handled in posix open */ | 330 | handled in posix open */ |
330 | 331 | ||
331 | if ((rc == 0) && (newinode == NULL)) | 332 | if (rc == 0) { |
332 | goto cifs_create_get_file_info; /* query inode info */ | 333 | posix_create = true; |
333 | else if (rc == 0) /* success, no need to query */ | 334 | if (newinode == NULL) /* query inode info */ |
334 | goto cifs_create_set_dentry; | 335 | goto cifs_create_get_file_info; |
335 | else if ((rc != -EIO) && (rc != -EREMOTE) && | 336 | else /* success, no need to query */ |
337 | goto cifs_create_set_dentry; | ||
338 | } else if ((rc != -EIO) && (rc != -EREMOTE) && | ||
336 | (rc != -EOPNOTSUPP)) /* path not found or net err */ | 339 | (rc != -EOPNOTSUPP)) /* path not found or net err */ |
337 | goto cifs_create_out; | 340 | goto cifs_create_out; |
338 | /* else fallthrough to retry, using older open call, this is | 341 | /* else fallthrough to retry, using older open call, this is |
@@ -464,7 +467,7 @@ cifs_create_set_dentry: | |||
464 | if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { | 467 | if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { |
465 | /* mknod case - do not leave file open */ | 468 | /* mknod case - do not leave file open */ |
466 | CIFSSMBClose(xid, tcon, fileHandle); | 469 | CIFSSMBClose(xid, tcon, fileHandle); |
467 | } else if (newinode) { | 470 | } else if (!(posix_create) && (newinode)) { |
468 | cifs_fill_fileinfo(newinode, fileHandle, | 471 | cifs_fill_fileinfo(newinode, fileHandle, |
469 | cifs_sb->tcon, write_only); | 472 | cifs_sb->tcon, write_only); |
470 | } | 473 | } |