On Wed, 2016-01-13 at 09:34 +0100, Christoph Hellwig wrote: > On Tue, Jan 12, 2016 at 08:32:48AM -0800, Bart Van Assche wrote: > > Hello Christoph, > > > > How about eliminating the TARGET_SCF_ACK_KREF flag ? If a command would > > only be freed upon the last target_put_sess_cmd() call then I think that > > the check_stop_free() callback wouldn't have to call target_put_sess_cmd() > > and hence that the TARGET_SCF_ACK_KREF flag could be removed. > > Yes, that's what I meant. I think it shoul be generally feasibly, but > would require a careful audit of the !TARGET_SCF_ACK_KREF code path > first. No, no, no. The whole point of TARGET_SCF_ACK_KREF was so the backend driver completion path calling check_stop_free() for one ->cmd_kref, and the fabric driver patch calling target_put_sess_cmd() for the second ->cmd_kref both complete before attempting to free se_cmd memory. The hw fabric drivers that have a hard requirement for TARGET_SCF_ACK_KREF already use it, but it wouldn't hurt to convert the remaining ones to use it. -- 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