Created
January 14, 2013 06:49
-
-
Save ymmt2005/4528252 to your computer and use it in GitHub Desktop.
A patch for Linux LIO iSCSI target to restrict the maximum number of sessions (not connections).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- linux-3.2.0/drivers/target/iscsi/iscsi_target_login.c 2012-06-07 05:37:34.000000000 +0000 | |
+++ iscsi_target_login.c 2012-06-07 05:34:22.866487169 +0000 | |
@@ -1107,6 +1107,20 @@ | |
goto new_sess_out; | |
} | |
+ /* Cybozu */ | |
+ if (zero_tsih) { | |
+ int error = 0; | |
+ spin_lock_bh(&np->np_thread_lock); | |
+ if( tpg->nsessions > 0 ) | |
+ error = 1; | |
+ spin_unlock_bh(&np->np_thread_lock); | |
+ | |
+ if( error ) { | |
+ pr_err("Detected possible split brain\n"); | |
+ goto new_sess_out; | |
+ } | |
+ } | |
+ | |
if (zero_tsih) { | |
if (iscsi_login_zero_tsih_s2(conn) < 0) { | |
iscsi_target_nego_release(login, conn); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment