2012-10-02 19:41:44

by Vivek Goyal

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

On Mon, Sep 24, 2012 at 03:34:51PM -0700, Kent Overstreet wrote:
> Random cleanup - this code was duplicated and it's not really specific
> to md.
>
> Also added the ability to return the actual error code.

Who is going to make use of actual error code and why checking
BIO_UPTODATE is not sufficient (as existing code is doing)?

Thanks
Vivek


2012-10-02 20:11:11

by Kent Overstreet

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

On Tue, Oct 02, 2012 at 03:41:32PM -0400, Vivek Goyal wrote:
> On Mon, Sep 24, 2012 at 03:34:51PM -0700, Kent Overstreet wrote:
> > Random cleanup - this code was duplicated and it's not really specific
> > to md.
> >
> > Also added the ability to return the actual error code.
>
> Who is going to make use of actual error code and why checking
> BIO_UPTODATE is not sufficient (as existing code is doing)?

Some things do, though it's not common and I forget where I saw it -
checking for -ENOTSUPPORTED vs. other stuff

2012-10-02 20:16:40

by Vivek Goyal

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

On Tue, Oct 02, 2012 at 01:11:05PM -0700, Kent Overstreet wrote:
> On Tue, Oct 02, 2012 at 03:41:32PM -0400, Vivek Goyal wrote:
> > On Mon, Sep 24, 2012 at 03:34:51PM -0700, Kent Overstreet wrote:
> > > Random cleanup - this code was duplicated and it's not really specific
> > > to md.
> > >
> > > Also added the ability to return the actual error code.
> >
> > Who is going to make use of actual error code and why checking
> > BIO_UPTODATE is not sufficient (as existing code is doing)?
>
> Some things do, though it's not common and I forget where I saw it -
> checking for -ENOTSUPPORTED vs. other stuff

May be we can introduce "submit_bio_ret" stuff when we find the actual
user in the series. Justifying code change becomes easier.

Thanks
Vivek

2012-10-02 20:22:32

by Kent Overstreet

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

On Tue, Oct 02, 2012 at 04:16:30PM -0400, Vivek Goyal wrote:
> On Tue, Oct 02, 2012 at 01:11:05PM -0700, Kent Overstreet wrote:
> > On Tue, Oct 02, 2012 at 03:41:32PM -0400, Vivek Goyal wrote:
> > > On Mon, Sep 24, 2012 at 03:34:51PM -0700, Kent Overstreet wrote:
> > > > Random cleanup - this code was duplicated and it's not really specific
> > > > to md.
> > > >
> > > > Also added the ability to return the actual error code.
> > >
> > > Who is going to make use of actual error code and why checking
> > > BIO_UPTODATE is not sufficient (as existing code is doing)?
> >
> > Some things do, though it's not common and I forget where I saw it -
> > checking for -ENOTSUPPORTED vs. other stuff
>
> May be we can introduce "submit_bio_ret" stuff when we find the actual
> user in the series. Justifying code change becomes easier.

Eh, IMO as generic code it's just better/more sensible that way;
bio_endio() does pass an actual error code, so the sync version should
pass it up too. Otherwise it's a needless inconsistency.

Honestly I would prefer sticking an error field in struct bio. That'd be
useful for other things, too.

2012-10-04 06:07:27

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [dm-devel] [PATCH v3 11/26] block: Add submit_bio_wait(), remove from md

On 10/02/2012 10:11 PM, Kent Overstreet wrote:
> On Tue, Oct 02, 2012 at 03:41:32PM -0400, Vivek Goyal wrote:
>> On Mon, Sep 24, 2012 at 03:34:51PM -0700, Kent Overstreet wrote:
>>> Random cleanup - this code was duplicated and it's not really specific
>>> to md.
>>>
>>> Also added the ability to return the actual error code.
>>
>> Who is going to make use of actual error code and why checking
>> BIO_UPTODATE is not sufficient (as existing code is doing)?
>
> Some things do, though it's not common and I forget where I saw it -
> checking for -ENOTSUPPORTED vs. other stuff
>
There are also additional error codes like -ENOLINK when the nexus
is dropped. Quite useful in multipathed or clustered environs.

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
[email protected] +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: J. Hawn, J. Guild, F. Imend?rffer, HRB 16746 (AG N?rnberg)