Douglas, > This patch refactors scsi_io_completion() by taking the bulk of its > error processing code into three static helper functions, leaving only > the 20 or so code lines that constitute the fastpath. In this process > comments were added and tweaked, plus variables renamed. The last two > patches in this set are optional: adding conditional hints along the > fastpath and converting 3 BUG() calls in scsi_io_completion() to WARNs > as requested by a reviewer. > > There is no attempt in this patchset to change the logic of the > original scsi_io_completion() although the last patch attempts to > continue from awkward situations rather than crashing the calling > thread (and possibly the kernel). Some conditional checks are saved by > reducing the number of redundant tests (e.g. multiple checks that the > 'result' variable is non-zero). Also De Morgan's laws are applied to > some complex conditions to simplify them from the reader's > perspective. The fact remains, this is a very complex function. Applied to 4.19/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering