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

fix compatibility for LL_IOC_MDC_GETINFO

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.14.0
    • Lustre 2.14.0, Lustre 2.12.6
    • None
    • 3
    • 9223372036854775807

    Description

      In master the LL_IOC_MDC_GETINFO definition changed when patch https://review.whamcloud.com/36674 "LU-10934 llite: integrate statx() API with Lustre" landed:

      b2_10$ git grep '#define LL_IOC_MDC_GETINFO'
      master:lustre/include/lustre/lustre_user.h:#define LL_IOC_MDC_GETINFO      _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data *)
      master$ git grep '#define LL_IOC_MDC_GETINFO' 
      lustre/include/uapi/linux/lustre/lustre_user.h:#define LL_IOC_MDC_GETINFO_OLD	_IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data_v1 *)
      lustre/include/uapi/linux/lustre/lustre_user.h:#define LL_IOC_MDC_GETINFO	_IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data)
      

      Which is obviously bad. It's also subtly bad in that the second ioctl depends on how lov_user_mds_data is defined, and it contains a different struct statx with different field names, so while the IOC numbers/structs are ABI compatible, it is not API compatible and applications using this header will break. For added confusion, this changed in 2.12.4 vs. 2.12.3. If we add a newer structure and update the definition as we have then should definition of LL_IOC_MDC_GETINFO change as well?

      The suggestion is that we do:

      #define LL_IOC_MDC_GETINFO_V1 _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data_v1 *)
      #define LL_IOC_MDC_GETINFO_V2 _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data_v2)
      

      in master and b2_12. Then we can use the explicitly versioned constants everywhere for the in-tree code, and declare LL_IOC_MDC_GETINFO in a compatible way, but external applications can select the version that they want explicitly.

      Attachments

        Issue Links

          Activity

            People

              qian_wc Qian Yingjin
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: