From: Hongling Zeng <zhongling0719@126.com>
To: Namjae Jeon <linkinjeon@kernel.org>,
Hongling Zeng <zenghongling@kylinos.cn>
Cc: hyc.lee@gmail.com, ntfs@lists.linux.dev,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 2/3] ntfs: sync the volume dirty bit with the recorded error state
Date: Tue, 08 Sep 2026 15:20:54 +0800 [thread overview]
Message-ID: <6A9FB756.1010302@126.com> (raw)
In-Reply-To: <CAKYAXd9Hs1aEe_Tx4QwaKVUWM9RSrkAcO9Q7naMQWxg_2G0vAg@mail.gmail.com>
在 2026年09月08日 12:10, Namjae Jeon 写道:
>> @@ -1621,6 +1666,11 @@ static bool load_system_files(struct ntfs_volume *vol)
>> ntfs_error(sb, "%s. Mounting read-only%s", es1, es2);
>> }
>> NVolSetErrors(vol);
>> + /*
>> + * Remember it for the lifetime of the mount: see
>> + * ntfs_sync_volume_dirty_state().
>> + */
>> + NVolSetHibernated(vol);
> Could you explain why NVolSetHibernated(vol) is called for non-zero
> return from check_windows_hibernation_status() ?
Hi:
A non-zero return does not only mean "definitely hibernated": > 0
means hibernation was established or assumed (the documented
"treated as if Windows is suspended" default), while < 0 means the
check itself failed, so hibernation could not be ruled out.
NV_Hibernated is a conservative write gate, not a positive claim: it
keeps ntfs_sync_volume_dirty_state() from writing the $Volume record
on this mount. It has to cover the whole branch because this series
changes what NVolErrors() means for writes: it used to suppress the
flags write, and now the on-disk dirty bit is derived from it on
read-write mounts. Without the separate gate, an rw mount of a
hibernated volume (errors=continue) would gain a filesystem-internal
$Volume write on the first sync_fs() or at unmount - exactly what
the hibernation check exists to prevent.
err < 0 is included for the same reason, only more so: when the
check cannot complete, we cannot prove the volume is safe to write.
Gating wrongly costs an untouched dirty bit; not gating wrongly
costs Windows resuming on a modified image.
Thanks!
next prev parent reply other threads:[~2026-09-08 7:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 7:08 [PATCH v3 0/3] ntfs: fix volume flag update races and persist " Hongling Zeng
2026-09-07 7:08 ` [PATCH v3 1/3] ntfs: fix volume flag update races Hongling Zeng
2026-09-08 5:29 ` liubaolin
2026-09-08 9:36 ` Hongling Zeng
2026-09-07 7:08 ` [PATCH v3 2/3] ntfs: sync the volume dirty bit with the recorded error state Hongling Zeng
2026-09-08 4:10 ` Namjae Jeon
2026-09-08 7:20 ` Hongling Zeng [this message]
2026-09-08 5:23 ` liubaolin
2026-09-08 9:22 ` Hongling Zeng
2026-09-07 7:08 ` [PATCH v3 3/3] ntfs: NULL vol->vol_ino in the load_system_files() error teardown Hongling Zeng
2026-09-08 4:38 ` liubaolin
2026-09-08 9:42 ` Namjae Jeon
2026-09-08 4:32 ` [PATCH v3 0/3] ntfs: fix volume flag update races and persist the recorded error state liubaolin
-- strict thread matches above, loose matches on Subject: below --
2026-09-09 2:48 [PATCH v4 0/4] " Hongling Zeng
2026-09-09 2:48 ` [PATCH v3 2/3] ntfs: sync the volume dirty bit with " Hongling Zeng
2026-09-07 6:22 [PATCH v3 0/3] ntfs: fix volume flag update races and persist " Hongling Zeng
2026-09-07 6:22 ` [PATCH v3 2/3] ntfs: sync the volume dirty bit with " Hongling Zeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6A9FB756.1010302@126.com \
--to=zhongling0719@126.com \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=zenghongling@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®