Description
ioctl(EXT4_IOC_GET_TUNE_SB_PARAM) and ioctl(EXT4_IOC_SET_TUNE_SB_PARAM) allow getting and setting the ldiskfs superblock tunable parameters on a mounted filesystem by tune2fs via ioctl with instead of writing directly to the block device.
This avoids race conditions during read-modify-write of the whole superblock, and the need to directly write to the block device while the filesystem is mounted, which also avoids complications with Multi-Mount Protection.
There are a couple of ext4 patches to add the ioctl() handling:
- v2,2/3 ext4: add support for 32-bit default reserved uid and gid
- v2,3/3 ext4: implement new ioctls to set and get superblock parameters
and a second series to add tune2fs handling:
- 1/3 tune2fs: reorganize command-line flag handling
- 2/3 tune2fs: rework parse_extended_opts() so it only parses the option string
- 3/3 tune2fs: try to use the SET_TUNE_SB_PARAM ioctl on mounted file systems
Since these are already slated for upstream landing, it wouldn't be a huge burden to add them to ldiskfs.