From nobody Mon Feb 9 04:14:10 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 21553C0015E for ; Mon, 3 Jul 2023 07:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjGCHcn (ORCPT ); Mon, 3 Jul 2023 03:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjGCHcl (ORCPT ); Mon, 3 Jul 2023 03:32:41 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7603CC; Mon, 3 Jul 2023 00:32:40 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 6740A1D34; Mon, 3 Jul 2023 07:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1688368769; bh=Rx//LO9/7IMTU2TX9c0DIpKI/VjGm4z0Maj34lCnuA8=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=mu+4Zi+tLFsNMkcxYwGJASldvxkMTPZFVITANt9PQgmJTIhNILUfanN8HReP5EGc5 xOzSWVLVzvh1CrbVPqqkTlw4n773/xN7s9TfM/EgnivaCCaitQa9SfuU+V/0/3DBz2 dDW1mRxHVXGxntNaJNTgR3OOLHnLFHs2erVFyFrA= 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 D2AF71D1E; Mon, 3 Jul 2023 07:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1688369080; bh=Rx//LO9/7IMTU2TX9c0DIpKI/VjGm4z0Maj34lCnuA8=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=mbEfFe+uruU4DDxz9aMUbl86vfw5tJv1u7XTjIXN0qGP4zWp5U6A3fp4GDW60Dn7J UGp9F/YD7nbSA6VuaVUG+ZYaiHAKVGP8dP0FW4Br07t8eQbXVIYmXOg5fktOTnf6Yf iHxMePOqIco19Sq1QD1Fk18NmNFsNhLx4EcS2G0k= Received: from [192.168.211.138] (192.168.211.138) 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; Mon, 3 Jul 2023 10:24:40 +0300 Message-ID: <379d007b-63d1-ab12-57aa-0ceee3d539a0@paragon-software.com> Date: Mon, 3 Jul 2023 11:24:39 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: [PATCH 1/8] fs/ntfs3: Add ckeck in ni_update_parent() Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.211.138] 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 Check simple case when parent inode equals current inode. Signed-off-by: Konstantin Komarov --- =C2=A0fs/ntfs3/frecord.c | 6 ++++++ =C2=A01 file changed, 6 insertions(+) diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 16bd9faa2d28..8f34d6472ddb 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3208,6 +3208,12 @@ static bool ni_update_parent(struct ntfs_inode=20 *ni, struct NTFS_DUP_INFO *dup, =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0if (!fname || !memcmp(&fname->= dup, dup, sizeof(fname->dup))) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0continue; +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0/* Check simple case when parent ino= de equals current inode. */ +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0if (ino_get(&fname->home) =3D=3D ni-= >vfs_inode.i_ino) { +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0ntfs_set_state(sb= i, NTFS_DIRTY_ERROR); +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0continue; +=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0} + =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0/* ntfs_iget5 may sleep. */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0dir =3D ntfs_iget5(sb, &fname-= >home, NULL); =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0if (IS_ERR(dir)) { --=20 2.34.1