Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Lars Ellenberg <Lars.Ellenberg@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] DRBD-8 - system hangs when NegDReply received
Date: Wed, 6 Sep 2006 10:09:31 +0200	[thread overview]
Message-ID: <20060906080931.GA30543@barkeeper1.linbit> (raw)
In-Reply-To: <342BAC0A5467384983B586A6B0B37671038AFA18@EXNA.corp.stratus.com>

/ 2006-09-05 21:41:36 -0400
\ Graham, Simon:
> I'd still like to understand why simply completing the original request
> with an error similar to what is done in receive_DataReply leads to a
> hang - all suggestions gratefully received - this is what the NegDReply
> code looks like now:
> 
> STATIC int got_NegDReply(drbd_dev *mdev, Drbd_Header* h)
> {
> 	drbd_request_t *req;
> 	Drbd_BlockAck_Packet *p = (Drbd_BlockAck_Packet*)h;
> 	sector_t sector = be64_to_cpu(p->sector);
> 
> 	req = (drbd_request_t *)(unsigned long)p->block_id;
> 	if(unlikely(!drbd_pr_verify(mdev,req,sector))) {
> 		ERR("Got a corrupt block_id/sector pair(3).\n");
> 		return FALSE;
> 	}
> 
> 	ERR("Got NegDReply; Sector %llx, len %x; Fail original
> request.\n",
> 	    (unsigned long long)sector,be32_to_cpu(p->blksize));
> 
> 	spin_lock(&mdev->pr_lock);
> 	hlist_del(&req->colision);
> 	spin_unlock(&mdev->pr_lock);
> 
> 	/* Complete original request with error */
> 	drbd_bio_endio(req->master_bio,0 /* failed */);

I am still working on a monster patch to consolidate all the
request functionality in one place, so it is more obvious what should
and should not happen.
I may be wrong here, but you cannot simply end the master request and
free the req because you get a NegDReply. the local part (submit_bio)
may still be on the fly.
you have to use drbd_end_req with appropriate flags...


> 
> 	dec_ap_bio(mdev);
> 	dec_ap_pending(mdev);
> 
> 	drbd_req_free(req);
> 
> 	drbd_khelper(mdev,"pri-on-incon-degr");
> 
> 	return TRUE;
> }

-- 
: Lars Ellenberg                                  Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :

  reply	other threads:[~2006-09-06  8:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06  1:41 [Drbd-dev] DRBD-8 - system hangs when NegDReply received Graham, Simon
2006-09-06  8:09 ` Lars Ellenberg [this message]
2006-09-07  9:28   ` Lars Ellenberg
  -- strict thread matches above, loose matches on Subject: below --
2006-09-07 14:21 Graham, Simon
2006-09-07 16:40 ` Lars Ellenberg
2006-09-05 22:02 Graham, Simon
2006-09-05 20:47 Graham, Simon
2006-09-05 20:04 Graham, Simon

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=20060906080931.GA30543@barkeeper1.linbit \
    --to=lars.ellenberg@linbit.com \
    --cc=drbd-dev@lists.linbit.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox