summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-09-13 14:13:51 +0200
committerJeremy Allison <jra@samba.org>2013-10-15 01:52:29 +0200
commit47f65d5829167f061756621e50b480a8c16e4fbc (patch)
tree937181849c0cbae11347490c46e6758df6b45fa5
parentc92ac4c8eebf4ddaaab4e8b640650406b259b05d (diff)
downloadsamba-47f65d5829167f061756621e50b480a8c16e4fbc.tar.gz
samba-47f65d5829167f061756621e50b480a8c16e4fbc.tar.bz2
samba-47f65d5829167f061756621e50b480a8c16e4fbc.zip
smbd: Add debugs to brlock.c
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/locking/brlock.c15
-rw-r--r--source3/smbd/oplock.c6
2 files changed, 21 insertions, 0 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 67b1701919..b5eebc8e04 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -90,6 +90,8 @@ bool brl_have_read_oplocks(const struct byte_range_lock *brl)
void brl_set_have_read_oplocks(struct byte_range_lock *brl,
bool have_read_oplocks)
{
+ DEBUG(10, ("Setting have_read_oplocks to %s\n",
+ have_read_oplocks ? "true" : "false"));
SMB_ASSERT(brl->record != NULL); /* otherwise we're readonly */
brl->have_read_oplocks = have_read_oplocks;
brl->modified = true;
@@ -1894,6 +1896,7 @@ static void byte_range_lock_flush(struct byte_range_lock *br_lck)
{
size_t data_len;
if (!br_lck->modified) {
+ DEBUG(10, ("br_lck not modified\n"));
goto done;
}
@@ -1903,6 +1906,8 @@ static void byte_range_lock_flush(struct byte_range_lock *br_lck)
data_len += 1;
}
+ DEBUG(10, ("data_len=%d\n", (int)data_len));
+
if (data_len == 0) {
/* No locks - delete this entry. */
NTSTATUS status = dbwrap_record_delete(br_lck->record);
@@ -1934,6 +1939,8 @@ static void byte_range_lock_flush(struct byte_range_lock *br_lck)
}
}
+ DEBUG(10, ("seqnum=%d\n", dbwrap_get_seqnum(brlock_db)));
+
done:
br_lck->modified = false;
TALLOC_FREE(br_lck->record);
@@ -1997,6 +2004,8 @@ struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx, files_struct *fsp)
talloc_get_size(br_lck->lock_data));
}
+ DEBUG(10, ("data.dsize=%d\n", (int)data.dsize));
+
if ((data.dsize % sizeof(struct lock_struct)) == 1) {
br_lck->have_read_oplocks = (data.dptr[data.dsize-1] == 1);
}
@@ -2072,6 +2081,9 @@ static void brl_get_locks_readonly_parser(TDB_DATA key, TDB_DATA data,
br_lock->have_read_oplocks = (data.dptr[data.dsize-1] == 1);
}
+ DEBUG(10, ("Got %d bytes, have_read_oplocks: %s\n", (int)data.dsize,
+ br_lock->have_read_oplocks ? "true" : "false"));
+
*state->br_lock = br_lock;
}
@@ -2080,6 +2092,9 @@ struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp)
struct byte_range_lock *br_lock = NULL;
struct byte_range_lock *rw = NULL;
+ DEBUG(10, ("seqnum=%d, fsp->brlock_seqnum=%d\n",
+ dbwrap_get_seqnum(brlock_db), fsp->brlock_seqnum));
+
if ((fsp->brlock_rec != NULL)
&& (dbwrap_get_seqnum(brlock_db) == fsp->brlock_seqnum)) {
/*
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index f18ac657b8..fc6b0efdda 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -157,6 +157,9 @@ bool remove_oplock(files_struct *fsp)
bool ret;
struct share_mode_lock *lck;
+ DEBUG(10, ("remove_oplock called for %s\n",
+ fsp_str_dbg(fsp)));
+
/* Remove the oplock flag from the sharemode. */
lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
@@ -224,6 +227,9 @@ bool downgrade_oplock(files_struct *fsp)
struct share_mode_lock *lck;
struct byte_range_lock *brl;
+ DEBUG(10, ("downgrade_oplock called for %s\n",
+ fsp_str_dbg(fsp)));
+
lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
if (lck == NULL) {
DEBUG(0,("downgrade_oplock: failed to lock share entry for "