From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 987E23B38B0 for ; Sun, 10 May 2026 17:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433084; cv=none; b=hzsGhfCW1Jf0wA7hCD5AeLVZqvinbGrMtGj4W81cNiuoJ+1kXim8MZj55P5NjpIvUmfA7ncC+A6qW0H3n2733j4ry3444TIR6R4XfaLm2I7ypHgYlP+h3nQ+LXE3gUfuFNrG1EDw4KRHaQaTSXoDYCNFbupTOwjWDqj0tdk4FV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433084; c=relaxed/simple; bh=NoNwR+koRa0QOEZpb03BvwCVGNJoaWPLcHTsujeA43Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WwlJK0Q7PrRTBtp40XaqcVC9AkpRMol03xHyc8tnukCTXTQSBRl3co9t0jWNGhj7HBShGNfuUgNVULksVtbYOTS7JevGXt1aoIif2Ueu/dgmxNgBARC+1z5nvCII9eYbY2JCPYdOHNGna1IQIPWYmdwl6CpaVQjiDmD72/uZm5g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c5FV895b; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c5FV895b" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-367bb5e6a30so369038a91.1 for ; Sun, 10 May 2026 10:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778433083; x=1779037883; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=foA8I8Alm8eV4RIgBRmswEntkfZ9lWSL6CHV+T31Sok=; b=c5FV895b+CGkqIwveb7hYZUQ28kyUNQPITSr1F4TQwMznpaOeDry6Unx74RRGtMejD qiFbBYNqVU/YrzzSxe4eDjDESwpxcfP38f55BcAaFAYJLx4pAo3RfOM6DU+ekIOnR0e5 1p4icFqrK03bACKdfWWgcQ+8aburny6Z2ZL7Iu8RN4/L/klo4MreNkdURY73EIHJUWHW fvwA5N95/dQeYktrvY4IHUa+OOWCf09Mn3n68iXuqNSrwEG0xQSQtbthhCK2LiK4HIJM aQ8sfvGX4E2Om5c1vszaIuElmTbaw7kF3Rk01FEUFk1KZjqxEGNJRopPTwM6Y0mwlZUX 7fSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778433083; x=1779037883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=foA8I8Alm8eV4RIgBRmswEntkfZ9lWSL6CHV+T31Sok=; b=SbAnJSHPInIYVxFcDbMIbIJuC1eK0Q+xGP1+WW/8l0WMrrFHzku251n10AvvX0OylU o2ymbqVqcwM4r4evaBkHlQzFptKwrAFblwRqNKTof84HeWGVi+cG4MTsEBHafYfokRtI EDZ8b6enIMBVRHgDx/cdnoN6hye2EkvYYVGldaE1/Og64mO23MbxAl/G+c+1dQMo8zH8 c+BI8DFK836JN1YoPRL/6pzuULBh5MCUM0SjF2iyfdNKxnd0FuuRRqT1NF+MWJF2B1Aa woRcTt1rILbNkrwEwYZI+tZla15EY/sH9FSDQ3MnDa2ehqmaeoXxT1XIFAv8CE9NskXo o0mw== X-Forwarded-Encrypted: i=1; AFNElJ/rnjQWqtTfgp9jdyBr28BMQmJNMet0Jw9RSilbF/0Rxoyr0+P4BytkTbV6ovjjVdIg8KR3uINw+l3XrvY=@vger.kernel.org X-Gm-Message-State: AOJu0YyMHIeELCjWXOR5BvOEgdPTSQUpS6+9u1eN8nlgsbXf23aS/Ced B0LHyOYZaLcLMyWp42y1xuPtJ3U4c406WDJK7nPu49huvcaXEwi2+iga X-Gm-Gg: Acq92OEprk1aI8GC/salj/pIsepIzzgk9S++r5vf+iCitoTanfEJqDsM2XlLJrGROia HdqQz02jDvErdZBY/c3wgax00Gr/4rutFJCJH6t/crRTn0zhTd3J3vf0DdaXgBPRRrs5ejtjyv8 AU9y4z4bhw1nthJe5HLkT2fGWa8M8je9/FX/nvmFFIrf8OOlf3DrOx/tGgk0xL4g+x+wqr0IzPy rvqrjMAIdQNEfSgKz27gPJ+qMlmzkEvjE9RuDYG84fenoHgw8Eo0qcAsGQb+XIPSFp7PdelcM7b 5sL2lT7Wt1gxTdzlGAgJa9j7krwbrkw3GfpmA41hsgkMVfa4Gzigq5f0ViL9077kDDsTklKRqch LY47uuQaFl/14lnSWYsz7F22d5MRlH4ziakCkRdWqwxhQhyrZEwx1YqeWZ5eCa6ch8uvjAkAt83 yj3RoxsjkCTdMFLJ77sKBhJxSF5lV4Gk1xohBFtA== X-Received: by 2002:a17:90b:2705:b0:362:bc8a:9c1a with SMTP id 98e67ed59e1d1-365adbedec1mr11467306a91.8.1778433082991; Sun, 10 May 2026 10:11:22 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-367d623fa47sm5120690a91.3.2026.05.10.10.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2026 10:11:22 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon Cc: Hyunchul Lee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ntfs: restore $MFT mirror contents check Date: Mon, 11 May 2026 02:11:14 +0900 Message-ID: <20260510171115.368494-2-charsyam@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260510171115.368494-1-charsyam@gmail.com> References: <20260510171115.368494-1-charsyam@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit check_mft_mirror() still computes the number of bytes to validate in each mirrored MFT record, but the actual comparison against $MFTMirr was dropped when the superblock code was updated. As a result, mount misses a stale or inconsistent $MFTMirr as long as both records pass the structural baad-record checks. Restore the comparison and log an error when the primary $MFT record differs from its mirror copy. Returning false lets the existing mount error handling mark the volume as having NTFS errors and, with on_errors=remount-ro, continue read-only. The default on_errors=continue mount policy still allows the mount to proceed. Fixes: 6251f0b0de7d ("ntfs: update super block operations") Signed-off-by: DaeMyung Kang --- fs/ntfs/super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 22dc786..e8ecc52 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -979,6 +979,13 @@ mft_unmap_out: ntfs_is_baad_recordp((__le32 *)kmirr)) bytes = vol->mft_record_size; } + /* Compare the two records. */ + if (memcmp(kmft, kmirr, bytes)) { + ntfs_error(sb, + "$MFT and $MFTMirr record %i do not match. Run chkdsk.", + i); + goto mm_unmap_out; + } kmft += vol->mft_record_size; kmirr += vol->mft_record_size; } while (++i < vol->mftmirr_size); -- 2.43.0