Re: [PATCH v3] ntfs: mount hibernated volumes read-only regardless of errors=
From: Namjae Jeon
Date: Wed Sep 16 2026 - 08:09:14 EST
On Tue, Sep 15, 2026 at 11:38 AM Hongling Zeng <zenghongling@xxxxxxxxxx> wrote:
>
> 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.
>
> Also change the ntfs_error() calls inside
> check_windows_hibernation_status() to ntfs_warning(): they run before
> SB_RDONLY is set, so errors=panic could panic there, while the warnings
> preserve diagnostics for already read-only mounts. The read-only
> fallback message is logged unconditionally: with SB_RDONLY set, or on
> an already read-only mount, ntfs_error() cannot panic, and the reason
> for NVolErrors() stays visible.
errors=panic can still panic before the read-only fallback.
ntfs_lookup_inode_by_name() and ntfs_iget() in
check_windows_hibernation_status() can call ntfs_error() internally.