All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Gordon Gong <gordongong0350@gmail.com>
Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
	david.vrable@citrix.com
Subject: Re: [PATCH] blkfront:finish requests in io-ring with EIO
Date: Tue, 1 Apr 2014 08:47:17 -0400	[thread overview]
Message-ID: <20140401124717.GB7135@phenom.dumpdata.com> (raw)
In-Reply-To: <CAL9N-M1J2fO0r_4CLt1KC0ge8CFKoauQYRstyDACfdLTC6WbFg@mail.gmail.com>

On Tue, Apr 01, 2014 at 04:25:12PM +0800, Gordon Gong wrote:
> Subject: [PATCH] blkfront:finished the requests in io-ring with EIO to avoid
>  stucking with state of D.

How do you get to this state?
> 
> The sequence of xenwatch of blkfront and xenbus_frontend, when the
> tdb path of backend is gone, desided that the backend closing->
> frontend closing->backend closed->frontend closed normaly or remove
> started by xenbus.
> ---
>  drivers/block/xen-blkfront.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 9ea8c25..6582592 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -653,6 +653,26 @@ static void blkif_restart_queue(struct work_struct
> *work)
>   spin_unlock_irq(&blkif_io_lock);
>  }
> 
> +static void finish_requests_sync(struct blkfront_info *info)
> +{
> + RING_IDX rc, rp;
> + struct blkif_request *ring_req;
> + struct request *req;
> +
> + rc = (info->ring.sring)->req_prod;
> + rp = info->ring.req_prod_pvt;
> +
> + while(rc != cp) {
> + unsigned long id;
> +
> + ring_req = RING_GET_REQUEST(&info->ring, rc);
> + id = ring_req->id;
> + req = info->shadow[id].request;
> + __blk_end_srequest_all(req, -EIO);
> + rc++;
> + }

Something is off with your editor. You should use tabs.
> +}
> +
>  static void blkif_free(struct blkfront_info *info, int suspend)
>  {
>   /* Prevent new requests being issued until we fix things up. */
> @@ -664,6 +684,9 @@ static void blkif_free(struct blkfront_info *info, int
> suspend)
>   blk_stop_queue(info->rq);
>   /* No more gnttab callback work. */
>   gnttab_cancel_free_callback(&info->callback);
> + /* Finished request in io-ring with EIO */
> + finish_requests_sync(info);
> +
>   spin_unlock_irq(&blkif_io_lock);
> 
>   /* Flush gnttab callback work. Must be done with no locks held. */
> -- 
> 1.8.3.1

      reply	other threads:[~2014-04-01 12:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  8:25 [PATCH] blkfront:finish requests in io-ring with EIO Gordon Gong
2014-04-01 12:47 ` Konrad Rzeszutek Wilk [this message]

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=20140401124717.GB7135@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrable@citrix.com \
    --cc=gordongong0350@gmail.com \
    --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.