Bug 30416 - unable to find member 'request' for struct scsi_cmnd
Summary: unable to find member 'request' for struct scsi_cmnd
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-03 09:07 UTC by Martin Cermak
Modified: 2023-10-03 19:18 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Cermak 2023-05-03 09:07:22 UTC
Following is one of the problems CI gating shows for systemtap-4.9-1.fc39:

Testcase:  /tests/Regression/semantic-errors-bz1062076
Output:

:: [ 22:01:51 ] :: [  BEGIN   ] :: Running 'stap -P -vp4 script.stp'
Pass 1: parsed user script and 495 library scripts using 140024virt/111044res/15744shr/94676data kb, in 140usr/20sys/158real ms.
semantic error: unable to find member 'request' for struct scsi_cmnd (alternatives: result, retries, sdb, rcu, cmnd, eh_entry, flags, state, device, allowed, cmd_len, extra_len, prot_op, prot_sdb, sense_len, eh_eflags, resid_len, underflow, abort_work, prot_type, submitter, prot_flags, sense_buffer, transfersize, budget_token, host_scribble, sc_data_direction, jiffies_at_alloc): operator '->' at /usr/share/systemtap/tapset/linux/scsi.stp:189:66
        source: 	return timer_pending(&@cast(cmd, "scsi_cmnd", "kernel:scsi_mod")->request->q->timeout)
                	                                                                ^

Probable cause is the following kernel commit:

$ git show 2266a2def97ce11ec979b6c58a1b637a16eca7dd
commit 2266a2def97ce11ec979b6c58a1b637a16eca7dd
Author: Bart Van Assche <bvanassche@acm.org>
Date:   Mon Aug 9 16:03:55 2021 -0700

    scsi: core: Remove the request member from struct scsi_cmnd
    
    Since all scsi_cmnd.request users are gone, remove the request pointer
    from struct scsi_cmnd.
    
    Link: https://lore.kernel.org/r/20210809230355.8186-53-bvanassche@acm.org
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Hannes Reinecke <hare@suse.de>
    Cc: Ming Lei <ming.lei@redhat.com>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Comment 1 William Cohen 2023-10-03 19:18:46 UTC
This has been addressed by systemtap git commit e94d0e3deb34e684ca83573d7d2bc9b382db2427

    Have the scsi tapset support newer kernels struct scsi_cmnd
    
    The linux kernel commit 2266a2def97ce11ec removed the request field
    from struct scsi_cmnd.  The scsi tapset needed to test whether the
    request field is available.  If request field is not available, use
    the linux kernels helper function scsi_cmd_to_rq to get a value for
    request.