From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795033892; b=yvNdFmugbQ8ZX9GdG5C7Iapgz0cPSuFRUllisZCkP+xkAMVNfVOMkq6gaecmB3bR2Zv5 aFuXoUycF/JUsExeOBB0eHSWG8FpMOhaDqffc96Su74Ib4dI6xuJ5+T5fBnsrGQfU7JGy EL8DgG+BSzt5lXhGATxJp1ip6U7Eqew3sFkKtYw3O6dA/UmoGLYuIZEwJGylfBCX5Tri6 2tliz7D4JZ93VMrfSqwc/N61oTsBNjMTQRTSWfQnUyGJJtmxHfS7nQ6e09u15V606XUxJ kIxbbb/F9QvCct4YhvlZK7Waa2/XiCge4TSnpJOu7TiaMg68TEnS/S8CiPVET6l6K0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795033892; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=kyDc0DVT35PCH8C6cmLkM9iqXxtOmxilvEcUmEnEHik=; b=yLFjHDGwzZzVdQTKmP0x/XS3iYcT8iZhNEbfZQd9wHvynnkcZ8svKy3mWTu64CdXjLRU uTPGIFAw6Drso9GFzItRDx6FPo6as0CKeUzypN0otuOLjb1PyhTO+gqhQTqo42OH/kRkk XDxjk06l89rRkhIZvhkEsRpDhJOzfcv8bDa+dfG9dRfh51X/xtpP+rLwpzTIRQ+Tw4rRa JGzCEBzShV0duzhiavWr9MjQuyNljR5UqX/SxgXkoe4++DEHuOJvIZJgBT04pnz9YO3h3 cLynv7lhVemVYGsYMYYwSWAa29Oubz85/Ed1waEcfgtHLgIxsCGjMbpIZz28hqLH63A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tQChoTXt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2AD2606A31C; Wed, 18 Nov 2026 20:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tQChoTXt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22B0F1F000C4; Wed, 18 Nov 2026 20:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795033892; bh=kyDc0DVT35PCH8C6cmLkM9iqXxtOmxilvEcUmEnEHik=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tQChoTXt80LjDvhxvWAIYc1Kn3DdpI+hDXfNF/8Tl0KrqMmX0jpv+Zh2nroxTqkho ymHiL4E5RC10cVNWjkJLNzxa8CvM1C8XkzkQ6FpysLgaLcH4FK7NNyPwdsSZqYOq7Z a63PQ6IozaXXSLvdb4dUKpV3vHDb8IVCm5LYwef4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Senjin , Konstantin Komarov , Sasha Levin Subject: [PATCH 6.6 0177/3318] fs/ntfs3: load ATTR_BITMAP run extents from $MFT extension records Date: Wed, 18 Nov 2026 15:13:19 +0100 Message-ID: <20261118150320.009200573@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Konstantin Komarov [ Upstream commit e31886cb6e0e14cf65e27da0bf1a422ff419d893 ] When $MFT's ATTR_BITMAP attribute is heavily fragmented, its run list can span multiple MFT extension records (attribute list entries with vcn > 0). The non-primary segment handler in ntfs_read_mft() only processed ATTR_DATA extension segments for MFT_REC_MFT, silently skipping any ATTR_BITMAP segments. This left sbi->mft.bitmap.run incomplete, causing wnd_init() to fail with -ENOENT when wnd_rescan() tried to look up a VCN not covered by the truncated run list. Observed on a 16 TB NTFS volume (0xFFFFFEFF total clusters) whose MFT bitmap run list was split across 97 extents in extension records. wnd_rescan() successfully looked up VCNs 0-122 from the runs loaded from the base record, then failed at VCN 123 (the last cluster of the bitmap) whose run was only present in an extension record. Fix by extending the MFT_REC_MFT special case to also handle ATTR_BITMAP extension segments, storing their runs into sbi->mft.bitmap.run the same way the primary segment does. Signed-off-by: Senjin Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/inode.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index fff604cd95279..b13a11f6a6341 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -126,10 +126,16 @@ static struct inode *ntfs_read_mft(struct inode *inode, if (le && le->vcn) { /* This is non primary attribute segment. Ignore if not MFT. */ - if (ino != MFT_REC_MFT || attr->type != ATTR_DATA) + if (ino != MFT_REC_MFT) + goto next_attr; + + if (attr->type == ATTR_DATA) + run = &ni->file.run; + else if (attr->type == ATTR_BITMAP) + run = &sbi->mft.bitmap.run; + else goto next_attr; - run = &ni->file.run; asize = le32_to_cpu(attr->size); goto attr_unpack_run; } -- 2.53.0