extra kref put after transport_lookup_cmd_lun() failure?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks to me like there's an extra se_cmd kref "put" 
(target_put_sess_cmd()) after transport_lookup_cmd_lun() fails and
sends check condition via the fabric driver. With the extra call
to target_put_sess_cmd(), the given se_cmd is "released" prior
to my fabric driver completing the check condition initiated from 
the prev line. When I make the following change, the se_cmd is 
not released until the fabric driver completes the check 
condition and calls transport_generic_free_cmd() -- which is 
what I expect.


--- a/drivers/target/target_core_transport.c    2014-02-13 14:00:14.000000000 -0800
+++ b/drivers/target/target_core_transport.c    2014-03-17 15:50:50.235119894 -0700
@@ -1336,7 +1336,6 @@ int target_submit_cmd_map_sgls(struct se
        rc = transport_lookup_cmd_lun(se_cmd, unpacked_lun);
        if (rc) {
                transport_send_check_condition_and_sense(se_cmd, rc, 0);
-               target_put_sess_cmd(se_sess, se_cmd);
                return 0;
        }

Having said that, it looks like there was a commit that, among other 
changes, specifically added the call to target_put_sess_cmd(), so I'm 
wondering if my understanding is correct. Here is the commit that adds
the call to target_put_sess_cmd(), with the relevant comment snippet:

commit 735703cac08f34a197e1c6331ca9adc8a52d6046
Author: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Date:   Fri Jan 20 19:02:56 2012 -0800

    target: Fix target_submit_cmd() exception handling
<SNIP>
    It also makes transport_lookup_cmd_lun() failures in
    target_submit_cmd() use transport_send_check_condition_and_sense() and
    target_put_sess_cmd() directly to avoid se_cmd->se_dev reference in
    transport_generic_request_failure() handling.
<SNIP>

Thanks,
Alex
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux