1. 01 Feb, 2024 3 commits
    • Shyam Prasad N's avatar
      cifs: failure to add channel on iface should bump up weight · 6aac002b
      Shyam Prasad N authored
      After the interface selection policy change to do a weighted
      round robin, each iface maintains a weight_fulfilled. When the
      weight_fulfilled reaches the total weight for the iface, we know
      that the weights can be reset and ifaces can be allocated from
      scratch again.
      
      During channel allocation failures on a particular channel,
      weight_fulfilled is not incremented. If a few interfaces are
      inactive, we could end up in a situation where the active
      interfaces are all allocated for the total_weight, and inactive
      ones are all that remain. This can cause a situation where
      no more channels can be allocated further.
      
      This change fixes it by increasing weight_fulfilled, even when
      channel allocation failure happens. This could mean that if
      there are temporary failures in channel allocation, the iface
      weights may not strictly be adhered to. But that's still okay.
      
      Fixes: a6d8fb54 ("cifs: distribute channels across interfaces based on speed")
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      6aac002b
    • Shyam Prasad N's avatar
      cifs: do not search for channel if server is terminating · 88675b22
      Shyam Prasad N authored
      In order to scale down the channels, the following sequence
      of operations happen:
      1. server struct is marked for terminate
      2. the channel is deallocated in the ses->chans array
      3. at a later point the cifsd thread actually terminates the server
      
      Between 2 and 3, there can be calls to find the channel for
      a server struct. When that happens, there can be an ugly warning
      that's logged. But this is expected.
      
      So this change does two things:
      1. in cifs_ses_get_chan_index, if server->terminate is set, return
      2. always make sure server->terminate is set with chan_lock held
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      88675b22
    • Shyam Prasad N's avatar
      cifs: avoid redundant calls to disable multichannel · e77e15fa
      Shyam Prasad N authored
      When the server reports query network interface info call
      as unsupported following a tree connect, it means that
      multichannel is unsupported, even if the server capabilities
      report otherwise.
      
      When this happens, cifs_chan_skip_or_disable is called to
      disable multichannel on the client. However, we only need
      to call this when multichannel is currently setup.
      
      Fixes: f591062b ("cifs: handle servers that still advertise multichannel after disabling")
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      e77e15fa
  2. 31 Jan, 2024 1 commit
    • Shyam Prasad N's avatar
      cifs: make sure that channel scaling is done only once · ee36a3b3
      Shyam Prasad N authored
      Following a successful cifs_tree_connect, we have the code
      to scale up/down the number of channels in the session.
      However, it is not protected by a lock today.
      
      As a result, this code can be executed by several processes
      that select the same channel. The core functions handle this
      well, as they pick chan_lock. However, we've seen cases where
      smb2_reconnect throws some warnings.
      
      To fix that, this change introduces a flags bitmap inside the
      cifs_ses structure. A new flag type is used to ensure that
      only one process enters this section at any time.
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ee36a3b3
  3. 29 Jan, 2024 1 commit
  4. 28 Jan, 2024 7 commits
  5. 27 Jan, 2024 9 commits
  6. 26 Jan, 2024 19 commits