From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 C65713822A1 for ; Sun, 10 May 2026 17:11:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433081; cv=none; b=lO2sx5d4j4TPrPyiRPdMLzhlhYvs7bh/TnIK5PMl9l4dVH1ElpcvbxwnXtdxabCXDTYM/wor6LFczgTBb8/XhJGxkJxK5Kygz3hPjYV6QlhRsmH9S7pDQvzE7V/CkQsSEvR84PeFNqAL4kwSO5nXM5SZs9+r5xQ3kuJ1kMH+uYo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778433081; c=relaxed/simple; bh=x9pvDzf+fY1FTfdaBgfdiihF5Jr+0DPrigW5GmWy+Ss=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=roXhzIFzbiNhN44SqNZa1ARSlit1/17Zs2nwSD2C4EoK7k5CMWaa/DfUyKMrn4odytpHPtsdugJHalyCdLbpEUyV1JFjRmtkKgWdWpicx/jgt5Yw17MCu5v8iWlkqlCmmLydiUrMsoGOzBjYf2heojt+glrTX/7Gp4EVUYHN78w= 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=jnEQhO33; arc=none smtp.client-ip=209.85.216.45 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="jnEQhO33" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-365f36d7b88so510202a91.0 for ; Sun, 10 May 2026 10:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778433080; x=1779037880; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zQvA8oYm5fgWSvqu1R06ttujcqV6rO1cZ19fO+2xVDo=; b=jnEQhO33yQFay/H6JXaPUTX8OsZCI/TGYR2CrXEDu8Ip82K8b9tGRkNy2xNL0dCuuk EsGBl8BH5mec9pg9G+v4mw/kon/85p6QpG9zbBwBnUd701D0DWWngE5Z12ABkdIR2ybj wdUjMsxStbLBK0JzZeucCQIvkQ3ISwx78ro73DyvwO1aTWjrb+zw434gb060H3CmPraV qc18E32BQrzLFDTh7M57BQAkQ5EloYU7w5LjLwwpXNiGPQ0JQTGlCMXtVQX+bQV+SiwJ PK72KzyR+A7goRtFCCNJHPf+4eKSdtziRR2DVzdfzdhWI8IU4oXC77d+7vXAgLcjzdpX onDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778433080; x=1779037880; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zQvA8oYm5fgWSvqu1R06ttujcqV6rO1cZ19fO+2xVDo=; b=dxk2wsceTcaqbifuzltH/PPR9myUSCt78QrZDLDoveh+2XUbY83fPHQgbPdXoBfr6u h7JpU7wfFwLrdhSzc0INkf0kFd1NGyqXGa/SEqZ+uc7Iojy12taNZo+gW1rCeWYKmQCC zY1niQXJ7OIIxRawpaNEaqPXQlYMYzIhYpBGawdsLbqm1h/4EYJUABOroBXN7SxswlG5 J782k6F+s7G+161rEBjx15pkccv/Q1o/rzWlgU8vN0LgbSgspAaNszu6X/hyvDjNWUL0 LlnYOrY77wB/4PkLHUBRPgYs4P3LuPpUvRa9KprbRr6WPaMyaT6ZBzmLsU2NYHXnGBkc Ed0w== X-Forwarded-Encrypted: i=1; AFNElJ+oWiai/E3tMa4ytEGLxTkjdjpUqQHcgtNOY3V1tKg2BJT3Cv6ijxIgUOfNDqQ+MGFECEPGqjU+AhOmb/8=@vger.kernel.org X-Gm-Message-State: AOJu0YxJvIXtz43afqhRfGs68M92ZUo3Af5PkPfQou0Me+OxsRqO5AU1 nqV+YWTYR2rMGXa6i0m4mDepv52luJ2Tnd62neixMUs3GEiCEi7rzb40 X-Gm-Gg: Acq92OGp7QMpZpJi63f11VvVj7/Ybt7pqeOEOILXLqKEDa2e7l2R6ZdTRMv9wsMXPsO kUc+gzlwlraqFyv7pa8GgoMAwEzEvTFJDgJMP861QE6p73ogC0t5jaH0/eGq3t7kme94K4etTFq bVS4nXxEkIUfinahWUB1JvFIvxUMrNElpb+5FjiLMe1asgeJWmklsR6Tqt+AewrPubLqosgKkUU xi78SSoyKeSN52wr/EBfA73VudyKSeB+y+GiBfekmCX14ausfMgqdeZhNWy/rDjk7BHHJMyn0oG qb3X1sbMEsIeegzbhVua4PaQhftgM+OeQZFtwyxRk1cGo8WnKnFEUFvPzfvSQxAO/mhSuk+wmVg 7/yOTlZcmRxXK5E2K7aNmc7pFTGmcFbQ6jKKgnc/Me9Vl5AtQuiHGiDUF6JPGgrSg6u8K2n7BnN CWhPfdYDZFNgXhG4lo04RBsilgJW6MO7ZXPwZWSQ== X-Received: by 2002:a17:90a:d004:b0:35f:b8e6:6398 with SMTP id 98e67ed59e1d1-365b4f5bda0mr11628329a91.7.1778433080188; Sun, 10 May 2026 10:11:20 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-367d623fa47sm5120690a91.3.2026.05.10.10.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2026 10:11:19 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon Cc: Hyunchul Lee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] ntfs: super.c fixes for MFT mirror check and sync_fs Date: Mon, 11 May 2026 02:11:13 +0900 Message-ID: <20260510171115.368494-1-charsyam@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes two regressions in fs/ntfs/super.c introduced by: 6251f0b0de7d ("ntfs: update super block operations") which switched the driver to the fs_context-based mount API and added ->sync_fs. Patch 1 restores the missing memcmp() inside check_mft_mirror(). The function still walks both $MFT and $MFTMirr records and computes a per-record byte count to compare, but the actual comparison was dropped when super block operations were updated. As a result, mount silently accepts a stale or inconsistent $MFTMirr as long as both records pass the structural baad-record checks, defeating the purpose of having the mirror. With the comparison restored, a mismatch is reported at mount time and the existing on_errors policy decides whether to convert to read-only or proceed with NVolErrors set. Patch 2 stops ntfs_sync_fs() from clearing VOLUME_IS_DIRTY. sync_fs can be called while the filesystem is still mounted read-write (for example via sync(2) or periodic writeback), so clearing the dirty bit there marks the volume clean before the mount lifetime has ended. If the system crashes after sync_fs() but before unmount or remount-ro, the on-disk image is left looking cleanly shut down even though it is not. The legitimate clear paths in ntfs_put_super() and the RW->RO remount path are kept intact and gate on !NVolErrors(). Both patches apply on top of ntfs-next. DaeMyung Kang (2): ntfs: restore $MFT mirror contents check ntfs: do not mark the volume clean from sync_fs fs/ntfs/super.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.43.0