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

deprecate struct obd_ioctl_data

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.6.0
    • 3
    • 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.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              jhammond John Hammond
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: