sd_eh_action(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sd_eh_action(9) β€” like, the error handling callback, bestie

Ok so real talk, this one's from the Kernel API Manual (sd_eh_action, section 9) and it's genuinely one of those tiny-but-iconic functions. Let's get into it πŸŽ€


✨ NAME ✨

sd_eh_action β€” the error handling callback. That's it, that's the whole vibe. She's the one who picks up the phone when a command fails 😭


🌸 SYNOPSIS 🌸

int sd_eh_action (struct scsi_cmnd *scmd , int eh_disp );

Look at her. Two args, one int return. Clean. Minimalist. Main character energy fr fr πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • scmd β€” the sd-issued command that has failed. Like, the thing that went πŸ’€
  • eh_disp β€” the recovery disposition that the midlayer suggested. Basically the midlayer's hot take on how to recover 🌈

πŸ’– DESCRIPTION πŸ’–

So here's the situation, bestie. This function gets called by the SCSI midlayer upon completion of an error test command (currently TEST UNIT READY β€” ok noted, that's the one πŸ‘€). The result of sending the eh command gets passed in through eh_disp.

And what are we even looking for? We're hunting for devices that fail medium access commands but are totally OK with non-access commands like test unit ready. Because if that happens, the recovery wrongly sees the device as having a successful recovery β€” like, no cap, it looks like a slay but it's actually a lie πŸ™ˆ

So yeah, she's the vibe check for fake-successful recoveries. Periodt. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/scsi/sd.c plus the whole friend group:


And that's the whole page, gorgeous 🫢 This lil legend lives in ./drivers/scsi and the docs are dated October 2026 β€” so mark your calendars, mwah πŸ’‹β­

πŸ“¦ where this page comes from