Re: [PATCH/RFC -nxt] mtd_blkdevs: Set GENHD_FL_NO_PART

From
Geert Uytterhoeven <geert@linux-m68k.org>
Date
2021-12-03 08:26:10
Also in
linux-renesas-soc, lkml
Reply to
Christoph Hellwig, 2021-12-03
Hi Christoph,

On Fri, Dec 3, 2021 at 7:57 AM Christoph Hellwig [off-list ref] wrote:
I think we need the patch below to restore the old behavior where a
partitions scan happens only for those sub-drivers that do report a
partition shift.
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
quoted hunk ↗ jump to hunk
MTD maintainers: is this intentional that raw mtdblock does not support
partitions, but the various "FTL" modules do?
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 113f86df76038..57a22d2ebaeca 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -345,6 +345,8 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
        gd->first_minor = (new->devnum) << tr->part_bits;
        gd->minors = 1 << tr->part_bits;
        gd->fops = &mtd_block_ops;
+       if (!tr->part_bits)
+               gd->flags |= GENHD_FL_NO_PART;
Move this into the "else" branch of the test below?
        if (tr->part_bits)
                if (new->devnum < 26)
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Thread (5 messages) 5 messages, 3 authors, last reply 2021-12-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help