Skip to content
  1. May 18, 2023
    • Bharath SM's avatar
      SMB3: drop reference to cfile before sending oplock break · 59a556ae
      Bharath SM authored
      
      
      In cifs_oplock_break function we drop reference to a cfile at
      the end of function, due to which close command goes on wire
      after lease break acknowledgment even if file is already closed
      by application but we had deferred the handle close.
      If other client with limited file shareaccess waiting on lease
      break ack proceeds operation on that file as soon as first client
      sends ack, then we may encounter status sharing violation error
      because of open handle.
      Solution is to put reference to cfile(send close on wire if last ref)
      and then send oplock acknowledgment to server.
      
      Fixes: 9e31678f ("SMB3: fix lease break timeout when multiple deferred close handles for the same file.")
      Cc: stable@kernel.org
      Signed-off-by: default avatarBharath SM <bharathsm@microsoft.com>
      Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      59a556ae
    • Bharath SM's avatar
      SMB3: Close all deferred handles of inode in case of handle lease break · 47592fa8
      Bharath SM authored
      
      
      Oplock break may occur for different file handle than the deferred
      handle. Check for inode deferred closes list, if it's not empty then
      close all the deferred handles of inode because we should not cache
      handles if we dont have handle lease.
      
      Eg: If openfilelist has one deferred file handle and another open file
      handle from app for a same file, then on a lease break we choose the
      first handle in openfile list. The first handle in list can be deferred
      handle or actual open file handle from app. In case if it is actual open
      handle then today, we don't close deferred handles if we lose handle lease
      on a file. Problem with this is, later if app decides to close the existing
      open handle then we still be caching deferred handles until deferred close
      timeout. Leaving open handle may result in sharing violation when windows
      client tries to open a file with limited file share access.
      
      So we should check for deferred list of inode and walk through the list of
      deferred files in inode and close all deferred files.
      
      Fixes: 9e31678f ("SMB3: fix lease break timeout when multiple deferred close handles for the same file.")
      Cc: stable@kernel.org
      Signed-off-by: default avatarBharath SM <bharathsm@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      47592fa8
  2. May 15, 2023
  3. May 14, 2023
  4. May 13, 2023
  5. May 12, 2023