On 1/14/16, 9:28 AM, "Christoph Hellwig" <hch@xxxxxx> wrote: >Hi Nic, > >below is my idea how to kill ->shutdown_session. It also happens to remove >the need for sess_kref and simplify a few more things. > >Note that qla2xxx won't compile with this series - it has some very creative >abuse of sess_kfree. > >Quinn, can you take a look at the sess_kfree usage in qla2xxx? It uses it >with it's own release function passed to kref_put, which I can't see how >it's supposed to work. Maybe it should be using a kref in it's private >session structure instead? > QT: Christoph, the code in qla2xxx pertain to the sess_kref free path seems to be duplicate of the TCM. We’ll look into consolidate them in the future depending on how the direction of the code would fall out. However, removing the sess->sess_kref (patch 5) would create a problem for us. It’s currently serve as an atomic operation for prevent a race between new cmd entering a session and session deletion from either user or session deletion trigger by FC protocol. The session free process can take up to "command timeout value"(long time) depending on what might happens on the wire & the back end. The sess_tear_down flag currently serve as a blocking flag to not allow new cmd from entering the session while it’s being torn down. Those 2 elements provides a common spot for all Fabrics drivers to close the window of the mentioned condition. > ��.n��������+%������w��{.n����j�����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��