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 39216C77B75 for ; Mon, 15 May 2023 16:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243197AbjEOQz3 (ORCPT ); Mon, 15 May 2023 12:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243211AbjEOQzF (ORCPT ); Mon, 15 May 2023 12:55:05 -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 77EF47689 for ; Mon, 15 May 2023 09:54:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DFF3A629C0 for ; Mon, 15 May 2023 16:54:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD955C433EF; Mon, 15 May 2023 16:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684169698; bh=luzfWvCP9ChL4ikDKKPwLmhuYHjnYTtz5efhI9d5aIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FvPP75i9EcxdkjyJ63TsS/51AuVc8kF10X8QYUfRkkjF3tTcBEDpynafuEF/8n3PO In34bev1igmk2rWtt/sGjhpZmWoR81ZCuvUi4TDhB04RbbnsR68frsjgLicDjNVImI y0nLpijflII0hRw1sh7ZwJPKtWObO3SMiVNHN0GE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Howells , Steve French Subject: [PATCH 6.3 141/246] cifs: release leases for deferred close handles when freezing Date: Mon, 15 May 2023 18:25:53 +0200 Message-Id: <20230515161726.794142154@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161722.610123835@linuxfoundation.org> References: <20230515161722.610123835@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Steve French commit d39fc592ef8ae9a89c5e85c8d9f760937a57d5ba upstream. We should not be caching closed files when freeze is invoked on an fs (so we can release resources more gracefully). Fixes xfstests generic/068 generic/390 generic/491 Reviewed-by: David Howells Cc: Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/cifsfs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -759,6 +759,20 @@ static void cifs_umount_begin(struct sup return; } +static int cifs_freeze(struct super_block *sb) +{ + struct cifs_sb_info *cifs_sb = CIFS_SB(sb); + struct cifs_tcon *tcon; + + if (cifs_sb == NULL) + return 0; + + tcon = cifs_sb_master_tcon(cifs_sb); + + cifs_close_all_deferred_files(tcon); + return 0; +} + #ifdef CONFIG_CIFS_STATS2 static int cifs_show_stats(struct seq_file *s, struct dentry *root) { @@ -797,6 +811,7 @@ static const struct super_operations cif as opens */ .show_options = cifs_show_options, .umount_begin = cifs_umount_begin, + .freeze_fs = cifs_freeze, #ifdef CONFIG_CIFS_STATS2 .show_stats = cifs_show_stats, #endif