OSDN Git Service

kernel: bump 5.15 to 5.15.32
[immortalwrt/immortalwrt.git] / target / linux / ipq806x / patches-5.15 / 102-mtd-rootfs-conflicts-with-OpenWrt-auto-mounting.patch
1 From 5001f2e1a325b68dbf225bd17f69a4d3d975cca5 Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Thu, 9 Mar 2017 09:31:44 +0100
4 Subject: [PATCH 61/69] mtd: "rootfs" conflicts with OpenWrt auto mounting
5
6 Signed-off-by: John Crispin <john@phrozen.org>
7 ---
8  drivers/mtd/mtdpart.c | 4 ++++
9  1 file changed, 4 insertions(+)
10
11 --- a/drivers/mtd/mtdpart.c
12 +++ b/drivers/mtd/mtdpart.c
13 @@ -50,7 +50,11 @@ static struct mtd_info *allocate_partiti
14  
15         /* allocate the partition structure */
16         child = kzalloc(sizeof(*child), GFP_KERNEL);
17 -       name = kstrdup(part->name, GFP_KERNEL);
18 +       /* "rootfs" conflicts with OpenWrt auto mounting */
19 +       if (mtd_type_is_nand(parent) && !strcmp(part->name, "rootfs"))
20 +               name = "ubi";
21 +       else
22 +               name = kstrdup(part->name, GFP_KERNEL);
23         if (!name || !child) {
24                 printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n",
25                        parent->name);