aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-03-29 01:53:08 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-03-29 01:56:05 +0100
commit506ddce90fc99d08d7bc0c9ef4277756f54473bb (patch)
tree2236f93eecee5b743e89540a41bb5381d9f9e327 /target/linux/generic
parent1c7e146f7e0f42e5e414c6cff0c73f75b405e0dd (diff)
downloadupstream-506ddce90fc99d08d7bc0c9ef4277756f54473bb.tar.gz
upstream-506ddce90fc99d08d7bc0c9ef4277756f54473bb.tar.bz2
upstream-506ddce90fc99d08d7bc0c9ef4277756f54473bb.zip
generic: 5.15: fix FIT partition parser on block partitions
Using set_disk_ro() doesn't have the desired effect and instead of just setting the single partition to be read-only it affects the whole disk. Use the bd_read_only flag in struct block_device instead to mark a partition being read-only. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch17
1 files changed, 13 insertions, 4 deletions
diff --git a/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch b/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch
index 560196ac72..5edacd5eae 100644
--- a/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch
+++ b/target/linux/generic/hack-5.15/410-block-fit-partition-parser.patch
@@ -74,16 +74,25 @@
#ifdef CONFIG_SGI_PARTITION
sgi_partition,
#endif
-@@ -598,6 +605,14 @@ static bool blk_add_partition(struct gen
+@@ -408,6 +415,11 @@ static struct block_device *add_partitio
+ goto out_del;
+ }
+
++#ifdef CONFIG_FIT_PARTITION
++ if (flags & ADDPART_FLAG_READONLY)
++ bdev->bd_read_only = true;
++#endif
++
+ /* everything is up and running, commence */
+ err = xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL);
+ if (err)
+@@ -598,6 +610,11 @@ static bool blk_add_partition(struct gen
(state->parts[p].flags & ADDPART_FLAG_RAID))
md_autodetect_dev(part->bd_dev);
+#ifdef CONFIG_FIT_PARTITION
+ if ((state->parts[p].flags & ADDPART_FLAG_ROOTDEV) && ROOT_DEV == 0)
+ ROOT_DEV = part->bd_dev;
-+
-+ if (state->parts[p].flags & ADDPART_FLAG_READONLY)
-+ set_disk_ro(disk, true);
+#endif
+
return true;