Page MenuHomeFreeBSD

ctl: Avoid an upcast for calling ctl_scsi_path_string
ClosedPublic

Authored by jhb on Apr 9 2024, 11:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 19, 9:18 AM
Unknown Object (File)
Tue, May 19, 2:19 AM
Unknown Object (File)
Sun, May 17, 7:23 PM
Unknown Object (File)
Sun, May 17, 4:52 AM
Unknown Object (File)
Sat, May 16, 10:44 PM
Unknown Object (File)
Sat, May 16, 6:16 PM
Unknown Object (File)
Wed, May 13, 6:34 PM
Unknown Object (File)
Mon, May 11, 11:25 PM
Subscribers
None

Details

Summary

Change the first argument of ctl_scsi_path_string to be the embedded
header structure instead of the union. Currently union ctl_io and
struct ctl_scsiio have the same alignment, but this changes on i386 if
a new union member is added that contains a uint64_t member (such as
an embedded struct nvme_command for NVMeoF). In that case, union
ctl_io requires stronger alignment, so the upcast from struct
ctl_scsiio to union ctl_io in ctl_scsi_sense_sbuf raises an increasing
alignment warning on i386.

Avoid the warning by passing struct ctl_io_hdr as the first argument
to ctl_scsi_path_string instead.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Apr 9 2024, 11:04 PM
This revision is now accepted and ready to land.Apr 13 2024, 8:35 PM