diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-05-15 10:05:07 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-05-16 09:12:58 +0200 |
commit | dfdfc732ba6fc1db8b264227705c3e325135895b (patch) | |
tree | ba25cc424bd082a8dcf1c51360b0ab08d3de3a47 /include/arm926ejs.h | |
parent | dd6ac1612b4b9cdabff92e7e4cded84ffd5ef3c6 (diff) | |
download | barebox-master.tar.gz barebox-master.tar.xz |
reparse_partition_table() will delete a device's existing partition
cdevs and allocate new ones according to the new partition table.
Holding a reference to a cdev prevents it from bring removed to avoid
dangling pointers and use-after-frees.
Unfortunately, not all users call cdev_open on the cdev and increment
the usage count, instead using functions like cdev_by_name, which don't
call cdev_open.
The proper solution for this is probably to change all functions that
return a cdev to actually take a reference to the cdev.
This will involve quite a bit of work though, so for now, restore old
behavior by making reparsing of the partition tables dependent on
CONFIG_PARTITION_MANIPULATION=y.
The option isn't fully appropriate as partition manipulation can happen
by writing to the parent block device, but not noticing changes of
partitions is the behavior we had before.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240515080507.4056255-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/arm926ejs.h')
0 files changed, 0 insertions, 0 deletions