Re: -EAGAIN and -ENOMEM from ->bi_end_io, was Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread Christoph Hellwig
On Mon, Mar 07, 2016 at 02:39:29PM -0800, Nicholas A. Bellinger wrote: > > I explicitly wrote "as-is". We need a way to opt into this behavior, > > and we also somehow need to communicate the timeout. > > What did you have in mind..? You need an interface to tell the driver that it can return a

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread Nicholas A. Bellinger
On Mon, 2016-03-07 at 11:40 -0500, James Bottomley wrote: > On Mon, 2016-03-07 at 00:03 -0800, Nicholas A. Bellinger wrote: > > On Mon, 2016-03-07 at 08:55 +0100, Christoph Hellwig wrote: > > > On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger > > > > So as-is this might be well int

Re: -EAGAIN and -ENOMEM from ->bi_end_io, was Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread Nicholas A. Bellinger
On Mon, 2016-03-07 at 17:18 +0100, Christoph Hellwig wrote: > On Mon, Mar 07, 2016 at 12:03:56AM -0800, Nicholas A. Bellinger wrote: > > > On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger wrote: > > > > The intended use is for any make_request_fn() based driver that invokes > > > > b

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread James Bottomley
On Mon, 2016-03-07 at 00:03 -0800, Nicholas A. Bellinger wrote: > On Mon, 2016-03-07 at 08:55 +0100, Christoph Hellwig wrote: > > On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger > > So as-is this might be well intended but either useless or broken. > > -- > > No, it useful for ho

-EAGAIN and -ENOMEM from ->bi_end_io, was Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread Christoph Hellwig
On Mon, Mar 07, 2016 at 12:03:56AM -0800, Nicholas A. Bellinger wrote: > > On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger wrote: > > > The intended use is for any make_request_fn() based driver that invokes > > > bio_endio() completion directly, and sets bi_error != 0 to signal > >

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-07 Thread Nicholas A. Bellinger
On Mon, 2016-03-07 at 08:55 +0100, Christoph Hellwig wrote: > On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger wrote: > > The intended use is for any make_request_fn() based driver that invokes > > bio_endio() completion directly, and sets bi_error != 0 to signal > > non GOOD status

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-06 Thread Christoph Hellwig
On Sun, Mar 06, 2016 at 01:55:15PM -0800, Nicholas A. Bellinger wrote: > The intended use is for any make_request_fn() based driver that invokes > bio_endio() completion directly, and sets bi_error != 0 to signal > non GOOD status to target/iblock. But -EAGAIN and -ENOMEM are not valid drivers for

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-06 Thread Nicholas A. Bellinger
On Sat, 2016-03-05 at 22:19 -0800, Christoph Hellwig wrote: > On Sat, Mar 05, 2016 at 02:51:27PM -0800, Nicholas A. Bellinger wrote: > > > I think you;d be much better off killing ib_bio_err_cnt and having > > > an ib_error that gets set to the last / most server error. > > > > That's what I was o

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-05 Thread Christoph Hellwig
On Sat, Mar 05, 2016 at 02:51:27PM -0800, Nicholas A. Bellinger wrote: > > I think you;d be much better off killing ib_bio_err_cnt and having > > an ib_error that gets set to the last / most server error. > > That's what I was originally thinking too.. > > However, that means if one bio completed

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-05 Thread Nicholas A. Bellinger
On Sat, 2016-03-05 at 22:01 +0100, Christoph Hellwig wrote: > > - if (atomic_read(&ibr->ib_bio_err_cnt)) > > - status = SAM_STAT_CHECK_CONDITION; > > - else > > + /* > > +* Propigate use these two bio completion values from raw block > > +* drivers to signal up BUSY and TASK

Re: [PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-05 Thread Christoph Hellwig
> - if (atomic_read(&ibr->ib_bio_err_cnt)) > - status = SAM_STAT_CHECK_CONDITION; > - else > + /* > + * Propigate use these two bio completion values from raw block > + * drivers to signal up BUSY and TASK_SET_FULL status to the > + * host side initiator. The

[PATCH-v2 2/2] target/iblock: Use -EAGAIN/-ENOMEM to propigate SAM BUSY/TASK_SET_FULL

2016-03-04 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch updates target/iblock backend driver code to check for bio completion status of -EAGAIN / -ENOMEM provided by raw block drivers and scsi devices, in order to generate the following SCSI status to initiators: - SAM_STAT_BUSY - SAM_STAT_TASK_SET_FULL Note t