Yangkook Kim wrote:
> This patch tries to fix the lack of outputting logs when
> iscsid_req_by_rec is used.
> 
> When using iscsid_req_by_rec, the current codes does not tell you whether you
> are successfully logged in or hitting some errors because you cannot
> get into the
> loop of list_for_each_entry_safe() in iscsid_login_reqs_wait(). I
> modify some codes
> so that iscsid_req_by_rec will output logs.

Thanks for the patch! Some questions.

Are you hitting the non async code path? Did you hit the 
iscsid_req_by_rec call? How many targets or portals were you logging into?

Question about the patch below.

> 
> --- a/usr/iscsiadm.c    2009-11-12 06:22:10.000000000 +0900
> +++ b/usr/iscsiadm.c    2009-11-12 06:23:01.000000000 +0900
> @@ -597,29 +597,31 @@
>                         INIT_LIST_HEAD(&async_req->list);
>         }
> 
> -       if (async_req)
> -               rc = iscsid_req_by_rec_async(MGMT_IPC_SESSION_LOGIN,
> -                                            rec, &fd);
> -       else
> -               rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
> -       /* we raced with another app or instance of iscsiadm */
> -       if (rc == MGMT_IPC_ERR_EXISTS) {
> -               if (async_req)
> -                       free(async_req);
> -               return 0;
> -       } else if (rc) {
> -               iscsid_handle_error(rc);


If iscsid_req_by_rec fails, then won't we log an error here?



> -               if (async_req)
> -                       free(async_req);
> -               return ENOTCONN;
> -       }
> -
>         if (async_req) {
> +                rc = iscsid_req_by_rec_async(MGMT_IPC_SESSION_LOGIN,
> +                                            rec, &fd);
> +               if (rc == MGMT_IPC_ERR_EXISTS) {
> +                       if (async_req)
> +                               free(async_req);
> +                               return 0;
> +               } else if (rc) {
> +                       iscsid_handle_error(rc);
> +                       if (async_req)
> +                               free(async_req);
> +                               return ENOTCONN;
> +               }
>                 list_add_tail(&async_req->list, list);
>                 async_req->fd = fd;
>                 async_req->data = rec;
> +               return 0;
> +       } else {
> +               rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
> +               if (rc) {
> +                       iscsid_handle_error(rc);
> +                       return ENOTCONN;
> +               } else
> +                       return rc;


Does this do almost the same thing? It looks like the only change is 
that if we get MGMT_IPC_ERR_EXISTS then iscsid_req_by_rec will now print 
out an error message. Did I miss something?

Your patch actually might be clearer though.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to