diff options
Diffstat (limited to 'fs/cifs/smb2inode.c')
| -rw-r--r-- | fs/cifs/smb2inode.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index f14533da3a93..01a76bccdb8d 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c | |||
| @@ -293,6 +293,8 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 293 | int rc; | 293 | int rc; |
| 294 | struct smb2_file_all_info *smb2_data; | 294 | struct smb2_file_all_info *smb2_data; |
| 295 | __u32 create_options = 0; | 295 | __u32 create_options = 0; |
| 296 | struct cifs_fid fid; | ||
| 297 | bool no_cached_open = tcon->nohandlecache; | ||
| 296 | 298 | ||
| 297 | *adjust_tz = false; | 299 | *adjust_tz = false; |
| 298 | *symlink = false; | 300 | *symlink = false; |
| @@ -301,6 +303,21 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 301 | GFP_KERNEL); | 303 | GFP_KERNEL); |
| 302 | if (smb2_data == NULL) | 304 | if (smb2_data == NULL) |
| 303 | return -ENOMEM; | 305 | return -ENOMEM; |
| 306 | |||
| 307 | /* If it is a root and its handle is cached then use it */ | ||
| 308 | if (!strlen(full_path) && !no_cached_open) { | ||
| 309 | rc = open_shroot(xid, tcon, &fid); | ||
| 310 | if (rc) | ||
| 311 | goto out; | ||
| 312 | rc = SMB2_query_info(xid, tcon, fid.persistent_fid, | ||
| 313 | fid.volatile_fid, smb2_data); | ||
| 314 | close_shroot(&tcon->crfid); | ||
| 315 | if (rc) | ||
| 316 | goto out; | ||
| 317 | move_smb2_info_to_cifs(data, smb2_data); | ||
| 318 | goto out; | ||
| 319 | } | ||
| 320 | |||
| 304 | if (backup_cred(cifs_sb)) | 321 | if (backup_cred(cifs_sb)) |
| 305 | create_options |= CREATE_OPEN_BACKUP_INTENT; | 322 | create_options |= CREATE_OPEN_BACKUP_INTENT; |
| 306 | 323 | ||
