From nobody Mon Feb 9 00:03:11 2026 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 C95ABE7D271 for ; Tue, 26 Sep 2023 09:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234289AbjIZJzx (ORCPT ); Tue, 26 Sep 2023 05:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233768AbjIZJzl (ORCPT ); Tue, 26 Sep 2023 05:55:41 -0400 X-Greylist: delayed 69 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 26 Sep 2023 02:55:33 PDT Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D00F3; Tue, 26 Sep 2023 02:55:32 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id AD98621BC; Tue, 26 Sep 2023 09:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1695721780; bh=zfpCmKTIrrX/Tm3omQLSw+qcCQMVXlnwzcY50MQ9HGI=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=r2zvMgty3J9zp812qs5vRyTGyhzL4ji93J7KqP6mRh+wYZyf81AwZM3JekNdNREfc IbCdHVL/ZUFIjro0fgcAi47CjY+xbxSoMH9BlQlueLTJlDy3YBD16zx3D3LCgOobbz Tk8hyV0LgKJTIvDAXJkonFNTdH4mxk3CdDJLjZrg= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 08C121D45; Tue, 26 Sep 2023 09:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1695722131; bh=zfpCmKTIrrX/Tm3omQLSw+qcCQMVXlnwzcY50MQ9HGI=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=sGwkdNutAIoorXYu/T6+JY8sssgHV7lXRSTMrVQjslvRO+0aOJMbH4UQ9yBUZMGFk wHz1Z0bt62kPwnvZEKtzPbbRV33DUTwOT6hvkkRrW2nL6joHqFkhlCAAmTLa4N7Iy+ REc7lvXd35mxwZBaXLtqaAr86MbWhI1S4UW6HUgg= Received: from [172.16.192.129] (192.168.211.137) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Tue, 26 Sep 2023 12:55:29 +0300 Message-ID: <18681891-e588-4745-8cfc-2fe5fc0eee54@paragon-software.com> Date: Tue, 26 Sep 2023 12:55:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/8] fs/ntfs3: Allow repeated call to ntfs3_put_sbi Content-Language: en-US From: Konstantin Komarovc To: CC: , References: <7c217d7d-6ee4-4603-b5f1-ebe7b68cf430@paragon-software.com> In-Reply-To: <7c217d7d-6ee4-4603-b5f1-ebe7b68cf430@paragon-software.com> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.137] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/bitmap.c |=C2=A0 1 + =C2=A0fs/ntfs3/super.c=C2=A0 | 21 ++++++++++++++++----- =C2=A02 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c index d66055e30aff..63f14a0232f6 100644 --- a/fs/ntfs3/bitmap.c +++ b/fs/ntfs3/bitmap.c @@ -125,6 +125,7 @@ void wnd_close(struct wnd_bitmap *wnd) =C2=A0=C2=A0=C2=A0 =C2=A0struct rb_node *node, *next; =C2=A0=C2=A0=C2=A0 =C2=A0kfree(wnd->free_bits); +=C2=A0=C2=A0 =C2=A0wnd->free_bits =3D NULL; =C2=A0=C2=A0=C2=A0 =C2=A0run_close(&wnd->run); =C2=A0=C2=A0=C2=A0 =C2=A0node =3D rb_first(&wnd->start_tree); diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index f78c67452b2a..71c80c578feb 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -576,20 +576,30 @@ static noinline void ntfs3_put_sbi(struct=20 ntfs_sb_info *sbi) =C2=A0=C2=A0=C2=A0 =C2=A0wnd_close(&sbi->mft.bitmap); =C2=A0=C2=A0=C2=A0 =C2=A0wnd_close(&sbi->used.bitmap); -=C2=A0=C2=A0 =C2=A0if (sbi->mft.ni) +=C2=A0=C2=A0 =C2=A0if (sbi->mft.ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0iput(&sbi->mft.ni->vfs_inode); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0sbi->mft.ni =3D NULL; +=C2=A0=C2=A0 =C2=A0} -=C2=A0=C2=A0 =C2=A0if (sbi->security.ni) +=C2=A0=C2=A0 =C2=A0if (sbi->security.ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0iput(&sbi->security.ni->vfs_in= ode); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0sbi->security.ni =3D NULL; +=C2=A0=C2=A0 =C2=A0} -=C2=A0=C2=A0 =C2=A0if (sbi->reparse.ni) +=C2=A0=C2=A0 =C2=A0if (sbi->reparse.ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0iput(&sbi->reparse.ni->vfs_ino= de); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0sbi->reparse.ni =3D NULL; +=C2=A0=C2=A0 =C2=A0} -=C2=A0=C2=A0 =C2=A0if (sbi->objid.ni) +=C2=A0=C2=A0 =C2=A0if (sbi->objid.ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0iput(&sbi->objid.ni->vfs_inode= ); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0sbi->objid.ni =3D NULL; +=C2=A0=C2=A0 =C2=A0} -=C2=A0=C2=A0 =C2=A0if (sbi->volume.ni) +=C2=A0=C2=A0 =C2=A0if (sbi->volume.ni) { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0iput(&sbi->volume.ni->vfs_inod= e); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0sbi->volume.ni =3D NULL; +=C2=A0=C2=A0 =C2=A0} =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_update_mftmirr(sbi, 0); @@ -1577,6 +1587,7 @@ static int ntfs_fill_super(struct super_block *sb,=20 struct fs_context *fc) =C2=A0=C2=A0=C2=A0 =C2=A0iput(inode); =C2=A0out: =C2=A0=C2=A0=C2=A0 =C2=A0kfree(boot2); +=C2=A0=C2=A0 =C2=A0ntfs3_put_sbi(sbi); =C2=A0=C2=A0=C2=A0 =C2=A0return err; =C2=A0} --=20 2.34.1