scsi_sanitiz...quiry_string(9)
π NAME π
okay so bestie, gather round β scsi_sanitize_inquiry_string is literally the glow-up artist for your SCSI strings: it removes non-graphical chars from an INQUIRY result string. that's it, that's the whole job, and it does it flawlessly β¨
π SYNOPSIS π
void scsi_sanitize_inquiry_string (unsigned char *s , int len );
πΈ ARGUMENTS πΈ
sβ the INQUIRY result string that's about to get sanitized π§Ό like it's getting a whole makeoverlenβ the length of the string, aka how much of it we're cleaning up
π DESCRIPTION π
so the SCSI spec is very clear about this, no cap: INQUIRY vendor, product, and revision strings must consist entirely of graphic ASCII characters, padded on the right with spaces. that's the rule. that's the standard. iconic behavior only β¨
but π not all devices obey this rule. some of them are out here sending us the most unhinged bytes imaginable, and honestly? we're not mad, we're just gonna fix it. so we replace non-graphic or non-ASCII characters with spaces. simple as that, slay.
Exception, and this is important bestie: a NUL character is interpreted as a string terminator, so all the following characters are set to spaces. periodt. π«Ά
π¦ SEE ALSO π¦
the kernel file ./drivers/scsi/scsi_scan.c is the main character here, and it brought its whole friend group:
scsi_complete_async_scans(9)scsi_unlock_floptical(9)scsi_alloc_sdev(9)scsi_target_reap_ref_release(9)scsi_alloc_target(9)scsi_target_reap(9)scsi_probe_lun(9)scsi_add_lun(9)scsi_inq_str(9)scsi_probe_and_add_lun(9)scsi_sequential_lun_scan(9)scsi_report_lun_scan(9)scsi_add_device(9)scsi_scan_target(9)scsi_prep_async_scan(9)scsi_finish_async_scan(9)scsi_scan_host(9)scsi_get_pseudo_sdev(9)
ngl if you're deep in ./drivers/scsi reading this, you're lowkey built different. go off π
and that's the whole page, bestie π this one came straight out of ./drivers/scsi β October 2026 energy, kernel API manual vibes, absolutely ate and left no crumbs πβ¨
π¦ 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