[Drbd-dev] DRBD-8: ap_pending_cnt maintenance

Graham, Simon Simon.Graham at stratus.com
Mon Aug 14 19:28:11 CEST 2006


In looking for the cause of hitting asserts that ap_pending_cnt is not
-ve, I think I've found one place where an extra decrement is done (not,
unfortunately the cause of my problem, but still wrong); in
make_request_common, when handling WRITE requests, if two-primaries are
allowed, the code checks for concurrent writes and fails the new one if
an existing remote write is in progress. Now, the increment for the
write being handled by this function isn't done until w_send_dblock runs
in the worker thread, so I don't think a decrement should be done when
the request is completed here...

Code:

			if (mdev->net_conf->two_primaries) {
				if(_ee_have_write(mdev,req)) { //
tl_add() here
					spin_unlock_irq(&mdev->tl_lock);

					WARN("Concurrent write! [DISCARD
L] sec=%lu\n",
					     (unsigned long)sector);
					dec_local(mdev);
					dec_ap_pending(mdev);	<<<<====
I think this is incorrect!
					local=0;

					drbd_end_req(req, RQ_DRBD_DONE,
1, sector);
					if(b) kfree(b);
					return 0;
				}
			} else {
				_tl_add(mdev,req);
			}
			req->w.cb =  w_send_dblock;
			drbd_queue_work(&mdev->data.work, &req->w);

What do you think?
Simon



More information about the drbd-dev mailing list