[LU-6202] clean up ioctl handling Created: 03/Feb/15 Updated: 10/Sep/20 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Upstream |
| Type: | Bug | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | James A Simmons |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | medium | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Severity: | 3 | ||||||||||||||||||||||||||||
| Rank (Obsolete): | 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. |
| Comments |
| Comment by James A Simmons [ 22/Apr/17 ] |
|
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 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.
|
| Comment by Gerrit Updater [ 04/Oct/18 ] |
|
James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/33284 |
| Comment by James A Simmons [ 04/Oct/18 ] |
|
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 |
| Comment by Gerrit Updater [ 10/Oct/18 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33284/ |
| Comment by Gerrit Updater [ 20/Nov/18 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33691 |
| Comment by Gerrit Updater [ 20/Nov/18 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33692 |
| Comment by Gerrit Updater [ 20/Nov/18 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33693 |
| Comment by Gerrit Updater [ 20/Nov/18 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33695 |
| Comment by Gerrit Updater [ 01/Apr/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33691/ |
| Comment by Gerrit Updater [ 01/Apr/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33692/ |
| Comment by Gerrit Updater [ 30/Jul/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33693/ |
| Comment by Andreas Dilger [ 30/Aug/19 ] |
|
James Simmons (jsimmons@infradead.org) uploaded a new patch: https://review.whamcloud.com/35993 |
| Comment by Gerrit Updater [ 09/Apr/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35993/ |