Browse Source

tdb: fix lock-tracking test code after gradual lock changes.

Rusty Russell 15 years ago
parent
commit
64eca8b85e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      ccan/tdb/test/lock-tracking.c

+ 6 - 0
ccan/tdb/test/lock-tracking.c

@@ -70,6 +70,12 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ )
 				break;
 			if (fl_end >= i->off && fl_end < i_end)
 				break;
+
+			/* tdb_allrecord_lock does this, handle adjacent: */
+			if (fl->l_start == i_end && fl->l_type == i->type) {
+				i->len = fl->l_len ? i->len + fl->l_len : 0;
+				goto ok;
+			}
 		}
 		if (i) {
 			/* Special case: upgrade of allrecord lock. */