diff mbox

[RFC,24/34] iscsi-target: validate conn operational parameters

Message ID 940698fdb1ca47d8c392fa687f971842d215d083.1455467089.git.varun@chelsio.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Varun Prakash Feb. 14, 2016, 5:45 p.m. UTC
call validate params function if registered
by transport driver before starting negotiation,
so that transport driver can validate and update
the value of parameters.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/target/iscsi/iscsi_target_login.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Christoph Hellwig March 1, 2016, 3:03 p.m. UTC | #1
On Sun, Feb 14, 2016 at 11:15:31PM +0530, Varun Prakash wrote:
> call validate params function if registered
> by transport driver before starting negotiation,
> so that transport driver can validate and update
> the value of parameters.

Should go together with the introduction of the method.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Varun Prakash March 2, 2016, 12:18 p.m. UTC | #2
On Tue, Mar 01, 2016 at 08:33:18PM +0530, Christoph Hellwig wrote:
> On Sun, Feb 14, 2016 at 11:15:31PM +0530, Varun Prakash wrote:
> > call validate params function if registered
> > by transport driver before starting negotiation,
> > so that transport driver can validate and update
> > the value of parameters.
> 
> Should go together with the introduction of the method.

Ok, I will update it in v2 series. 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index 616ec9e..83c3643 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -1375,6 +1375,16 @@  static int __iscsi_target_login_thread(struct iscsi_np *np)
 			goto old_sess_out;
 	}
 
+	if (conn->conn_transport->iscsit_validate_params) {
+		ret = conn->conn_transport->iscsit_validate_params(conn);
+		if (ret < 0) {
+			if (zero_tsih)
+				goto new_sess_out;
+			else
+				goto old_sess_out;
+		}
+	}
+
 	ret = iscsi_target_start_negotiation(login, conn);
 	if (ret < 0)
 		goto new_sess_out;