From nobody Mon Sep 28 09:58:01 2026 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.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 0F95F3793CB for ; Mon, 24 Aug 2026 05:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787548127; cv=none; b=aYWhHeY1Nh3uGIvr2G+u06n2MtwU3GMNg6T13sTmUcq/4zVwlNeZmG02CF5ZcZkn7OduAZbDpG4Ki/aacjZueA/qO/R2hvoUX3Gvownz8Zg5XK1bBWG4VsJmYGLULzx54OpciSsLZKsxjhD7d7zu+YDBIu8/3424cx/ioud3VMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787548127; c=relaxed/simple; bh=5ddXkY1p1Huql97Y09zRJYg3yqWcJ63/XKnMViTbDKg=; h=Message-ID:Date:From:To:Cc:Subject:MIME-Version:Content-Type: Content-Disposition; b=r4Ebso6P2mVIUmXWJVK/gQ5f78RJ7Bznm6m9mjpYhr24oZhns1W8LaPIByDPxnR7ICdUvmUig7uH/+frBeI3aOpsbFdU/uXUqiz4WTxoBHJWX9hQ8DOcVcdLx2OUd8k/LCNTg/5AnRmSKbqneetEM814318ChtvNTgIPLkcYA0o= 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=Y9bcUdzF; arc=none smtp.client-ip=209.85.210.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="Y9bcUdzF" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-8486672f03cso3057435b3a.0 for ; Sun, 23 Aug 2026 22:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787548125; x=1788152925; darn=vger.kernel.org; h=content-disposition:content-type:mime-version:subject:cc:to:from :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LrFzfkuWgCIrnYEkQM7tNXClDbOIOCxxgl2oHl1c0Go=; b=Y9bcUdzF9gXrOkKowLqtqKVwsXLxpckGsx8bXGZU3VAwu5XDiL4LWpjW/RhQhnXQ64 dJarUjLDMVEUozCnVB5O8ad6t8NipEAdxnRHzKkeDR3oiOeB/yOCBIYsc/EbKSLepAbO sIcflpN3E/Cxj6aMwK56fuW5/DDJAHgcNTFV5ayZDeBA+UT8EzVmaioDXlFjfCUBg9vP s1gLh04MOj3FQWzm8FJLaxUEf9hVv/5khEWRmvtt09Ks9xJn/xVtykecPa8z4EGDF8h0 wFth6j4z4gTeJizlMms1ccnM7CiAarI2Att08pbounKPgEtKpNxgiv+5E+uyppa0jNw+ aIZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787548125; x=1788152925; h=content-disposition:content-type:mime-version:subject:cc:to:from :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LrFzfkuWgCIrnYEkQM7tNXClDbOIOCxxgl2oHl1c0Go=; b=dtyO3tr5FhNAywwoLdUFuWwFGY1qfFVMGX+0FJb2zAVo4BHsO6SNQTBl5PDUA0rtK9 2M7lkr2peFDjNNEW+MHqg/YxO/7O11hoidA0B7jKOWOVVqZcgd5XTLJlA5AvwZiICP6q RZLysWY96qJoYxGPeL4x7yV+lHMWNazoO/gS40dGc9ugKqDy0Aq96emG4ScbNcOAgIk4 PEVVgKyeVzxrSPBt53DaRRfrl1vXfBQ9KWOlvFnOgKsHIcpcBCLQLlWeTKUF3K9CyMfX DXlvQXBNVnFMosoHk3zWYiJDOPliimy2KE6wv3z39qcyuO0t1tQ6/upycL/qDphBaq7I gDKw== X-Forwarded-Encrypted: i=1; AHgh+RrxmJ7WNcg/nBcPImeLHmjz8CMrXz+5vT6s7t4cMtZgJB5tmQhyLR6D+4unQSPak3yx43YW9YUnYsYlSLI=@vger.kernel.org X-Gm-Message-State: AFuF++l+9CK002tzaa2MEO+bHMJUEoUYZz+n++gFkhrz6jDMMK8U60af tuLuuHk1yzCbJIblHMv1fXClFpXf+qaFxO+dr5T9SUTT5hiTiQzK0x/O X-Gm-Gg: AR+sD10xW7frbNXvygcEYH4zeyVb5s+T96Omv19YtATxwWKfsWc7xyGFttnbQ9KdA/r t/Xc3O/QQilAtIw0XHlhZyA7eGHT5HemfY8JSq3yHnof7ZE4mckoNRd2dD+8ViHMTX594iYcs2o A5+BQPtpfGGziNMz6Xj6+6aAs6OiV6M6FqvabYdcWrsB+ZtvjuutsULDiQxBnTlbNo4ZJi5w9bt FUR3qFbedR+vgVyeVmx+/XbHoGIFddZ/vSjgbeGUmHnMBHRfTmcJksYq/WVOW4oiaUmUrcFn09m 35dufIXhOD0LwbN9Wc0S9uI7JBxtGCEAp4IRmEuAZzUMZ8XdsC3mMD5o2F9mfw0BHyNRSGHm/yi InemUfjbsVpDqH5c7ugMDjAfNx7skIrHhA6eAD3msp5cuwqrzUqrbz8DKS003RHBAA2mGOJudFw LiNKiMAJhOAKnXTW7kRGwdL4Lyx0MMtvW5LUohJW7sL6EHgAG9tsxuIOpZov8fhPmX8dP0KCgrn ABNZKbqsJTACBksdf+kHGT87jomq57CU3zy0HfQN5lOJw== X-Received: by 2002:a05:6a20:4320:b0:3c4:1c9f:d7e with SMTP id adf61e73a8af0-3cd4ba0a414mr26163686637.6.1787548125269; Sun, 23 Aug 2026 22:08:45 -0700 (PDT) Received: from localhost (75-172-9-230.tukw.qwest.net. [75.172.9.230]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc199e60abbsm674053a12.23.2026.08.23.22.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2026 22:08:44 -0700 (PDT) Message-ID: <6a8bd1dc.009b1f07.b9616.7896@mx.google.com> X-Google-Original-Message-ID: Date: Sun, 23 Aug 2026 22:08:40 -0700 From: Dennis Tighe To: Namjae Jeon , Hyunchul Lee Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] ntfs: do not mark the volume clean in sync_fs when errors were recorded Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ntfs_put_super() and the remount-read-only path both clear the dirty bit only when NVolErrors(vol) is false. ntfs_sync_fs() clears it unconditionally, so any sync() on a volume that recorded an error marks that volume clean. A volume without this set is then seen as not needing=20 recovery and it does not run one, so whatever went wrong is never repaired. This change skips resetting the dirty bit when there are volume errors. Reproduced on a volume whose $MFTMirr does not match $MFT, which sets the error flag while leaving the mount read-write: after a write and a sync, the on-disk volume flags read 0x0000 with this driver and 0x0001 with the guard in place. Fixes: 6251f0b0de7d ("ntfs: update super block operations") Assisted-by: claude:claude-opus-5 Signed-off-by: Dennis Tighe Reviewed-by: Hyunchul Lee --- fs/ntfs/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 30481e5d5dd4..a4dc64fb89ed 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1862,7 +1862,8 @@ static int ntfs_sync_fs(struct super_block *sb, int w= ait) return 0; =20 /* If there are some dirty buffers in the bdev inode */ - if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY)) { + if (!NVolErrors(vol) && + 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; } --=20 2.43.0