[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <2b13cbb612add74856aa88a71375db3718d4aae6.1578154967.git.mirq-linux@rere.qmqm.pl>
Date: Sat, 04 Jan 2020 17:24:20 +0100
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: Jonathan Corbet <corbet@....net>, Jens Axboe <axboe@...nel.dk>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org
Subject: [PATCH 2/2] block: allow empty cmdline partition set
Make no-partitions setting valid. This makes it possible to prevent
kernel from trying to read partition table from a device.
Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
Documentation/block/cmdline-partition.rst | 2 +-
block/cmdline-parser.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/cmdline-parser.c b/block/cmdline-parser.c
index f2a14571882b..bc63e46e7bfc 100644
--- a/block/cmdline-parser.c
+++ b/block/cmdline-parser.c
@@ -133,11 +133,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.20.1
Powered by blists - more mailing lists