lkml.org 
[lkml]   [2019]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.0 10/89] cifs: do not attempt cifs operation on smb2+ rename error
    Date
    From: Frank Sorenson <sorenson@redhat.com>

    commit 652727bbe1b17993636346716ae5867627793647 upstream.

    A path-based rename returning EBUSY will incorrectly try opening
    the file with a cifs (NT Create AndX) operation on an smb2+ mount,
    which causes the server to force a session close.

    If the mount is smb2+, skip the fallback.

    Signed-off-by: Frank Sorenson <sorenson@redhat.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    CC: Stable <stable@vger.kernel.org>
    Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/cifs/inode.c | 4 ++++
    1 file changed, 4 insertions(+)

    --- a/fs/cifs/inode.c
    +++ b/fs/cifs/inode.c
    @@ -1735,6 +1735,10 @@ cifs_do_rename(const unsigned int xid, s
    if (rc == 0 || rc != -EBUSY)
    goto do_rename_exit;

    + /* Don't fall back to using SMB on SMB 2+ mount */
    + if (server->vals->protocol_id != 0)
    + goto do_rename_exit;
    +
    /* open-file renames don't work across directories */
    if (to_dentry->d_parent != from_dentry->d_parent)
    goto do_rename_exit;

    \
     
     \ /
      Last update: 2019-04-30 13:55    [W:6.479 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site