On 31/07/2013 18:58, Michael Christie wrote:
On Jul 31, 2013, at 5:35 AM, Or Gerlitz <[email protected]> wrote:

To run discovery over iSER we need to advertize the CAP_TEXT_NEGO capability
towards user space. Also need to make sure the login RX buffer is posted when
SendTargets TEXT PDUs are sent. For that end, we use a setting of the
ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is discovery
session.

Signed-off-by: Or Gerlitz <[email protected]>
---

changes from V0:

- applied feedback from Mike
-- moved the iscsi_set_param part to libiscsi.c
-- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible

To apply this patch need to pick these two patches

[PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session and 
connection in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&w=2

[PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection 
in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&q=raw
Patch looks ok to me. Did you intend for me to pass this along to 
linux-scsi/James or did you mean to cc that list or were you going to resend to 
that list? Let me know what you prefer. It does not matter to me.


Mike,


Just before hitting the send button to James, I noticed that the patch introduced this build warning

CC [M]  drivers/scsi/libiscsi.o
drivers/scsi/libiscsi.c: In function ?iscsi_set_param?:
drivers/scsi/libiscsi.c:3268: warning: format %u expects type unsigned int *, but argument 3 has type uint8_t *

So I changed the code to do the reading in two stages, hope this is OK with you

I also tested against V2 of the pre-patches this patch require


diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b3ff1bb..f17a692 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -3170,6 +3170,7 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
 {
        struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_session *session = conn->session;
+       int val;

        switch(param) {
        case ISCSI_PARAM_FAST_ABORT:
@@ -3265,7 +3266,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
return iscsi_switch_str_param(&session->discovery_parent_type,
                                              buf);
        case ISCSI_PARAM_DISCOVERY_SESS:
-               sscanf(buf, "%u", &session->discovery_sess);
+               sscanf(buf, "%d", &val);
+               session->discovery_sess = !!val;
                break;
        default:
                return -ENOSYS;

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to