[PATCH 2/2] block: allow empty cmdline partition set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux