mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhihao Cheng <chengzhihao1@huawei.com>
To: <shao.mingyin@zte.com.cn>
Cc: <richard@nod.at>, <linux-mtd@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] ubifs: reject master nodes claiming a too small inode number
Date: Tue, 3 Nov 2026 12:50:16 +0800	[thread overview]
Message-ID: <a6608f36-7ce2-bfbe-339c-c5719bbb867f@huawei.com> (raw)
In-Reply-To: <20261103123104319tX_sQcNY56466a6yZeEgg@zte.com.cn>

在 2026/11/3 12:31, shao.mingyin@zte.com.cn 写道:
>> This check could be merged into previous check:
>>    f (c->highest_inum >= INUM_WATERMARK)
> 
> Agreed, the two bounds belong in one test:
> 
> 	if (c->highest_inum >= INUM_WATERMARK ||
> 	    c->highest_inum < UBIFS_FIRST_INO)
> 
This looks fine, there are many places return the same err code 
correponding several reasons, the err code help user to identify which 
field is incorrect, then ubifs_dump_node() will show all details.
> One side effect: a too small highest_inum then reports error 3 instead of
> the separate code 24.  If you would rather keep the two ranges apart in
> the log, I can leave the lower bound as its own check.
> 
> Thanks,
> Shao
> .
> 


  reply	other threads:[~2026-11-03  4:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 13:45 [PATCH 0/5] ubifs: harden validation of on-disk inode and node metadata shao.mingyin
2026-11-02 13:45 ` [PATCH 1/5] ubifs: reject inodes with an out-of-range size shao.mingyin
2026-11-02 13:49 ` [PATCH 2/5] ubifs: reject xattr inodes whose size does not match the value shao.mingyin
2026-11-03  2:06   ` Zhihao Cheng
2026-11-03  4:31     ` shao.mingyin
2026-11-02 13:49 ` [PATCH 3/5] ubifs: reject master nodes claiming a too small inode number shao.mingyin
2026-11-03  2:06   ` Zhihao Cheng
2026-11-03  4:31     ` shao.mingyin
2026-11-03  4:50       ` Zhihao Cheng [this message]
2026-11-02 13:49 ` [PATCH 4/5] ubifs: validate inode and data node sizes during replay shao.mingyin
2026-11-02 13:49 ` [PATCH 5/5] ubifs: xattr: guard against xattr accounting underflow shao.mingyin
2026-11-03  2:06 ` [PATCH 0/5] ubifs: harden validation of on-disk inode and node metadata Zhihao Cheng
2026-11-03  4:30   ` shao.mingyin
2026-11-03  4:50     ` Zhihao Cheng

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=a6608f36-7ce2-bfbe-339c-c5719bbb867f@huawei.com \
    --to=chengzhihao1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=shao.mingyin@zte.com.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®