From patchwork Fri Aug 19 16:48:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12949015 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 4578FC28B2B for ; Fri, 19 Aug 2022 17:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354592AbiHSRcP (ORCPT ); Fri, 19 Aug 2022 13:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354597AbiHSRcC (ORCPT ); Fri, 19 Aug 2022 13:32:02 -0400 Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C299159C29 for ; Fri, 19 Aug 2022 09:50:40 -0700 (PDT) Received: by mail-vs1-xe2c.google.com with SMTP id v128so5000779vsb.10 for ; Fri, 19 Aug 2022 09:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc; bh=1X2k0fk5hloTVsC4l1/RYGlXdOMhJKvIY9ZL2oQVQ0k=; b=gdwlwj8rXWkcJa62+0K6/wJYR6J4UuvT6qiu5+SHtkTTGyRxGSckEuuBkfXNptrxic 2UHMgo0+WwuHZrcwKMxhxjab5yBPNclZ81F7ZNKYLQeJJihS96pWOCFz8/DYuFe0fYnG GLn3AbEnsEKDN79+vG0i/m0+q7vLtRYT+nFRR8xVZIqlohaFsq9OmogqLGLL7w+L5EQl g6UlusFmOE/MkPQq4ofUZjRaHPd5W2yBpLwGZmSItmZwuynrO/RGJLXMw0/bL6RyAHre JV+Lp4nkJf4uNecghU4l2T8zx41nozd0vBb/DbGBlB8STylyetBMUTeBiFCzsYxDOnVn RK4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=1X2k0fk5hloTVsC4l1/RYGlXdOMhJKvIY9ZL2oQVQ0k=; b=ck0Z+iv8j7cOVWjHhM9uGBbs6/tHu2xBa+JrhIqUmUEaD7OjRvmZYIb3eXvnU+GB37 4X7u23j0o7WFARURmLYGWo9C8uyQcgtLOchXoTfjmtgBVh1etkWfcG7G97kFtINMgA/A Q+JXdt6vnVVDYrtDa0b+JqVlr3Cuh++aXLtGQkqsI9YksZccA48ROhXeKL4Wf4Zsmhmb ezweLrXwP7jyGGR5+Gc+1Ei5e82DesO0rxqgBTWe5Rm8MKBc/57lBwkDDPSaLu/eBNFG rlYIfBfCzd5cP+LHuyIYyxbr9UrYCsLhZwDdyQXwc3h53MHlhCY0kehO46csOTuWxCjP SdgQ== X-Gm-Message-State: ACgBeo1kLRtRWK4/WQqHXItmrCLPP7qK6wLNWaF1yRTuwQ+gCaL3OMFJ hrA/cV0OZ5FGHedeHfMYlQdqtDk98DY5fUA2ZjlifGDrACqRNg== X-Google-Smtp-Source: AA6agR7Idcw/vICURq8+wOiXzPG7scSXApSWW2+vn0TH2pITUHSm1gOVzewTSirfj7YFHxDAUt3HcmLmzGUA8MPo/3Q= X-Received: by 2002:a05:6102:1626:b0:390:2616:663e with SMTP id cu38-20020a056102162600b003902616663emr1159311vsb.6.1660927741751; Fri, 19 Aug 2022 09:49:01 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Fri, 19 Aug 2022 11:48:51 -0500 Message-ID: Subject: missing update to deferred_close_scheduled field To: CIFS Cc: rohiths msft , Shyam Prasad N Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org > we are missing a line like this: > > cfile->deferred_close_scheduled = false; > > in cifs_open here: > > /* Get the cached handle as SMB2 close is deferred */ > rc = cifs_get_readable_path(tcon, full_path, &cfile); > if (rc == 0) { > if (file->f_flags == cfile->f_flags) { > file->private_data = cfile; > spin_lock(&CIFS_I(inode)->deferred_lock); > cifs_del_deferred_close(cfile); > spin_unlock(&CIFS_I(inode)->deferred_lock); > goto use_cache; So move set of deferred_close_scheduled = false into cifs_del_deferred_close See attached From 90153ed5351576b3f1a4943593664d52c7f8d82c Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 19 Aug 2022 11:33:44 -0500 Subject: [PATCH] smb3: missing update to whether a close is deferred in a reopen path When deleting a file handle from the deferred close list we were missing update to cfile->deferred_close_scheduled Reviewed-by: Shyam Prasad N Signed-off-by: Steve French --- fs/cifs/file.c | 1 - fs/cifs/misc.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fa738adc031f..12bf0414dc84 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -930,7 +930,6 @@ void smb2_deferred_work_close(struct work_struct *work) spin_lock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); cifs_del_deferred_close(cfile); - cfile->deferred_close_scheduled = false; spin_unlock(&CIFS_I(d_inode(cfile->dentry))->deferred_lock); _cifsFileInfo_put(cfile, true, false); } diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 87f60f736731..3e99dd4085eb 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -718,6 +718,7 @@ cifs_del_deferred_close(struct cifsFileInfo *cfile) is_deferred = cifs_is_deferred_close(cfile, &dclose); if (!is_deferred) return; + deferred_close_scheduled = false; list_del(&dclose->dlist); kfree(dclose); } -- 2.34.1