]> git.baikalelectronics.ru Git - kernel.git/commitdiff
smb311: add support for using info level for posix extensions query
authorSteve French <stfrench@microsoft.com>
Fri, 12 Jun 2020 03:43:01 +0000 (22:43 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 12 Jun 2020 13:54:12 +0000 (08:54 -0500)
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 <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
fs/cifs/dir.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/link.c

index aa61ffab8ab8a4c58bb4dd736a84b65a437c4112..398c1eef71906fc5d3137e58ed41167aa8961963 100644 (file)
@@ -411,6 +411,7 @@ cifs_create_get_file_info:
                rc = cifs_get_inode_info_unix(&newinode, full_path, inode->i_sb,
                                              xid);
        else {
+               /* TODO: Add support for calling POSIX query info here, but passing in fid */
                rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb,
                                         xid, fid);
                if (newinode) {
index 8277859d12a351b502c64d9e16704dc598afd881..4fe757cfc360141bd685f803d74021d7c781a4f6 100644 (file)
@@ -243,6 +243,7 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
        if (rc)
                goto out;
 
+       /* TODO: Add support for calling posix query info but with passing in fid */
        if (tcon->unix_ext)
                rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb,
                                              xid);
@@ -800,7 +801,9 @@ reopen_success:
                if (!is_interrupt_error(rc))
                        mapping_set_error(inode->i_mapping, rc);
 
-               if (tcon->unix_ext)
+               if (tcon->posix_extensions)
+                       rc = smb311_posix_get_inode_info(&inode, full_path, inode->i_sb, xid);
+               else if (tcon->unix_ext)
                        rc = cifs_get_inode_info_unix(&inode, full_path,
                                                      inode->i_sb, xid);
                else
index c367195bdb0837768ed5007d86825b1d30f8ca09..15ac63ff8ffcfb756a9991286a1262fb36481331 100644 (file)
@@ -1333,7 +1333,10 @@ struct inode *cifs_root_iget(struct super_block *sb)
        }
 
        convert_delimiter(path, CIFS_DIR_SEP(cifs_sb));
-       rc = cifs_get_inode_info(&inode, path, NULL, sb, xid, NULL);
+       if (tcon->posix_extensions)
+               rc = smb311_posix_get_inode_info(&inode, path, sb, xid);
+       else
+               rc = cifs_get_inode_info(&inode, path, NULL, sb, xid, NULL);
 
 iget_no_retry:
        if (!inode) {
@@ -1689,7 +1692,9 @@ cifs_mkdir_qinfo(struct inode *parent, struct dentry *dentry, umode_t mode,
        int rc = 0;
        struct inode *inode = NULL;
 
-       if (tcon->unix_ext)
+       if (tcon->posix_extensions)
+               rc = smb311_posix_get_inode_info(&inode, full_path, parent->i_sb, xid);
+       else if (tcon->unix_ext)
                rc = cifs_get_inode_info_unix(&inode, full_path, parent->i_sb,
                                              xid);
        else
index c381d2d03ef637994c6e037352dc90a4a4c0d67e..94dab4309fbb41ca6acd8e0ee66726e0d3227c81 100644 (file)
@@ -701,7 +701,9 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
                                        cifs_sb_target->local_nls); */
 
        if (rc == 0) {
-               if (pTcon->unix_ext)
+               if (pTcon->posix_extensions)
+                       rc = smb311_posix_get_inode_info(&newinode, full_path, inode->i_sb, xid);
+               else if (pTcon->unix_ext)
                        rc = cifs_get_inode_info_unix(&newinode, full_path,
                                                      inode->i_sb, xid);
                else