[LU-8329] All structures referenced from IOCTLs need to be stable/checked for not changing Created: 26/Jun/16  Updated: 29/Jan/22

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

Type: Improvement Priority: Major
Reporter: Oleg Drokin Assignee: Nathaniel Clark
Resolution: Unresolved Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-8330 Incorrect ioctl definitions declaring... In Progress
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Lnux ioctl macoses _IOR _IOW are taking a struvture argument.
That argument is then sized to determine the actual ioctl number.
Should the structure change, actual ioctl number changes too without any visibility. If you only test with tools built against the same tree, you would never notice that much like what happens with same-version network testing.

For network structures we have wirecheck/wiretest, I guess we need something similar for IOCTLs.
The complication here is because structures used are actually somewhat different on different architectures, we might want to be a bit more smart about it,
or we might need to have a per-architecture check.
Alternatively we can just record the actual generated ioctl numbers and ensure thoe never change - then we'll catch other changes too, not just in structure sizes but when a type of the ioctl changes for example.

Currently these include:
From lustre_ioctl.h
struct if_quotactl
struct obd_ioctl_data
mntopt_t

From lustre_user.h:
struct obd_statfs
struct lu_fid
struct ll_futimes_3
struct hsm_user_state
struct hsm_state_set
struct hsm_state_set
struct lustre_kernelcomm
struct hsm_user_request
struct lustre_swap_layouts
struct hsm_current_action
struct lmv_user_md
struct hsm_user_import
struct getparent
struct lu_ladvise << This one is going to change to llapi_something with an upcoming patch.



 Comments   
Comment by Gerrit Updater [ 13/Mar/18 ]

Nathaniel Clark (nathaniel.l.clark@intel.com) uploaded a new patch: https://review.whamcloud.com/31637
Subject: LU-8329 wiretest: Add ioctl struct definitions
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 214802bc804cbf4f85e7a48c834572cad47f58da

Generated at Sat Feb 10 02:16:35 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.