All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC next 1/2] dm: lvm: Initial Logical Volume Management support
Date: Mon, 31 Aug 2026 10:39:16 +0200	[thread overview]
Message-ID: <87ik4qof9n.fsf@waldekranz.com> (raw)
In-Reply-To: <466724b2-2de6-4e41-b546-724dc2bd3d9a@pengutronix.de>

On fre, aug 28, 2026 at 14:19, "Sascha Hauer" <s.hauer@pengutronix.de> wrote:
> On 2026-08-24 18:31, Tobias Waldekranz wrote:
>> +
>> +const lvm_tok_t *lvm_md_vgsect(const struct lvm_md *md, const lvm_tok_t **keyp)
>> +{
>> +	const lvm_tok_t *key, *val;
>> +
>> +	lvm_md_for_each(md, key, &md->tokens[0]) {
>> +		val = key + 1;
>
> Should you check against num_tokens here?

Good catch, yes I should!

>
>> +		if (val->type == LVM_TOK_SECTION) {
>> +			if (keyp)
>> +				*keyp = key;
>> +			return val;
>> +		}
>> +	}
>> +
>> +	return NULL;
>> +}
>> +
>
>> +const lvm_tok_t *lvm_md_find(const struct lvm_md *md, const lvm_tok_t *sec,
>> +			     const char *key)
>> +{
>> +	const lvm_tok_t *k;
>> +
>> +	if (sec->type != LVM_TOK_SECTION)
>> +		return NULL;
>> +
>> +	lvm_md_for_each(md, k, sec) {
>> +		if (lvm_md_tok_eq(md, k, key))
>> +			return k + 1;
>
> Here as well. Fuzzing might indeed be useful ;)

Indeed :) Thanks for the thorough review!



  reply	other threads:[~2026-08-31  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 18:31 [RFC next 0/2] dm: lvm: Initial Logical Volume Management support Tobias Waldekranz
2026-08-24 18:31 ` [RFC next 1/2] " Tobias Waldekranz
2026-08-28 14:19   ` Sascha Hauer
2026-08-31  8:39     ` Tobias Waldekranz [this message]
2026-08-24 18:31 ` [RFC next 2/2] commands: lvm: inspect VGs, activate LVs Tobias Waldekranz
2026-08-28 14:20   ` Sascha Hauer
2026-08-31  8:40     ` Tobias Waldekranz
2026-08-28 14:10 ` [RFC next 0/2] dm: lvm: Initial Logical Volume Management support Sascha Hauer
2026-08-31  8:37   ` Tobias Waldekranz
2026-08-31  9:11     ` Sascha Hauer

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=87ik4qof9n.fsf@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.