tdb: Add a comment explaining the "check"
authorVolker Lendecke <vl@samba.org>
Fri, 14 Dec 2012 15:07:11 +0000 (16:07 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2012 12:54:39 +0000 (13:54 +0100)
I had to ask git blame to find why we have to do it here...

Reviewed-by: Rusty Russell <rusty@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Dec 21 13:54:39 CET 2012 on sn-devel-104

lib/tdb/common/lock.c

index b89cb2d..7155a9f 100644 (file)
@@ -374,7 +374,10 @@ static int tdb_lock_list(struct tdb_context *tdb, int list, int ltype,
                return tdb_lock_covered_by_allrecord_lock(tdb, ltype);
        }
 
-       /* Only check when we grab first data lock. */
+       /*
+        * Check for recoveries: Someone might have kill -9'ed a process
+        * during a commit.
+        */
        check = !have_data_locks(tdb);
        ret = tdb_nest_lock(tdb, lock_offset(list), ltype, waitflag);