[DRBD-user] 8.3 Oops when detaching during online verify [fixed]

Lars Ellenberg lars.ellenberg at linbit.com
Mon Sep 6 14:27:46 CEST 2010

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Fri, Sep 03, 2010 at 11:35:00AM -0700, Ryan Cooley wrote:
> On Fri, 3 Sep 2010 18:32:03 +0200
> Lars Ellenberg <lars.ellenberg at linbit.com> wrote:
> 
> > Too bad. It was much easier if it was reproducible.
> 
> I reported a similar and consistently reproducable bug:
> 
>   http://bugs.centos.org/view.php?id=4343

That's something different.
Note that your trace shows
     lc_find
     drbd_rs_complete_io
     got_OVResult
     drbd_asender

Whereas Michael and Roland have something in
w_e_end_ov_req from drbd_worker.


As it is easy to reproduce, it was easy to fix.
At least I hope so:

diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
index 9717102..77c2523 100644
--- a/drbd/drbd_receiver.c
+++ b/drbd/drbd_receiver.c
@@ -4300,10 +4300,13 @@ STATIC int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h)
 
 	update_peer_seq(mdev, be32_to_cpu(p->seq_num));
 
-	drbd_rs_complete_io(mdev, sector);
-	drbd_set_in_sync(mdev, sector, blksize);
-	/* rs_same_csums is supposed to count in units of BM_BLOCK_SIZE */
-	mdev->rs_same_csum += (blksize >> BM_BLOCK_SHIFT);
+	if (get_ldev(mdev)) {
+		drbd_rs_complete_io(mdev, sector);
+		drbd_set_in_sync(mdev, sector, blksize);
+		/* rs_same_csums is supposed to count in units of BM_BLOCK_SIZE */
+		mdev->rs_same_csum += (blksize >> BM_BLOCK_SHIFT);
+		put_ldev(mdev);
+	}
 	dec_rs_pending(mdev);
 	atomic_add(blksize >> 9, &mdev->rs_sect_in);
 
@@ -4482,6 +4485,9 @@ STATIC int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h)
 	else
 		ov_oos_print(mdev);
 
+	if (!get_ldev(mdev))
+		return TRUE;
+
 	drbd_rs_complete_io(mdev, sector);
 	dec_rs_pending(mdev);
 
@@ -4496,6 +4502,7 @@ STATIC int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h)
 			drbd_resync_finished(mdev);
 		}
 	}
+	put_ldev(mdev);
 	return TRUE;
 }
 
diff --git a/drbd/drbd_worker.c b/drbd/drbd_worker.c
index 6e6ce0e..7acd841 100644
--- a/drbd/drbd_worker.c
+++ b/drbd/drbd_worker.c
@@ -1053,7 +1053,10 @@ int w_e_end_csum_rs_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
 		return 1;
 	}
 
-	drbd_rs_complete_io(mdev, e->sector);
+	if (get_ldev(mdev)) {
+		drbd_rs_complete_io(mdev, e->sector);
+		put_ldev(mdev);
+	}
 
 	di = e->digest;
 
@@ -1160,7 +1163,10 @@ int w_e_end_ov_reply(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
 
 	/* after "cancel", because after drbd_disconnect/drbd_rs_cancel_all
 	 * the resync lru has been cleaned up already */
-	drbd_rs_complete_io(mdev, e->sector);
+	if (get_ldev(mdev)) {
+		drbd_rs_complete_io(mdev, e->sector);
+		put_ldev(mdev);
+	}
 
 	di = e->digest;
 
-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
__
please don't Cc me, but send to list   --   I'm subscribed



More information about the drbd-user mailing list