From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Jonathan Corbet <corbet@lwn.net>, Jens Axboe <axboe@kernel.dk>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org
Subject: [PATCH 2/2] block: allow empty cmdline partition set
Date: Fri, 22 Oct 2021 00:51:24 +0200 [thread overview]
Message-ID: <b84381943483d1e0b44ca28b4e549f2f912349bf.1634856658.git.mirq-linux@rere.qmqm.pl> (raw)
In-Reply-To: <8a6b11c6ada5d55bdb2b1f8319e47bbf5192654b.1634856658.git.mirq-linux@rere.qmqm.pl>
Make no-partitions setting valid. This makes it possible to prevent
kernel from trying to read a partition table from a device.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
Documentation/block/cmdline-partition.rst | 2 +-
block/partitions/cmdline.c | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/Documentation/block/cmdline-partition.rst b/Documentation/block/cmdline-partition.rst
index 530bedff548a..a5ccacee982f 100644
--- a/Documentation/block/cmdline-partition.rst
+++ b/Documentation/block/cmdline-partition.rst
@@ -13,7 +13,7 @@ Users can easily change the partition.
The format for the command line is just like mtdparts:
blkdevparts=<blkdev-def>[;<blkdev-def>]
- <blkdev-def> := <blkdev-id>:<partdef>[,<partdef>]
+ <blkdev-def> := <blkdev-id>:[<partdef>[,<partdef>]]
<partdef> := <size>[@<offset>](part-name)
<blkdev-id>
diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c
index 1af610f0ba8c..3655e8c8e949 100644
--- a/block/partitions/cmdline.c
+++ b/block/partitions/cmdline.c
@@ -164,11 +164,9 @@ static int parse_parts(struct cmdline_parts **parts, const char *bdevdef)
next_subpart = &(*next_subpart)->next_subpart;
}
- if (!newparts->subpart) {
- pr_warn("cmdline partition has no valid partition.");
- ret = -EINVAL;
- goto fail;
- }
+ if (!newparts->subpart)
+ pr_warn("%s: cmdline partition has no valid partitions.",
+ newparts->name);
*parts = newparts;
--
2.30.2
next prev parent reply other threads:[~2021-10-21 22:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 22:51 [PATCH 1/2] block: parse cmdline partitions first Michał Mirosław
2021-10-21 22:51 ` Michał Mirosław [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-01-04 16:24 Michał Mirosław
2020-01-04 16:24 ` [PATCH 2/2] block: allow empty cmdline partition set Michał Mirosław
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=b84381943483d1e0b44ca28b4e549f2f912349bf.1634856658.git.mirq-linux@rere.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--cc=axboe@kernel.dk \
--cc=corbet@lwn.net \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).