[LU-13826] fix compatibility for LL_IOC_MDC_GETINFO Created: 28/Jul/20 Updated: 09/Dec/20 Resolved: 09/Dec/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.14.0, Lustre 2.12.6 |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Andreas Dilger | Assignee: | Qian Yingjin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
In master the LL_IOC_MDC_GETINFO definition changed when patch https://review.whamcloud.com/36674 " 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. |
| Comments |
| Comment by Andreas Dilger [ 28/Jul/20 ] |
|
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. |
| Comment by Gerrit Updater [ 04/Dec/20 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/40858 |
| Comment by Gerrit Updater [ 09/Dec/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40858/ |
| Comment by Peter Jones [ 09/Dec/20 ] |
|
Landed for 2.14 |