tdb: in tdb_delete_hash, make lock/unlock bracket more obvious
authorMichael Adam <obnox@samba.org>
Thu, 13 Feb 2014 16:03:46 +0000 (17:03 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 15 Feb 2014 02:21:07 +0000 (03:21 +0100)
by using the same variable as hash as in the lock.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb 15 03:21:07 CET 2014 on sn-devel-104

lib/tdb/common/tdb.c

index f24493ccd84b3ff17b9fb2427da31c207e80ce65..1e41e84c82ad676fc376bdbb2b343d85c4851d10 100644 (file)
@@ -421,7 +421,7 @@ static int tdb_delete_hash(struct tdb_context *tdb, TDB_DATA key, uint32_t hash)
                tdb_increment_seqnum(tdb);
        }
 
-       if (tdb_unlock(tdb, BUCKET(rec.full_hash), F_WRLCK) != 0)
+       if (tdb_unlock(tdb, BUCKET(hash), F_WRLCK) != 0)
                TDB_LOG((tdb, TDB_DEBUG_WARNING, "tdb_delete: WARNING tdb_unlock failed!\n"));
        return ret;
 }