scsi_decide_disposition(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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