Description
The check_if_lustre_mounted() function that is patched into mke2fs is not working properly, because it is checking /proc/fs/lustre/osd-ldiskfs/mntdev but this file has long ago moved to /sys/fs/lustre/osd-ldiskfs/mntdev.
The checking for the Lustre mount device was necessary before the kernel open(O_EXCL) functionality was available to prevent mke2fs and e2fsck from running on a mounted block device. It seems that this patch is no longer needed and could be removed from e2fsprogs, one less patch that needs to be maintained.
Before removing the patch completely, it would be good to manually test this is working against a (test) mounted ZFS filesystem device. I've tested with ldiskfs and can confirm that open(O_EXCL) fails for the BLOCK DEVICE (e.g. /dev/mapper/ost4_flakey), though it does not work if a plain file (e.g. /tmp/testfs-ost4) is mounted via loopback and the file is formatted by mke2fs, but that isn't unexpected and this patch wouldn't avoid it either way.