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

ioctl passthrough mechanism for Lustre OST/MDT mountpoints

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • Lustre 2.1.0, Lustre 2.5.0
    • 14,489
    • 8383

    Description

      Implement an interface for sending IO Control (ioctl) commands from userspace through the Lustre mount point to the underlying ldiskfs filesystem to allow execution of filesystem-wide ioctl() commands, such as resize. This will allow user-space tools that operate via ioctl() commands on the filesystem mountpoint to be used on the Lustre MDT and OST filesystems while they are mounted and in use subject to any limitations of the original ioctl() commands themselves.

      Attachments

        Issue Links

          Activity

            [LU-137] ioctl passthrough mechanism for Lustre OST/MDT mountpoints

            Hi Andeas,

            I have ported the ioctl_passthru-1_8.patch to the latest master.
            With this patch I tested EXT4_IOC_GETFLAGS and EXT4_IOC_GETVERSION ioctls on OST and MDT mountpoints. These ioctls work and return expected values.
            I have added this a testcase in sanity.sh
            The patch can be found here -> http://review.whamcloud.com/#/c/7354/

            I tried the EXT4_IOC_SETVERSION ioctl but that resulted in a crash.
            Is that expected?

            spimpale Swapnil Pimpale (Inactive) added a comment - Hi Andeas, I have ported the ioctl_passthru-1_8.patch to the latest master. With this patch I tested EXT4_IOC_GETFLAGS and EXT4_IOC_GETVERSION ioctls on OST and MDT mountpoints. These ioctls work and return expected values. I have added this a testcase in sanity.sh The patch can be found here -> http://review.whamcloud.com/#/c/7354/ I tried the EXT4_IOC_SETVERSION ioctl but that resulted in a crash. Is that expected?

            Unfortunately, I expect that the 1.8 version of the patch is completely useless for the current 2.1 and master code...

            You might want to experiment with some simple ioctl (e.g. EXT4_IOC_GETFLAGS or EXT4_IOC_GETVERSION) to get that working before you try to have resize2fs calling the online resizer. The end goal is that at least EXT4_IOC_GROUP_EXTEND/EXT4_IOC_GROUP_ADD (old resize), EXT4_IOC_RESIZE_FS (new resize), and FITRIM work.

            adilger Andreas Dilger added a comment - Unfortunately, I expect that the 1.8 version of the patch is completely useless for the current 2.1 and master code... You might want to experiment with some simple ioctl (e.g. EXT4_IOC_GETFLAGS or EXT4_IOC_GETVERSION) to get that working before you try to have resize2fs calling the online resizer. The end goal is that at least EXT4_IOC_GROUP_EXTEND/EXT4_IOC_GROUP_ADD (old resize), EXT4_IOC_RESIZE_FS (new resize), and FITRIM work.

            Hi Andreas, I am working on this ticket.

            kalpak Kalpak Shah (Inactive) added a comment - Hi Andreas, I am working on this ticket.

            Updated patch that includes sb->s_dev fix.

            adilger Andreas Dilger added a comment - Updated patch that includes sb->s_dev fix.

            Patch for the e2fsprogs resize2fs tool to allow it to specify the directory mountpoint for resizing, instead of requiring one to specify a block device for the resize operation.

            I don't think this should be required for the ioctl passthrough to work, but it simplifies the usage of resize2fs, and I thought I needed it until I fixed the Lustre sb->s_dev on the mounted filesystem.

            adilger Andreas Dilger added a comment - Patch for the e2fsprogs resize2fs tool to allow it to specify the directory mountpoint for resizing, instead of requiring one to specify a block device for the resize operation. I don't think this should be required for the ioctl passthrough to work, but it simplifies the usage of resize2fs, and I thought I needed it until I fixed the Lustre sb->s_dev on the mounted filesystem.

            Prototype patch for ioctl passthrough. It is known to have problems (i.e. crash if used), but is close to what I think would work.

            There are a few avenues for investigation as to why it is not working:

            • I had to make a change to the e2fsprogs library to allow resize2fs to work,
              because it was calling stat() on the mountpoint to verify that it was the
              same as the underlying block device, to determine if the filesystem is mounted.
              (first attachment)
            • This in turn required a change to the lustre server mountpoint to ensure that
              it is initializing the device number correctly, so that st_rdev for the Lustre
              mountpoint is the same as st_dev of the underlying device node. This is also
              included with the server_ioctl() function that is supposed to be working.
              (second attachment)
            • the pointer to the underlying ldiskfs device may be incorrect. The handling
              of the internal ldiskfs mountpoint is more complex than I'd like, so it isn't
              immediately clear that my code is pointing at the right device
            • the size of the ioctl parameter that is being copied could be incorrect
            adilger Andreas Dilger added a comment - Prototype patch for ioctl passthrough. It is known to have problems (i.e. crash if used), but is close to what I think would work. There are a few avenues for investigation as to why it is not working: I had to make a change to the e2fsprogs library to allow resize2fs to work, because it was calling stat() on the mountpoint to verify that it was the same as the underlying block device, to determine if the filesystem is mounted. (first attachment) This in turn required a change to the lustre server mountpoint to ensure that it is initializing the device number correctly, so that st_rdev for the Lustre mountpoint is the same as st_dev of the underlying device node. This is also included with the server_ioctl() function that is supposed to be working. (second attachment) the pointer to the underlying ldiskfs device may be incorrect. The handling of the internal ldiskfs mountpoint is more complex than I'd like, so it isn't immediately clear that my code is pointing at the right device the size of the ioctl parameter that is being copied could be incorrect

            Assigning back to Andreas until we find a new owner for this project.

            bryon Bryon Neitzel (Inactive) added a comment - Assigning back to Andreas until we find a new owner for this project.

            People

              adilger Andreas Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: