Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Lustre 2.16.0
-
3
-
9223372036854775807
Description
The current ldiskfs_write_ldd() code in lustre/utils/ldiskfs_mount_utils.c is creating a temporary mountpoint and mounting the MDT/OST filesystem temporarily to write the CONFIGS/mountdata file.
Since patch https://review.whamcloud.com/37656 ("LU-13241 utils: use libext2fs for ldiskfs operations") this function is already using libext2fs to open the filesystem to set the MMP feature flag, so it wouldn't be much more work to use libext2fs to create CONFIGS (if not present) and create/write the mountdata file directly.
We can copy do_mkdir_internal(MOUNT_CONFIGS_DIR) from debugfs to create the directory (ignore EEXIST if returned), and copy most of do_write_internal() to look up the file, and allocate an inode and create the file if it is not found, and then write it.
That would remove the spurious ldiskfs mount of the MDT/OST within mkfs.lustre/tunefs.lustre and avoid issues that have been seen from this temporary mount in the past (e.g. LU-13241 itself, LU-7002, and others).
It would also be good to remove the e2label system call in ldiskfs_read_ldd(). This should not be needed if mo_ldd->ldd_svname is filled in properly, or get the label directly from the libext2fs handle superblock (backfs->super->s_volume_name). I can't imagine a situation where ext2fs_open() is failing, while e2label is working, since they both use the same code.
Attachments
Issue Links
- is related to
-
LU-18436 need simple process to rebuild CONFIGS/mountdata file
-
- In Progress
-
-
LU-7002 mkfs.lustre mishandles SELinux context of temporary directory
-
- Resolved
-
-
LU-18560 ldiskfs_write_ldd(): Coverity reports issues
-
- Resolved
-
-
LU-13241 mount.lustre for large filesystem runs slow debugfs commands
-
- Resolved
-