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

fix compatibility for LL_IOC_MDC_GETINFO

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

            [LU-13826] fix compatibility for LL_IOC_MDC_GETINFO
            pjones Peter Jones added a comment -

            Landed for 2.14

            pjones Peter Jones added a comment - Landed for 2.14

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40858/
            Subject: LU-13826 utils: fix compatibility for LL_IOC_MDC_GETINFO
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 449c648793d2fc4e8eee3a2dd918379b75cc81e2

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40858/ Subject: LU-13826 utils: fix compatibility for LL_IOC_MDC_GETINFO Project: fs/lustre-release Branch: master Current Patch Set: Commit: 449c648793d2fc4e8eee3a2dd918379b75cc81e2

            Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/40858
            Subject: LU-13826 utils: fix compatibility for LL_IOC_MDC_GETINFO
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 26bf875db85e27cddfadf0c08ec26491166f62d7

            gerrit Gerrit Updater added a comment - Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/40858 Subject: LU-13826 utils: fix compatibility for LL_IOC_MDC_GETINFO Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 26bf875db85e27cddfadf0c08ec26491166f62d7

            Alternately, applications could/should use llapi_get_lum_file_fd(3) or llapi_get_lum_dir_fd(3) (added in 2.12.4 and 2.13) to avoid the low-level details of the ioctl interface.

            adilger Andreas Dilger added a comment - Alternately, applications could/should use llapi_get_lum_file_fd(3) or llapi_get_lum_dir_fd(3) (added in 2.12.4 and 2.13) to avoid the low-level details of the ioctl interface.

            People

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

              Dates

                Created:
                Updated:
                Resolved: