Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18818

remove mount+open+write+close from ldiskfs_write_ldd()

Details

    • 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

          Activity

            People

              wc-triage WC Triage
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: