From: liubaolin <liubaolin12138@163.com>
To: Hongling Zeng <zenghongling@kylinos.cn>,
linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
zhongling0719@126.com, stable@vger.kernel.org
Subject: Re: [PATCH] ntfs: mount hibernated volumes read-only regardless of errors=
Date: Mon, 14 Sep 2026 12:16:05 +0800 [thread overview]
Message-ID: <2ee32e03-e39e-4dd1-be1e-13d3b68f5683@163.com> (raw)
In-Reply-To: <20260914034202.52011-1-zenghongling@kylinos.cn>
在 2026/9/14 11:42, Hongling Zeng 写道:
> The hibernation check in load_system_files() only converts the
> superblock to read-only under errors=remount-ro. With the default
> errors=continue (and with errors=panic), a hibernated volume is
> mounted read-write and the mount-time $LogFile emptying writes to it,
> although a hibernated volume must not be written to at all.
>
> Drop the on_errors term so that a hibernated volume, or a volume whose
> hibernation state cannot be determined, always mounts read-only.
> NVolErrors() is still recorded, so ntfs_reconfigure() keeps refusing
> remounts to read-write, and the $LogFile emptying is skipped by its
> !sb_rdonly() check.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
> fs/ntfs/super.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
> index 2d4132aa39d3..fd7e5dbd1115 100644
> --- a/fs/ntfs/super.c
> +++ b/fs/ntfs/super.c
> @@ -1660,8 +1660,13 @@ static bool load_system_files(struct ntfs_volume *vol)
> const char *es1;
>
> es1 = err < 0 ? es1a : es1b;
> - /* If a read-write mount, convert it to a read-only mount. */
> - if (!sb_rdonly(sb) && vol->on_errors == ON_ERRORS_REMOUNT_RO) {
> + /*
> + * A Windows hibernation image is not a filesystem error, so
> + * this is a safety interlock rather than something the
> + * errors= policy may downgrade: always convert a read-write
> + * mount to read-only.
> + */
> + if (!sb_rdonly(sb)) {
> sb->s_flags |= SB_RDONLY;
> ntfs_error(sb, "%s. Mounting read-only%s", es1, es2);
> }
Looks good to me.
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
next prev parent reply other threads:[~2026-09-14 4:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 3:42 Hongling Zeng
2026-09-14 4:16 ` liubaolin [this message]
2026-09-14 13:59 ` Namjae Jeon
2026-09-15 1:05 ` dd
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=2ee32e03-e39e-4dd1-be1e-13d3b68f5683@163.com \
--to=liubaolin12138@163.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 \
--cc=zhongling0719@126.com \
/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®