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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA982C04FE1 for ; Fri, 21 Jul 2023 14:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjGUOZX (ORCPT ); Fri, 21 Jul 2023 10:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231279AbjGUOZU (ORCPT ); Fri, 21 Jul 2023 10:25:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CA3E6F for ; Fri, 21 Jul 2023 07:25:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A721761CD5 for ; Fri, 21 Jul 2023 14:25:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5C64C433C8; Fri, 21 Jul 2023 14:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689949512; bh=5v74pVkNimRWO8D2VazaqG7pazcrN4V/qZ7x1n3QpGk=; h=Subject:To:Cc:From:Date:From; b=LtMfTXMnjQOC8I0nJFy52yPkOI6YZ0vfI+1fTdMXHrkTS2KIwnbhRyJDAxgYA64ip kke/TMKEB4dfh9vzmOUcJA2TG7W6oiWn9pK6HWiBK9khyKZPPOdHOZz4ELD2HAPRyW kMie/ZTcZXzrAeyByTApUBPnyEerF9ExoMGzaq/Q= Subject: FAILED: patch "[PATCH] cifs: if deferred close is disabled then close files" failed to apply to 5.10-stable tree To: bharathsm@microsoft.com, sprasad@microsoft.com, stfrench@microsoft.com Cc: From: Date: Fri, 21 Jul 2023 16:25:06 +0200 Message-ID: <2023072106-yoga-rage-f811@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x df9d70c18616760c6504b97fec66b6379c172dbb # git commit -s git send-email --to '' --in-reply-to '2023072106-yoga-rage-f811@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: df9d70c18616 ("cifs: if deferred close is disabled then close files immediately") 38c8a9a52082 ("smb: move client and server files to common directory fs/smb") abdb1742a312 ("cifs: get rid of mount options string parsing") 9fd29a5bae6e ("cifs: use fs_context for automounts") 5dd8ce24667a ("cifs: missing directory in MAINTAINERS file") 332019e23a51 ("Merge tag '5.20-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From df9d70c18616760c6504b97fec66b6379c172dbb Mon Sep 17 00:00:00 2001 From: Bharath SM Date: Fri, 7 Jul 2023 15:29:01 +0000 Subject: [PATCH] cifs: if deferred close is disabled then close files immediately If defer close timeout value is set to 0, then there is no need to include files in the deferred close list and utilize the delayed worker for closing. Instead, we can close them immediately. Signed-off-by: Bharath SM Reviewed-by: Shyam Prasad N Cc: stable@vger.kernel.org Signed-off-by: Steve French diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 879bc8e6555c..fc5acc95cd13 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -1080,8 +1080,8 @@ int cifs_close(struct inode *inode, struct file *file) cfile = file->private_data; file->private_data = NULL; dclose = kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL); - if ((cinode->oplock == CIFS_CACHE_RHW_FLG) && - cinode->lease_granted && + if ((cifs_sb->ctx->closetimeo && cinode->oplock == CIFS_CACHE_RHW_FLG) + && cinode->lease_granted && !test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) && dclose) { if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) {