diff options
author | Steve French <sfrench@us.ibm.com> | 2008-03-14 18:37:16 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-03-14 18:37:16 -0400 |
commit | 8b1327f6ed957030a64ccdb17131955bfea2d3fe (patch) | |
tree | 075ff00b4c333ef333aff5927eac45bde16d8d53 /fs/cifs/inode.c | |
parent | ebe8912be214662c8289977fb416c1f015df4a0b (diff) |
[CIFS] file create with acl support enabled is slow
Shirish Pargaonkar noted:
With cifsacl mount option, when a file is created on the Windows server,
exclusive oplock is broken right away because the get cifs acl code
again opens the file to obtain security descriptor.
The client does not have the newly created file handle or inode in any
of its lists yet so it does not respond to oplock break and server waits for
its duration and then responds to the second open. This slows down file
creation signficantly. The fix is to pass the file descriptor to the get
cifsacl code wherever available so that get cifs acl code does not send
second open (NT Create ANDX) and oplock is not broken.
CC: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e57e5c46ad48..7e4c24491729 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -371,7 +371,7 @@ static int get_sfu_mode(struct inode *inode, | |||
371 | 371 | ||
372 | int cifs_get_inode_info(struct inode **pinode, | 372 | int cifs_get_inode_info(struct inode **pinode, |
373 | const unsigned char *search_path, FILE_ALL_INFO *pfindData, | 373 | const unsigned char *search_path, FILE_ALL_INFO *pfindData, |
374 | struct super_block *sb, int xid) | 374 | struct super_block *sb, int xid, const __u16 *pfid) |
375 | { | 375 | { |
376 | int rc = 0; | 376 | int rc = 0; |
377 | struct cifsTconInfo *pTcon; | 377 | struct cifsTconInfo *pTcon; |
@@ -569,7 +569,7 @@ try_again_CIFSSMBQPathInfo: | |||
569 | /* fill in 0777 bits from ACL */ | 569 | /* fill in 0777 bits from ACL */ |
570 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 570 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
571 | cFYI(1, ("Getting mode bits from ACL")); | 571 | cFYI(1, ("Getting mode bits from ACL")); |
572 | acl_to_uid_mode(inode, search_path); | 572 | acl_to_uid_mode(inode, search_path, pfid); |
573 | } | 573 | } |
574 | #endif | 574 | #endif |
575 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { | 575 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
@@ -616,7 +616,8 @@ struct inode *cifs_iget(struct super_block *sb, unsigned long ino) | |||
616 | if (cifs_sb->tcon->unix_ext) | 616 | if (cifs_sb->tcon->unix_ext) |
617 | rc = cifs_get_inode_info_unix(&inode, "", inode->i_sb, xid); | 617 | rc = cifs_get_inode_info_unix(&inode, "", inode->i_sb, xid); |
618 | else | 618 | else |
619 | rc = cifs_get_inode_info(&inode, "", NULL, inode->i_sb, xid); | 619 | rc = cifs_get_inode_info(&inode, "", NULL, inode->i_sb, xid, |
620 | NULL); | ||
620 | if (rc && cifs_sb->tcon->ipc) { | 621 | if (rc && cifs_sb->tcon->ipc) { |
621 | cFYI(1, ("ipc connection - fake read inode")); | 622 | cFYI(1, ("ipc connection - fake read inode")); |
622 | inode->i_mode |= S_IFDIR; | 623 | inode->i_mode |= S_IFDIR; |
@@ -949,7 +950,7 @@ mkdir_get_info: | |||
949 | inode->i_sb, xid); | 950 | inode->i_sb, xid); |
950 | else | 951 | else |
951 | rc = cifs_get_inode_info(&newinode, full_path, NULL, | 952 | rc = cifs_get_inode_info(&newinode, full_path, NULL, |
952 | inode->i_sb, xid); | 953 | inode->i_sb, xid, NULL); |
953 | 954 | ||
954 | if (pTcon->nocase) | 955 | if (pTcon->nocase) |
955 | direntry->d_op = &cifs_ci_dentry_ops; | 956 | direntry->d_op = &cifs_ci_dentry_ops; |
@@ -1231,7 +1232,7 @@ int cifs_revalidate(struct dentry *direntry) | |||
1231 | } | 1232 | } |
1232 | } else { | 1233 | } else { |
1233 | rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL, | 1234 | rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL, |
1234 | direntry->d_sb, xid); | 1235 | direntry->d_sb, xid, NULL); |
1235 | if (rc) { | 1236 | if (rc) { |
1236 | cFYI(1, ("error on getting revalidate info %d", rc)); | 1237 | cFYI(1, ("error on getting revalidate info %d", rc)); |
1237 | /* if (rc != -ENOENT) | 1238 | /* if (rc != -ENOENT) |