Re: Issue in RESERVE6 command

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

 



On Sun, 2012-09-30 at 09:37 -0700, ronnie sahlberg wrote:
> Hi List,
> 

Hi Ronnie!

> After writing some initial testcases for RESERVE6 I have found an
> issue with RESERVE6 in LIO.
> I use LIO on Fedora17.
> 
> 
> If an initiator takes out a RESERVE6 on a LUN and then logs out
> without releasing the reservation, then any other existing sessions
> as well as new sessions are failed with RESERVATION CONFLICT.
> 

So it sounds like this is with generate_node_acls=1 (TPG demo mode)
along with default cache_dynamic_acls=0, which means the dynamically
generated se_node_acl memory (that target_core_pr.c logic depends on) is
released when a session is shutdown.

During normal generate_node_acls=0 operation with explicit NodeACLs ->
se_node_acl memory is persistent to the configfs group located at
/sys/kernel/config/target/$TARGETNAME/$TPGT/acls/$INITIATORNAME, so in
the generate_node_acls=1 case we want the reservation logic to reference
existing per initiator IQN se_node_acl memory (not to generate a new
se_node_acl), so you'll want to set cache_dynamic_acls=1 in TPG
demo-mode as well..

> Even if trying to re-login using the same initiator name, the LUN is
> now permanently unavailable.
> 

Btw, a TMR LUN_RESET here will still clear the SPC-2 legacy reservation
for the device.

We've had reports in the past about this specific case, so I'm thinking
it's time that we go ahead and explicitly set cache_dynamic_acls=1
always for the TPG demo mode.

How about the following patch..?

diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index a38a3f8..de9ea32 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -677,6 +677,12 @@ int iscsit_ta_generate_node_acls(
        pr_debug("iSCSI_TPG[%hu] - Generate Initiator Portal Group ACLs: %s\n",
                tpg->tpgt, (a->generate_node_acls) ? "Enabled" : "Disabled");
 
+       if (flag == 1 && a->cache_dynamic_acls == 0) {
+               pr_debug("Explicitly setting cache_dynamic_acls=1 when "
+                       "generate_node_acls=1\n");
+               a->cache_dynamic_acls = 1;
+       }
+
        return 0;
 }
 
@@ -716,6 +722,12 @@ int iscsit_ta_cache_dynamic_acls(
                return -EINVAL;
        }
 
+       if (a->generate_node_acls == 1 && flag == 0) {
+               pr_debug("Skipping cache_dynamic_acls=0 when"
+                       " generate_node_acls=1\n");
+               return 0;
+       }
+
        a->cache_dynamic_acls = flag;
        pr_debug("iSCSI_TPG[%hu] - Cache Dynamic Initiator Portal Group"
                " ACLs %s\n", tpg->tpgt, (a->cache_dynamic_acls) ?


--
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