mtd_blkdevs: don't scan partitions for plain mtdblock
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066297 commit 17f81f9d4b41d57e474975c3a5ca2a2c4c01e2ec Author: Christoph Hellwig <hch@lst.de> Date: Mon Dec 6 08:04:09 2021 +0100 mtd_blkdevs: don't scan partitions for plain mtdblock mtdblock / mtdblock_ro set part_bits to 0 and thus nevever scanned partitions. Restore that behavior by setting the GENHD_FL_NO_PART flag. Fixes: 1ebe2e5f9d68e94c ("block: remove GENHD_FL_EXT_DEVT") Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20211206070409.2836165-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@redhat.com>
This commit is contained in:
parent
45d27b1396
commit
df5a1dddb1
|
@ -389,7 +389,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
|
|||
gd->minors = 1 << tr->part_bits;
|
||||
gd->fops = &mtd_block_ops;
|
||||
|
||||
if (tr->part_bits)
|
||||
if (tr->part_bits) {
|
||||
if (new->devnum < 26)
|
||||
snprintf(gd->disk_name, sizeof(gd->disk_name),
|
||||
"%s%c", tr->name, 'a' + new->devnum);
|
||||
|
@ -398,9 +398,11 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
|
|||
"%s%c%c", tr->name,
|
||||
'a' - 1 + new->devnum / 26,
|
||||
'a' + new->devnum % 26);
|
||||
else
|
||||
} else {
|
||||
snprintf(gd->disk_name, sizeof(gd->disk_name),
|
||||
"%s%d", tr->name, new->devnum);
|
||||
gd->flags |= GENHD_FL_NO_PART;
|
||||
}
|
||||
|
||||
set_capacity(gd, ((u64)new->size * tr->blksize) >> 9);
|
||||
|
||||
|
|
Loading…
Reference in New Issue