Skip to content

Commit d313852

Browse files
committed
smb311: add support for using info level for posix extensions query
Adds calls to the newer info level for query info using SMB3.1.1 posix extensions. The remaining two places that call the older query info (non-SMB3.1.1 POSIX) require passing in the fid and can be updated in a later patch. Signed-off-by: Steve French <[email protected]> Reviewed-by: Aurelien Aptel <[email protected]>
1 parent 790434f commit d313852

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

fs/cifs/dir.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
411411
rc = cifs_get_inode_info_unix(&newinode, full_path, inode->i_sb,
412412
xid);
413413
else {
414+
/* TODO: Add support for calling POSIX query info here, but passing in fid */
414415
rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb,
415416
xid, fid);
416417
if (newinode) {

fs/cifs/file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
243243
if (rc)
244244
goto out;
245245

246+
/* TODO: Add support for calling posix query info but with passing in fid */
246247
if (tcon->unix_ext)
247248
rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb,
248249
xid);
@@ -800,7 +801,9 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
800801
if (!is_interrupt_error(rc))
801802
mapping_set_error(inode->i_mapping, rc);
802803

803-
if (tcon->unix_ext)
804+
if (tcon->posix_extensions)
805+
rc = smb311_posix_get_inode_info(&inode, full_path, inode->i_sb, xid);
806+
else if (tcon->unix_ext)
804807
rc = cifs_get_inode_info_unix(&inode, full_path,
805808
inode->i_sb, xid);
806809
else

fs/cifs/inode.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,10 @@ struct inode *cifs_root_iget(struct super_block *sb)
13331333
}
13341334

13351335
convert_delimiter(path, CIFS_DIR_SEP(cifs_sb));
1336-
rc = cifs_get_inode_info(&inode, path, NULL, sb, xid, NULL);
1336+
if (tcon->posix_extensions)
1337+
rc = smb311_posix_get_inode_info(&inode, path, sb, xid);
1338+
else
1339+
rc = cifs_get_inode_info(&inode, path, NULL, sb, xid, NULL);
13371340

13381341
iget_no_retry:
13391342
if (!inode) {
@@ -1689,7 +1692,9 @@ cifs_mkdir_qinfo(struct inode *parent, struct dentry *dentry, umode_t mode,
16891692
int rc = 0;
16901693
struct inode *inode = NULL;
16911694

1692-
if (tcon->unix_ext)
1695+
if (tcon->posix_extensions)
1696+
rc = smb311_posix_get_inode_info(&inode, full_path, parent->i_sb, xid);
1697+
else if (tcon->unix_ext)
16931698
rc = cifs_get_inode_info_unix(&inode, full_path, parent->i_sb,
16941699
xid);
16951700
else

fs/cifs/link.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,9 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
701701
cifs_sb_target->local_nls); */
702702

703703
if (rc == 0) {
704-
if (pTcon->unix_ext)
704+
if (pTcon->posix_extensions)
705+
rc = smb311_posix_get_inode_info(&newinode, full_path, inode->i_sb, xid);
706+
else if (pTcon->unix_ext)
705707
rc = cifs_get_inode_info_unix(&newinode, full_path,
706708
inode->i_sb, xid);
707709
else

0 commit comments

Comments
 (0)