Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • Upstream
    • None
    • 3
    • 17336

    Description

      There are a large number of ioctl cleanups that are needed for Lustre. A start is in http://review.whamcloud.com/10139 but there is more that could be done. The biggest offender is anything using struct libcfs_ioctl_data, which is a horrible structure that passes pointers from userspace to the kernel. Anything using that struct is a candidate for cleanup.

      The complexity is that Lustre ioctls are done in /dev/lnet or /dev/obd and may address any device in the stack (LNDs, OBD devices, etc). At a minimum, the libcfs_ioctl_data should be cleaned up to be a properly packed structure without internal pointers, but better would be proper ioctl structures that do not try to be all things to all users.

      It seems unlikely that we need to keep the lctl device configuration interface anymore (attach, detach, setup, cleanup, dump_cfg, etc), so all userspace commands/structures related to that could be removed.

      Some code (e.g. jt_obd_dump_log()) is obsolete due to liblustre removal and could also be removed outright.

      llapi_get_version() can read the version from /proc/fs/lustre/version via llapi_get_param() or similar, instead of using an ioctl.

      There is probably more, and possibly this needs to be split into several bugs, but at least it is a starting point for such cleanups.

      Attachments

        Issue Links

          Activity

            [LU-6202] clean up ioctl handling

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33693/
            Subject: LU-6202 utils: remove obsolete l_ioctl2() wrapper
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: b3f3486723084f14493b3866803274576ed9e269

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33693/ Subject: LU-6202 utils: remove obsolete l_ioctl2() wrapper Project: fs/lustre-release Branch: master Current Patch Set: Commit: b3f3486723084f14493b3866803274576ed9e269

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33692/
            Subject: LU-6202 misc: remove LIBCFS_IOC_DEBUG_MASK ioctl
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 70f932c7bfc590c03309bd2a83db20dd6ef5a8d4

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33692/ Subject: LU-6202 misc: remove LIBCFS_IOC_DEBUG_MASK ioctl Project: fs/lustre-release Branch: master Current Patch Set: Commit: 70f932c7bfc590c03309bd2a83db20dd6ef5a8d4

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33691/
            Subject: LU-6202 misc: delete OBD_IOC_PING_TARGET ioctl
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: d17d6ef74e522a4b57f2824161788a69f32bd5e7

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33691/ Subject: LU-6202 misc: delete OBD_IOC_PING_TARGET ioctl Project: fs/lustre-release Branch: master Current Patch Set: Commit: d17d6ef74e522a4b57f2824161788a69f32bd5e7

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33695
            Subject: LU-6202 utils: allow device_list for non-root users
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: dc2798a989f809f55757aae40d85950aa70afd1b

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33695 Subject: LU-6202 utils: allow device_list for non-root users Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: dc2798a989f809f55757aae40d85950aa70afd1b

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33693
            Subject: LU-6202 utils: remove obsolete l_ioctl2() wrapper
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 941ba3ecb03ffcede12527961a59548cf9f8ec36

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33693 Subject: LU-6202 utils: remove obsolete l_ioctl2() wrapper Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 941ba3ecb03ffcede12527961a59548cf9f8ec36

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33692
            Subject: LU-6202 misc: remove LIBCFS_IOC_DEBUG_MASK ioctl
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: e1bc122bfa88b06f873ed2ff5a4cedef308a9660

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33692 Subject: LU-6202 misc: remove LIBCFS_IOC_DEBUG_MASK ioctl Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: e1bc122bfa88b06f873ed2ff5a4cedef308a9660

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33691
            Subject: LU-6202 misc: delete OBD_IOC_PING_TARGT ioctl
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: b7f0d6d02f839f3c4757b2048ea7fe226f568c73

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33691 Subject: LU-6202 misc: delete OBD_IOC_PING_TARGT ioctl Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: b7f0d6d02f839f3c4757b2048ea7fe226f568c73

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33284/
            Subject: LU-6202 libcfs: replace libcfs_register_ioctl with a blocking notifier_chain
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: fba98579efc4fe3bb69309041b60d7723475b5e2

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33284/ Subject: LU-6202 libcfs: replace libcfs_register_ioctl with a blocking notifier_chain Project: fs/lustre-release Branch: master Current Patch Set: Commit: fba98579efc4fe3bb69309041b60d7723475b5e2

            This first patch moves libcfs_register_ioctl to the blocking notifier_chain the kernel uses. From their we can move the obd_iocontrol() handling to this as well. The benefit of this approach is that we can register ioctls of the backend filesystem with the blocking notifier_chain to meet the LU-137 work.

            simmonsja James A Simmons added a comment - This first patch moves libcfs_register_ioctl to the blocking notifier_chain the kernel uses. From their we can move the obd_iocontrol() handling to this as well. The benefit of this approach is that we can register ioctls of the backend filesystem with the blocking notifier_chain to meet the LU-137 work.

            James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/33284
            Subject: LU-6202 libcfs: replace libcfs_register_ioctl with a blocking notifier_chain
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: eded4e93a52aead577a26e11ec3a05961d07428f

            gerrit Gerrit Updater added a comment - James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/33284 Subject: LU-6202 libcfs: replace libcfs_register_ioctl with a blocking notifier_chain Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: eded4e93a52aead577a26e11ec3a05961d07428f

            The review by Andreas for the patch to make lustre_ioctl.h a proper UAPI pointed out several IOCTLs that are obsolete. I'm placing the list here so its not lost. Besides the cleanup in lustre_ioctl.h the utilites and kernel code have to scanned to make sure we don't have source code left overs.

            There are a bunch of ioctl definitions that could be removed completely, rather than continuing to shuffle them around.

            I suspect there are even some un-commented ioctls that could be removed, but that is more work to check.

            lustre/include/uapi/linux/lustre_ioctl.h
            Line 141:

            All of these IOC_LDLM_* ioctls are obsolete since 1.5 and can be removed.

            Line 157:

            Hasn't been used since pre-1.0, should just be deleted. Same for OBD_IOC_FORMAT, OBD_IOC_PARTITION, OBD_IOC_COPY, OBD_IOC_MIGR, OBD_IOC_PUNCH, and OBD_IOC_MODULE_DEBUG

            Line 176:

            Can just be removed, per above.

            Line 180:

            Obsolete since 1.5, can be removed.

            Line 182:

            Has never been used.

            Line 183:

            Obsolete since before 1.4.

            Line 184:

            Just removed in 2.10, keep this one.

            Line 199:

            Obsolete since 1.5, along with OBD_IOC_ENDRECORD, OBD_IOC_PARSE, and OBD_IOC_DORECORD.

             

            simmonsja James A Simmons added a comment - The review by Andreas for the patch to make lustre_ioctl.h a proper UAPI pointed out several IOCTLs that are obsolete. I'm placing the list here so its not lost. Besides the cleanup in lustre_ioctl.h the utilites and kernel code have to scanned to make sure we don't have source code left overs. There are a bunch of ioctl definitions that could be removed completely, rather than continuing to shuffle them around. I suspect there are even some un-commented ioctls that could be removed, but that is more work to check. lustre/include/uapi/linux/lustre_ioctl.h Line 141 : All of these IOC_LDLM_* ioctls are obsolete since 1.5 and can be removed. Line 157 : Hasn't been used since pre-1.0, should just be deleted. Same for OBD_IOC_FORMAT, OBD_IOC_PARTITION, OBD_IOC_COPY, OBD_IOC_MIGR, OBD_IOC_PUNCH, and OBD_IOC_MODULE_DEBUG Line 176 : Can just be removed, per above. Line 180 : Obsolete since 1.5, can be removed. Line 182 : Has never been used. Line 183 : Obsolete since before 1.4. Line 184 : Just removed in 2.10, keep this one. Line 199 : Obsolete since 1.5, along with OBD_IOC_ENDRECORD, OBD_IOC_PARSE, and OBD_IOC_DORECORD.  

            People

              simmonsja James A Simmons
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: