[DRBD-cvs] r1684 - trunk/drbd
svn at svn.drbd.org
svn at svn.drbd.org
Tue Dec 21 18:08:52 CET 2004
Author: phil
Date: 2004-12-21 18:08:50 +0100 (Tue, 21 Dec 2004)
New Revision: 1684
Modified:
trunk/drbd/drbd_main.c
trunk/drbd/drbd_receiver.c
Log:
Added missing locking to tl_verify()
Removed the weak pointer verification, since tl_verify() is
a strong verification.
Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c 2004-12-21 00:32:30 UTC (rev 1683)
+++ trunk/drbd/drbd_main.c 2004-12-21 17:08:50 UTC (rev 1684)
@@ -266,14 +266,21 @@
struct hlist_head *slot = mdev->tl_hash + tl_hash_fn(mdev,sector);
struct hlist_node *n;
drbd_request_t * i;
+ int rv=0;
+ spin_lock_irq(&mdev->tl_lock);
+
hlist_for_each_entry(i, n, slot, colision) {
if (i==item) {
D_ASSERT(drbd_req_get_sector(i) == sector);
- return 1;
+ rv=1;
+ break;
}
}
- return 0;
+
+ spin_unlock_irq(&mdev->tl_lock);
+
+ return rv;
}
/* tl_dependence reports if this sector was present in the current
Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c 2004-12-21 00:32:30 UTC (rev 1683)
+++ trunk/drbd/drbd_receiver.c 2004-12-21 17:08:50 UTC (rev 1684)
@@ -1921,8 +1921,6 @@
} else {
req=(drbd_request_t*)(long)p->block_id;
- ERR_IF (!VALID_POINTER(req)) return FALSE;
-
if (unlikely(!tl_verify(mdev,req,sector))) {
ERR("Got a corrupt block_id/sector pair.\n");
return FALSE;
More information about the drbd-cvs
mailing list