Re:Re: [PATCH] ntfs: mount hibernated volumes read-only regardless of errors=

From: dd

Date: Mon Sep 14 2026 - 21:07:27 EST




在 2026-09-14 21:59:10,"Namjae Jeon" <linkinjeon@xxxxxxxxxx> 写道:
>On Mon, Sep 14, 2026 at 12:42 PM 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.
>check_windows_hibernation_status() calls ntfs_error() before SB_RDONLY
>is set. With errors=panic, this panics before reaching the new
>read-only fallback...
Thanks for catching this. Right -- those error paths call ntfs_error()
before SB_RDONLY is set, so errors=panic can fire inside
check_windows_hibernation_status().

I will remove the internal ntfs_error() calls in v2; the caller already
reports "Failed to determine if Windows is hibernated." for every
err < 0 case. NVolErrors() is still recorded, so ntfs_reconfigure()
keeps rejecting remounts to read-write.

Thanks,
Hongling