Re: [PATCH] scsi: Let scsi_execute_cmd() mark args->sshdr as invalid

From: Martin K. Petersen
Date: Mon May 22 2023 - 18:26:30 EST



Juergen,

> sshdr is output only data, so setting it before returning seems to be a
> sensible thing to do.

I would love to rototill all this and make sense make sense (!) but
that's a major undertaking. Until then we need to validate that callers
check the return value before they start poking at the sense data. Even
if things were zeroed ahead of time, other things could have gone wrong
that would affect how an error condition should be handled.

> Letting the callers do that is kind of a layering violation IMHO,

scsi_execute_cmd() is one big layering violation, I'm afraid.

--
Martin K. Petersen Oracle Linux Engineering