scsi_send_eh_cmnd(9)
π scsi_send_eh_cmnd(9) β Kernel API Manual π
okay bestie, welcome to the kernel API manual, and honestly? this one is kinda niche but lowkey iconic: scsi_send_eh_cmnd. itβs giving βweβre in error recovery and we still have to send a command,β and yes, it slays in its own chaotic way. β¨
πΈ SYNOPSIS πΈ
enum scsi_disposition scsi_send_eh_cmnd (struct scsi_cmnd *scmd ,
unsigned char *cmnd , int cmnd_size , int timeout , unsigned sense_bytes
);
π ARGUMENTS π
scmdβ the SCSI command structure weβre gonna hijack. yes, hijack. dramatic, but accurate. πcmndβ the CDB to send. this is the actual command payload, no cap.cmnd_sizeβ size in bytes ofcmnd. gotta know how big the CDB is, obviously.timeoutβ timeout for this request. give it a time limit or it will absolutely overstay its welcome.sense_bytesβ size of sense data to copy, or0. zero means weβre not copying sense data, simple as that. β¨
π¦ DESCRIPTION π¦
so this function is used to send a SCSI command down to a target device as part of the error recovery process. like, things already went sideways, and now weβre doing recovery-core. itβs not the main character of normal I/O, itβs the main character of βokay bestie, letβs try to fix this.β π
see also scsi_eh_prep_cmnd above. that oneβs the setup bestie; this oneβs the send-it-for-real bestie.
Return value: SUCCESS or FAILED or NEEDS_RETRY β thatβs it, those are the three vibes. success, failure, or βrun it back.β π₯
π SEE ALSO π
Kernel file ./drivers/scsi/scsi_error.c
scsi_schedule_eh(9)scmd_eh_abort_handler(9)scsi_abort_command(9)scsi_eh_reset(9)scsi_eh_scmd_add(9)scsi_timeout(9)scsi_block_when_processing_errors(9)scsi_eh_prt_fail_stats(9)scsi_report_sense(9)scsi_check_sense(9)scsi_eh_completed_normally(9)scsi_eh_done(9)scsi_try_host_reset(9)scsi_try_bus_reset(9)scsi_try_target_reset(9)scsi_try_bus_device_reset(9)scsi_try_to_abort_cmd(9)scsi_eh_prep_cmnd(9)scsi_eh_restore_cmnd(9)scsi_request_sense(9)scsi_eh_finish_cmd(9)scsi_eh_get_sense(9)scsi_eh_tur(9)scsi_eh_test_devices(9)scsi_eh_try_stu(9)scsi_eh_bus_device_reset(9)scsi_eh_target_reset(9)scsi_eh_bus_reset(9)scsi_eh_host_reset(9)scsi_eh_offline_sdevs(9)scsi_noretry_cmd(9)scsi_decide_disposition(9)scsi_eh_lock_door(9)scsi_restart_operations(9)scsi_eh_ready_devs(9)scsi_eh_flush_done_q(9)scsi_unjam_host(9)scsi_error_handler(9)scsi_report_bus_reset(9)scsi_report_device_reset(9)scsi_ioctl_reset(9)scsi_get_sense_info_fld(9)
and thatβs the whole page, bestie. this lil kernel API manual moment is brought to you by ./drivers/scsi, dated October 2026, and yes, scsi_send_eh_cmnd(9) ate. periodt. πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms