On Fri, Apr 10, 2020 at 01:53:49AM +0900, Johannes Thumshirn wrote: > + if (req_op(rq) == REQ_OP_ZONE_APPEND) { > + ret = sd_zbc_prepare_zone_append(cmd, &lba, nr_blocks); > + if (ret) { > + scsi_free_sgtables(cmd); > + return ret; > + } > + } So actually. I've been trying to understand the lifetime of the sgtables. Shouldn't we free them in the midayer ->init_command returned BLK_STS_*RESOURCE instead? It seems like this just catches one particular error instead of the whole category? The end of scsi_queue_rq seem like a particular good place, as that also releases the resources for the "hard" errors.