• 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
smb1ops.c 35.6 KB