[LU-16811] mke2fs check_if_lustre_mounted() not working or needed Created: 09/May/23  Updated: 09/May/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andreas Dilger Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: e2fsprogs, easy

Severity: 3
Rank (Obsolete): 9223372036854775807

 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.


Generated at Sat Feb 10 03:30:12 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.