From nobody Sat Jun 13 04:48:23 2026 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3Dremount-ro, continue read-only. The default on_errors=3Dcontinue 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 =3D 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 +=3D vol->mft_record_size; kmirr +=3D vol->mft_record_size; } while (++i < vol->mftmirr_size); --=20 2.43.0 From nobody Sat Jun 13 04:48:23 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 AE7093B47CD for ; Sun, 10 May 2026 17:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433087; cv=none; b=lI1ZVA4bAMef7ylgwPr54PItGe/MdCt5E8rbr6D3JStJp11W5jOimwySG6jkuCFF8E7rtOXDkhlJa0HKzv0RA/50Iijq+vORsDY5Tjp5PwlpI9N7e08YkdWjXd5bQPbwQqRVr5FPM9T2sCvb6s6Elyk/u2ih/Ia+T3pU7+R+xDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433087; c=relaxed/simple; bh=J0UVZS/j22fmCq/e+oGynnmq3o9/DGb8VlFN8JoeF0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PlgWadRjl54Cj0lVGHJqwJKTmlzEZR0oSQCtuXT6IqewYXWIhNj0MPsbS/x5qUyH9MAYYnTJNEweEp3giaPJoQrBNLyyr6RZLvGNTP3+kQWSTqvAILNwcOzNayeGR/Spbvoi2lFs3Bl/c3I5tiNfuB+gxJPOhRqfMFm7/ND2koQ= 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=ftYOohDA; arc=none smtp.client-ip=209.85.214.176 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="ftYOohDA" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2bc6e4556d8so3170915ad.1 for ; Sun, 10 May 2026 10:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778433086; x=1779037886; 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=PXD7XPslQy4RCgTc1Odfr77PlnVHB0PjTBKNtAuamEw=; b=ftYOohDAw/PZFAqCPCyetzrHRhI5wRzYacHFrjEolDcczVoYg5w0sPAL78qY5XSXiK 2qivVzZj+aKhQjc6Rd3612iaEq0duds+QQGOvSI94MrFDPRCkVRXvrEncBSK3wisTmQA +fmiM2/FBEMhS62fL0ynPO7+UFVxB+hx3DQXf7k8wETn8hsQYH63Wbz3QB9y1mUs+47i g43MX5eD2eMUkJYAPuOixCiOebioEq2w/tVx8dfH77VGgxpkkdLH2I6WjMfk+IgnZj+J T3f5XsEP3FYCxVPkPnmTc4g/X5+2hRUu98unmeWiWhNO4uQDIJyXa49YeWj3bLht7LMZ XCTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778433086; x=1779037886; 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=PXD7XPslQy4RCgTc1Odfr77PlnVHB0PjTBKNtAuamEw=; b=FGL8xvDZ6UW94fkXdBKJ0Y25qhORldStux1dd0vsLMcUZJ25FnfzRNmRataphXi5Px HT9P723Kd+bIySG0+gqa2IWSYQk36mQHCjfs4JyT+pAPIOfRxMGXvLG/y8SBaL8q1sz2 GtB+T784+DoY5kuC3xsEBmzS2EHYrNRq8vnkGF8n9RvcqsUaY+zeCUpTEWnNzHfEPftT IoRJLEG7/4i30p0g3Q/C5UnkcewOfinc7MEm+U8EnYSPtvD7IKvSy424L6nUkZ805Bgs YSeFPL0fbFJcWvC07x490CcP12lxQWxMHMnCBNk3+K/GPCSVw4rvV+cIIhevLLkhQ2DT Rl5g== X-Forwarded-Encrypted: i=1; AFNElJ9gFWgJFK33UZrlqOoSGKSSHERzWdmIkZgyEqqvAJVntrMyJRYebAron84UMG9x27MYLrcy564r0Ac7pzM=@vger.kernel.org X-Gm-Message-State: AOJu0YzJOm0bUsgxExjeylkUGtfNFaFY4oaFmvZmIBjKFJDRXtu5puxX MPd7Xmn/JpGGpKRnvKjfrV0dagVComOPMhAfhVMsF3do7zaXVJfklHAq X-Gm-Gg: Acq92OGNMzXlfaIuotAg2J3FhBEchIMU+bjbJvhTt1qysj0xttOVOZ1DeyunTKxnkTD aERusr1YxFbn9sd5uM5PqkDp9oy8+mN9hfFJ35PN5t+SlxyW/svNlATejBP9YIgJ/Xm8fUnza3U sGOeFrFoPDQvo9Ug2TIDmThhHqAcGGU7nd7/3mbRkIUWGE2CItuz7N6FI7XPTQTvmVThY4plWOS Cz13C/lNScXWztLYjOIgtGiRleNrBiMl3dcKfaheR2Kgfn3oL5r8Qjq0Y7ILHhD3dSh0oNL4tyT rNtR8OrJB/M/7fgcd55Djxv1FZLmxtlClPIBNknLImR8at99lSmo4z9VbzR5CRW+IfIgWhUfxyI ks/kjcs7+PO3jOqC5JlE9bZDkW2yPd+zIeaiaHyAcO2R5CXkb4PKDMmcA3yLxIUnKZMy8e4eAD9 H3feg44qArl2tZN3L8 X-Received: by 2002:a17:90b:5624:b0:368:1b68:5114 with SMTP id 98e67ed59e1d1-3681b685a6dmr1894215a91.8.1778433085916; Sun, 10 May 2026 10:11:25 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-367d623fa47sm5120690a91.3.2026.05.10.10.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2026 10:11:25 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon Cc: Hyunchul Lee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ntfs: do not mark the volume clean from sync_fs Date: Mon, 11 May 2026 02:11:15 +0900 Message-ID: <20260510171115.368494-3-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: quoted-printable Content-Type: text/plain; charset="utf-8" ntfs_sync_fs() can be called while the filesystem remains mounted read-write, for example by sync(2) or periodic writeback. Clearing VOLUME_IS_DIRTY from that path marks the volume clean before the mount lifetime has ended. If the system crashes after sync_fs() clears the bit but before unmount or remount-read-only, the volume can be left looking clean even though a clean shutdown did not happen. Keep the dirty bit set during sync_fs(); the unmount and remount-read-only paths already clear it when no NTFS errors were seen. Fixes: 6251f0b0de7d ("ntfs: update super block operations") Signed-off-by: DaeMyung Kang --- fs/ntfs/super.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index e8ecc52..024d363 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1895,7 +1895,6 @@ static void ntfs_shutdown(struct super_block *sb) static int ntfs_sync_fs(struct super_block *sb, int wait) { struct ntfs_volume *vol =3D NTFS_SB(sb); - int err =3D 0; =20 if (NVolShutdown(vol)) return -EIO; @@ -1903,15 +1902,10 @@ static int ntfs_sync_fs(struct super_block *sb, int= wait) if (!wait) return 0; =20 - /* If there are some dirty buffers in the bdev inode */ - if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY)) { - ntfs_warning(sb, "Failed to clear dirty bit in volume information flags.= Run chkdsk."); - err =3D -EIO; - } sync_inodes_sb(sb); sync_blockdev(sb->s_bdev); blkdev_issue_flush(sb->s_bdev); - return err; + return 0; } =20 /* --=20 2.43.0