On Tue, Oct 28, 2014 at 10:05:32AM +0100, Bart Van Assche wrote: > I might be missing some background information here, but it's not clear to > me why the function like scsi_block_when_processing_errors() was introduced > some time ago. What if immediately after error handling has finished a new > request is queued that kicks the error handler again before the caller of > scsi_block_when_processing_errors() has finished the actions that should > not occur concurrently with error handling ? Has it already been considered > to introduce a mutex to serialize error handling and activity that should > not occur concurrently with error handling ? I've not looked into changing the conditions, but your questions are good ones. I'd like to go even further and ask the question of what we try to protect here. For SG_SCSI_RESET the answer is that we want to enforce a single outstanding TMF, as require by old parallel SCSI HBAs, and possible by various drivers. I don't quite understand why we check the EH state before executing other ioctl, though. Even more confusing is that some driver like st.c and sg.c only enforce this on some ioctls. Changing the exclusion rules isn't in the scope of this series, but if you interested in looking into this series I'd be happy if we get the ball on it rolling. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html