From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BAF2C04E53 for ; Wed, 15 May 2019 11:02:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E4EE21881 for ; Wed, 15 May 2019 11:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918150; bh=OTPcD5rIptUhakShi0cZu09JIZv7Pw/PrX7p3jBGavk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rDWJkGYGAF4gZeVxQ79quwzWEmrdSApRBxhEaFNstr0E1PxVqHiT/H0Z3PAIc+kPL KFXfEGQ2+UX2LgEE950mwi3ofnWG7A5Mq3sB8ffZ5STh/rZo4iS7sf7I1umkqAxlHe Cbuv4C3aEqIqIAU5h2uEbzhRuVpZvoJZS9Z7tcoI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbfEOLC3 (ORCPT ); Wed, 15 May 2019 07:02:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:59720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727926AbfEOLC2 (ORCPT ); Wed, 15 May 2019 07:02:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C4BC2173C; Wed, 15 May 2019 11:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918147; bh=OTPcD5rIptUhakShi0cZu09JIZv7Pw/PrX7p3jBGavk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pKtyMW6gitX3FaOcOla/3/kxy6VsObb9MeM+5utxGkDCiZnrkRfwgVMl3NbuecP1Q 5Z3lJtjTBHOPKgGp/JaM68hkutJja4okcFGmesNZK6MlaZd3q+g5iv797/N9qddh8t alyWW+iK4mJ8QZHQ3MpYnFQlhv6sBYPfq6nwhHSQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Frank Sorenson , Steve French , Ronnie Sahlberg Subject: [PATCH 4.4 003/266] cifs: do not attempt cifs operation on smb2+ rename error Date: Wed, 15 May 2019 12:51:50 +0200 Message-Id: <20190515090722.802053821@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Frank Sorenson 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 Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg Signed-off-by: Greg Kroah-Hartman --- fs/cifs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1669,6 +1669,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;