mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: dd  <zhongling0719@126.com>
To: "Hyunchul Lee" <hyc.lee@gmail.com>
Cc: liubaolin <liubaolin12138@163.com>,
	"Hongling Zeng" <zenghongling@kylinos.cn>,
	linkinjeon@kernel.org, ntfs@lists.linux.dev,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re:Re: [PATCH v5] ntfs: mount hibernated volumes read-only regardless of errors=
Date: Mon, 21 Sep 2026 17:30:11 +0800 (CST)	[thread overview]
Message-ID: <4e70c6d0.7644.1a0c34d327f.Coremail.zhongling0719@126.com> (raw)
In-Reply-To: <CANFS6bYLBPr+FmE_MVWxBBMw+Qz55EFfy1u6UmBgkTak2CMyvA@mail.gmail.com>

Hi baolin,
 Thanks for catching this. I agree that temporarily setting
    SB_RDONLY
    makes it impossible to distinguish an error suppressed by
    ntfs_handle_error()
    from a successful check. In particular, errors from optional WSL EA loading may neither propagate through the hibernation check nor set
    NVolErrors()
    , allowing the flag to be cleared incorrectly.

Hi all:
   One question: with errors=panic, a corrupt $LogFile can still panic
during load_system_files(), before the hibernation fallback is reached.
For example, ntfs_check_logfile() panics on "LogFile is too small".

   Should mount-time metadata errors generally avoid errors=panic before
the superblock is published? If so, that seems like a separate follow-up
to extend the temporary policy substitution over load_system_files().

Thanks!

At 2026-09-21 15:57:29, "Hyunchul Lee" <hyc.lee@gmail.com> wrote:
>Hi Baolin, Hongling
>
>>    If you agree with this approach, could you please incorporate it and
>> send another revision? I'd appreciate feedback from you, Namjae, and
>> Hyunchul.
>
>I agree with this approach. It looks sound to me.
>
>>
>> feel free to add:
>> Suggested-by: Baolin Liu <liubaolin@kylinos.cn>
>>
>> Thanks,
>> Baolin.
>>
>>
>>
>>
>>
>>
>>
>> >       if (unlikely(err)) {
>> >               static const char *es1a = "Failed to determine if Windows is hibernated";
>> >               static const char *es1b = "Windows is hibernated";
>> > @@ -1581,12 +1594,25 @@ 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) {
>> > -                     sb->s_flags |= SB_RDONLY;
>> > -                     ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
>> > -             }
>> > +             /*
>> > +              * A Windows hibernation image is not a filesystem error, so
>> > +              * this is a safety interlock rather than something the
>> > +              * errors= policy may downgrade.  The super block is already
>> > +              * read-only here: the temporary flag taken for the check
>> > +              * above is not restored when the check failed.
>> > +              */
>> > +             ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
>> >               NVolSetErrors(vol);
>> > +     } else if (unlikely(temporary_ro && sb_rdonly(sb))) {
>> > +             static const char *es1 = "Errors were recorded during mount";
>> > +             static const char *es2 = ".  Run chkdsk.";
>> > +
>> > +             /*
>> > +              * Errors were recorded during the check or earlier, e.g. when
>> > +              * loading the LogFile.  Stay read-only, like ntfs_reconfigure()
>> > +              * does for volumes with recorded errors.
>> > +              */
>> > +             ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
>> >       }
>> >
>> >       /* If (still) a read-write mount, empty the logfile. */
>>
>
>
>-- 
>Thanks,
>Hyunchul

  reply	other threads:[~2026-09-21  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20  2:59 Hongling Zeng
2026-09-20 11:25 ` liubaolin
2026-09-21  7:57   ` Hyunchul Lee
2026-09-21  9:30     ` dd [this message]
2026-09-22  0:16       ` liubaolin
2026-09-22  1:26       ` Hyunchul Lee

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=4e70c6d0.7644.1a0c34d327f.Coremail.zhongling0719@126.com \
    --to=zhongling0719@126.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin12138@163.com \
    --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®