v1->v2:
1) Replace BLK_DEV_DUMPINFO with BLK_DEV_WRITE_MOUNTED_QUIET, which is
logically opposite;
2) Make BLK_DEV_WRITE_MOUNTED_QUIET dependent on
BLK_DEV_WRITE_MOUNTED, and decide whether to set bd_writers
by BLK_DEV_WRITE_MOUNTED_QUIET;
3) Move bdev_dump_info() into bdev_may_open();
4) Add the cmdline interface to control whether to show info;
5) Pass the state of "writes blocked" to part0 when mounting a
partition.
v2->v3:
Add restriction for modifying bd_writers.
v3->v4:
1) Count bd_writers regardless of whether bdev_allow_write_mounted is
set;
2) Expand the meaning of bdev_allow_write_mounted;
3) Add config option to detect writing to part0 while partitions
mounted;
4) Add bd_mounters to record the number of times that part0 or
partition is mounted;
5) Show info about opening a lower device for write while upper-layers
mounted.
v4->v5:
Move introduction of bd_mounters to patch1.
v5->v6:
Delete redundant conflict judgment.
v6->v7:
1) Replace BLK_DEV_WRITE_MOUNTED_QUIET with BLK_DEV_WRITE_MOUNTED_DUMP;
2) Remove restriction for setting bdev_allow_write_mounted by cmdline.
v7->v8:
1) Add detection of mounting part0 while partitions write opened;
2) Add detection of writing partitions while part0 mounted;
3) Add config in openeuler_defconfig.
v8->v9:
1) Split bd_mounters into bd_mounted and part_mounters;
2) Add part_writers;
3) Count part_writers and part_mounters regardless of whether
BLK_DEV_DETECT_WRITING_PART0 is set.
v9->v10:
1) Split the logic of detecting writing lower device from bd_may_open();
2) Fix the bug of initializing bdev_allow_write_mounted.
Li Lingfeng (6):
block: Record writing and mounting regardless of whether
bdev_allow_write_mounted is set
block: Expand the meaning of bdev_allow_write_mounted
block: Add config option to detect writing to part0 while partitions
mounted
block: Add config option to show info about opening a mounted device
for write
block: Show info about opening a lower device for write while
upper-layers mounted
add config about writing mounted devices in openeuler_defconfig
arch/arm64/configs/openeuler_defconfig | 3 +
arch/x86/configs/openeuler_defconfig | 3 +
block/Kconfig | 17 ++++
block/bdev.c | 123 +++++++++++++++++++++----
include/linux/blk_types.h | 3 +
include/linux/blkdev.h | 2 +
6 files changed, 133 insertions(+), 18 deletions(-)
--
2.31.1