Re: [PATCH] qla_target: Check refcount in find_sess_by_*

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

> Mmmmm, I'd still like to try to avoid (another) atomic op in the fast
> path w/ hardware_lock held if at all possible..

atomic_read() is not an atomic op.

However this patch is not right, see below.

> Also thinking more about the case in your comment, I'm starting to
> wonder if tcm_qla2xxx_free_session() should be obtaining hardware_lock +
> clearing the s_id and loop_id lookup entries earlier than currently
> done..
> That is, target_wait_for_sess_cmds() is called before clearing the
> nodeacl pointers from s_id + loop_id in tcm_qla2xxx_free_session(),
> which means that we still perform se_node_acl lookups in the case where
> the individual tcm_qla2xxx endpoint was not also being shutdown as
> well..
> So that said, I think your work-around is OK to address the current BUG,
> but the s_id + loop_id clearing order in tcm_qla2xxx_free_session()
> would be having an effect here as well..

Yes, in fact we need to clear the session from all lookup tables
even earlier than ->free_session.  We need to make sure that as
soon as target_release_session() is called, that session will no
longer be used for any new commands.

So qla_tgt_unreg_sess() needs to clear the session from the
"by loop_id" table as well as the "by fc_id" table.

 - R.
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

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

  Powered by Linux