]> Git Repo - J-linux.git/commitdiff
Merge tag '5.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
authorLinus Torvalds <[email protected]>
Sun, 12 Jun 2022 18:05:44 +0000 (11:05 -0700)
committerLinus Torvalds <[email protected]>
Sun, 12 Jun 2022 18:05:44 +0000 (11:05 -0700)
Pull cifs client fixes from Steve French:
 "Three reconnect fixes, all for stable as well.

  One of these three reconnect fixes does address a problem with
  multichannel reconnect, but this does not include the additional
  fix (still being tested) for dynamically detecting multichannel
  adapter changes which will improve those reconnect scenarios even
  more"

* tag '5.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: populate empty hostnames for extra channels
  cifs: return errors during session setup during reconnects
  cifs: fix reconnect on smb3 mount types

1  2 
fs/cifs/cifsfs.c
fs/cifs/misc.c

diff --combined fs/cifs/cifsfs.c
index c85d9a37832515762a946c37c109da8fd06f6fcd,325423180fd2b554095c88ab06b601065078e1d7..8f2e003e059075fe2c715728e5477d9d2d712028
@@@ -377,7 -377,7 +377,7 @@@ cifs_alloc_inode(struct super_block *sb
        cifs_inode->flags = 0;
        spin_lock_init(&cifs_inode->writers_lock);
        cifs_inode->writers = 0;
 -      cifs_inode->vfs_inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
 +      cifs_inode->netfs.inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
        cifs_inode->server_eof = 0;
        cifs_inode->uniqueid = 0;
        cifs_inode->createtime = 0;
         * Can not set i_flags here - they get immediately overwritten to zero
         * by the VFS.
         */
 -      /* cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; */
 +      /* cifs_inode->netfs.inode.i_flags = S_NOATIME | S_NOCMTIME; */
        INIT_LIST_HEAD(&cifs_inode->openFileList);
        INIT_LIST_HEAD(&cifs_inode->llist);
        INIT_LIST_HEAD(&cifs_inode->deferred_closes);
        spin_lock_init(&cifs_inode->deferred_lock);
 -      return &cifs_inode->vfs_inode;
 +      return &cifs_inode->netfs.inode;
  }
  
  static void
@@@ -1086,7 -1086,7 +1086,7 @@@ struct file_system_type cifs_fs_type = 
  };
  MODULE_ALIAS_FS("cifs");
  
- static struct file_system_type smb3_fs_type = {
+ struct file_system_type smb3_fs_type = {
        .owner = THIS_MODULE,
        .name = "smb3",
        .init_fs_context = smb3_init_fs_context,
@@@ -1418,7 -1418,7 +1418,7 @@@ cifs_init_once(void *inode
  {
        struct cifsInodeInfo *cifsi = inode;
  
 -      inode_init_once(&cifsi->vfs_inode);
 +      inode_init_once(&cifsi->netfs.inode);
        init_rwsem(&cifsi->lock_sem);
  }
  
diff --combined fs/cifs/misc.c
index cbc3b433f5023b08dcbf3050fbc4a3bf5d319ad4,8e67a2d406abd3da71a52d000ee4dbaab5f4580e..c69e1240d730b300044ff3213b99b18f7be276b7
@@@ -537,11 -537,11 +537,11 @@@ void cifs_set_oplock_level(struct cifsI
        if (oplock == OPLOCK_EXCLUSIVE) {
                cinode->oplock = CIFS_CACHE_WRITE_FLG | CIFS_CACHE_READ_FLG;
                cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
 -                       &cinode->vfs_inode);
 +                       &cinode->netfs.inode);
        } else if (oplock == OPLOCK_READ) {
                cinode->oplock = CIFS_CACHE_READ_FLG;
                cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
 -                       &cinode->vfs_inode);
 +                       &cinode->netfs.inode);
        } else
                cinode->oplock = 0;
  }
@@@ -1211,18 -1211,23 +1211,23 @@@ static struct super_block *__cifs_get_s
                .data = data,
                .sb = NULL,
        };
+       struct file_system_type **fs_type = (struct file_system_type *[]) {
+               &cifs_fs_type, &smb3_fs_type, NULL,
+       };
  
-       iterate_supers_type(&cifs_fs_type, f, &sd);
-       if (!sd.sb)
-               return ERR_PTR(-EINVAL);
-       /*
-        * Grab an active reference in order to prevent automounts (DFS links)
-        * of expiring and then freeing up our cifs superblock pointer while
-        * we're doing failover.
-        */
-       cifs_sb_active(sd.sb);
-       return sd.sb;
+       for (; *fs_type; fs_type++) {
+               iterate_supers_type(*fs_type, f, &sd);
+               if (sd.sb) {
+                       /*
+                        * Grab an active reference in order to prevent automounts (DFS links)
+                        * of expiring and then freeing up our cifs superblock pointer while
+                        * we're doing failover.
+                        */
+                       cifs_sb_active(sd.sb);
+                       return sd.sb;
+               }
+       }
+       return ERR_PTR(-EINVAL);
  }
  
  static void __cifs_put_super(struct super_block *sb)
This page took 0.067232 seconds and 4 git commands to generate.