scsi_decide_disposition(9)
π scsi_decide_disposition β a Kernel API Manual moment
okay bestie, welcome to scsi_decide_disposition(9) from the Kernel API Manual β¨ this is the little function that looks at a SCSI command coming back from the LLD and decides what mood we're in about it π
πΈ NAME πΈ
scsi_decide_disposition β literally just "disposition a cmd on return from LLD." that's the whole vibe check. it looks at a cmd, and it decides. iconic behavior tbh π
β¨ SYNOPSIS β¨
enum scsi_disposition scsi_decide_disposition (struct scsi_cmnd *scmd );
like yes, it returns an enum scsi_disposition, and yes it takes exactly one pointer to a struct scsi_cmnd π¦ no cap.
π«Ά ARGUMENTS π«Ά
scmdβ the SCSI cmd we're examining. that's it. that's the whole argument list. she's low-maintenance π
π NOTES π
okay so this part is important, pay attention bestie:
this is only called when we are examining the status after sending out the actual data command. any commands that are queued for error recovery (e.g. test_unit_ready) do not come through here. like, not even a little bit. they take a different door π
when this routine returns failed, it means the error handler thread is woken π so like, we are summoning her. do with that information what you will.
in cases where the error code indicates an error that doesn't require the error handler read (i.e. we don't need to abort/reset), this function should return SUCCESS. yes, SUCCESS. even though things went wrong-ish. that's the bit that trips people up, ngl β it's giving counterintuitive main character energy π
fr fr: "failed" here = wake the error handler thread. no abort, no reset needed = return SUCCESS. don't get it twisted π«Ά
π SEE ALSO π
kernel file ./drivers/scsi/scsi_error.c π« and a whole friend group of functions, all of them, in order, no skipping, because we love a complete link section:
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_send_eh_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_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 one lives in ./drivers/scsi, it's dated October 2026, and it's filed under Kernel API Manual β go forth and disposition those cmds πβ¨
π¦ 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