Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327957

Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple LUNs to a domain

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple LUNs to a domain
Date 2016-02-05 18:30 +0100
Message-ID <qYSmJ-3cK-1@gated-at.bofh.it> (permalink)
References <qYOsO-I2-9@gated-at.bofh.it> <qYOCu-Lw-9@gated-at.bofh.it> <qYOCu-Lw-7@gated-at.bofh.it> <qYQXD-2cP-7@gated-at.bofh.it> <qYS3o-36k-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 02/05/2016 11:59 AM, Juergen Gross wrote:
> On 05/02/16 16:50, Boris Ostrovsky wrote:
>>
>> On 02/05/2016 08:21 AM, Juergen Gross wrote:
>>> When adding more than one LUN to a frontend a warning for a failed
>>> assignment is issued in dom0 for each already existing LUN. Avoid this
>>> warning.
>> Aren't you just factoring out the check? The warning is still printed
>> for each scsiback_add_translation_entry() invocation, no?
> I don't call scsiback_add_translation_entry() in the critical case.

Which is scsiback_do_add_lun()? If yes then perhaps you could mention it 
in the commit message since there are few changes that this patch 
provides and it's not clear which is the one that prevents the warning.

>
> @@ -962,33 +973,31 @@ static int scsiback_del_translation_entry(struct
> vscsibk_info *info,
>                          struct ids_tuple *v)
>    {
>        struct v2p_entry *entry;
> -    struct list_head *head = &(info->v2p_entry_lists);
>        unsigned long flags;
>          spin_lock_irqsave(&info->v2p_lock, flags);
>        /* Find out the translation entry specified */
> -    list_for_each_entry(entry, head, l) {
> -        if ((entry->v.chn == v->chn) &&
> -            (entry->v.tgt == v->tgt) &&
> -            (entry->v.lun == v->lun)) {
> -            goto found;
> -        }
> -    }
> -
> -    spin_unlock_irqrestore(&info->v2p_lock, flags);
> -    return 1;
> -
> -found:
> -    /* Delete the translation entry specfied */
> -    __scsiback_del_translation_entry(entry);
> +    entry = scsiback_chk_translation_entry(info, v);
> +    if (entry)
> +        __scsiback_del_translation_entry(entry);
>          spin_unlock_irqrestore(&info->v2p_lock, flags);
> -    return 0;
> +    return entry == NULL;
>> Might be better to return -ENOENT instead of 1 above and -EEXISTS if
>> entry!=NULL, given that this returns an int.
> I just didn't want to change more than necessary. In case it is
> okay to do some cleanup as well I'd rather change the return type
> to "bool".

I don't think using error code will require changing anything except the 
last line above (which is already a change anyway)

But using a bool is OK too.

-boris

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] xen/scsiback: correct two issues Juergen Gross <jgross@suse.com> - 2016-02-05 14:20 +0100
  [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-05 14:30 +0100
    Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 17:00 +0100
      Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 17:00 +0100
      Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-05 18:10 +0100
        Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 18:30 +0100
          Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-08 13:30 +0100
  [PATCH 1/2] xen/scsiback: correct frontend counting Juergen Gross <jgross@suse.com> - 2016-02-05 14:30 +0100
    Re: [PATCH 1/2] xen/scsiback: correct frontend counting Juergen Gross <jgross@suse.com> - 2016-02-05 16:50 +0100
    Re: [PATCH 1/2] xen/scsiback: correct frontend counting Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 16:50 +0100

csiph-web