[LU-4983] deprecate struct obd_ioctl_data Created: 30/Apr/14  Updated: 31/Jan/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Unresolved Votes: 1
Labels: llapi, obd

Issue Links:
Related
is related to LU-4961 utils and test should not depend on o... Closed
Severity: 3
Rank (Obsolete): 13803

 Description   

This is prompted by comments on http://review.whamcloud.com/#/c/10139 from LU-4961. Use of struct obd_ioctl_data tends to lead to some really opaque, unmaintainable, and nonportable code.

  1. This is a huge kitchen sink structure with 2 obdos, several unions,...
  2. It has several embdedded pointers, some of which are 'inline' and therefore invalid when the data crosses from user to kernel space or back. Others are out of line but lack a __user attribute.
  3. The reader must manually remember that something goes in inlbuf1, something else goes in inlbuf2, and so on.
  4. As Andreas has pointed out, it interleaves fixed width integer types (__u32,...) with API dependent type (char *).
  5. Most users of obd_ioctl_data could easily be rewritten to use a fixed size struct, or a struct with a single variable length array at the end.
  6. Several of the ioctls that use it could just be replaced by reading the right proc files.

Libcfs and LNet have some similar dysfunction.

Tangentially, we need to set some standards about adding new ioctls. For example an ioctl that creates a new inode (like LL_IOC_LMV_SETSTRIPE) must accept a mode_t parameter. Ioctls that accept names must handle them properly. And so on.


Generated at Sat Feb 10 01:47:32 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.