All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Juergen Gross <jgross@suse.com>, Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
	David Vrabel <david.vrabel@citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xen/xen-scsiback: Need go to fail after xenbus_dev_error()
Date: Mon, 29 Sep 2014 17:59:10 +0800	[thread overview]
Message-ID: <54292D6E.4060903__47375.55641118$1411984525$gmane$org@gmail.com> (raw)
In-Reply-To: <542927C3.8010204@suse.com>

On 9/29/14 17:34, Juergen Gross wrote:
> On 09/29/2014 11:31 AM, Chen Gang wrote:
>> On 9/29/14 16:41, Jan Beulich wrote:
>>>>>> On 29.09.14 at 06:32, <JGross@suse.com> wrote:
>>>> On 09/26/2014 06:38 PM, Chen Gang wrote:
>>>>> When failure occurs, after xenbus_dev_error(), need go to fail to let
>>>>> upper caller know about it.
>>>>>
>>>>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>>>>> ---
>>>>>    drivers/xen/xen-scsiback.c | 4 +++-
>>>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
>>>>> index 847bc9c..3e430e1 100644
>>>>> --- a/drivers/xen/xen-scsiback.c
>>>>> +++ b/drivers/xen/xen-scsiback.c
>>>>> @@ -1222,8 +1222,10 @@ static int scsiback_probe(struct xenbus_device *dev,
>>>>>
>>>>>        err = xenbus_printf(XBT_NIL, dev->nodename, "feature-sg-grant", "%u",
>>>>>                    SG_ALL);
>>>>> -    if (err)
>>>>> +    if (err) {
>>>>>            xenbus_dev_error(dev, err, "writing feature-sg-grant");
>>>>> +        goto fail;
>>>>> +    }
>>>>>
>>>>>        xenbus_switch_state(dev, XenbusStateInitWait);
>>>>>        return 0;
>>>>>
>>>>
>>>> Hmm, not testing for failure was on purpose. Advertising this feature
>>>> is just for tuning purposes, not mandatory.
>>>>
>>>> OTOH it would really be a strange error if this xenbus_printf() fails
>>>> but all other operations are working, and signaling an error at the
>>>> time when it first shows up is a good thing. So:
>>>
>>> I disagree - failure to announce optional features should not lead to
>>> general failure. And this should be consistent across drivers; for
>>> existing examples see xen_blkbk_flush_diskcache() and
>>> xen_blkbk_discard().
>>>
>>
>> During scsiback_probe(), can we sure that "feature-sg-grant" is optional
>> feature? For me, only according to its name, I guess not: it is about
>> security which is always necessary in kernel (although SG_ALL).
> 
> It is optional. Otherwise the interface would be broken, as I've added
> this feature recently and "old" clients (pre 3.18) don't know about it.
> 
> The feature is NOT about security, but about capability to support
> larger SCSI requests than the old interface did.
> 

OK, thanks. All of you said sounds reasonable to me: "it is optional, need
print related warning and continue".

If no any additional reply within 2 days, I shall send patch v2 for it:

  "use dev_warn() instead of xenbus_dev_error() and remove 'fail' code block"


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

  reply	other threads:[~2014-09-29  9:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 16:38 [PATCH] xen/xen-scsiback: Need go to fail after xenbus_dev_error() Chen Gang
2014-09-29  4:32 ` Juergen Gross
2014-09-29  4:32 ` [Xen-devel] " Juergen Gross
2014-09-29  8:41   ` Jan Beulich
2014-09-29  9:31     ` Chen Gang
2014-09-29  9:34       ` Juergen Gross
2014-09-29  9:34       ` [Xen-devel] " Juergen Gross
2014-09-29  9:59         ` Chen Gang [this message]
2014-09-29  9:59         ` Chen Gang
2014-09-29 13:57           ` David Vrabel
2014-09-29 13:57           ` [Xen-devel] " David Vrabel
2014-09-30  6:32             ` Chen Gang
2014-09-30  6:59               ` Juergen Gross
2014-09-30  6:59               ` [Xen-devel] " Juergen Gross
2014-09-30  7:50                 ` Chen Gang
2014-09-30  7:50                 ` [Xen-devel] " Chen Gang
2014-09-30 10:23                   ` Chen Gang
2014-09-30 10:23                   ` Chen Gang
2014-09-30  6:32             ` Chen Gang
2014-09-29  9:31     ` Chen Gang
2014-09-29  8:41   ` Jan Beulich
2014-09-26 16:38 Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='54292D6E.4060903__47375.55641118$1411984525$gmane$org@gmail.com' \
    --to=gang.chen.5i5j@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.