summaryrefslogtreecommitdiff
path: root/source/smbd/oplock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-01-27 19:54:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:16 -0500
commitfa5fab313e3728ff49c00ca1097242039506f83e (patch)
treebc76709a8c966fcc79d4e6af9291febc226157c6 /source/smbd/oplock.c
parentc0ba64297a00d75cd537693425c6b544e70578c1 (diff)
downloadsamba-fa5fab313e3728ff49c00ca1097242039506f83e.tar.gz
r13192: Fix up alignment issues when printing share mode
entries. Add paranioa to debug so we know when an entry is unused. Jeremy.
Diffstat (limited to 'source/smbd/oplock.c')
-rw-r--r--source/smbd/oplock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/smbd/oplock.c b/source/smbd/oplock.c
index 6739d29470b..234b62e8ae4 100644
--- a/source/smbd/oplock.c
+++ b/source/smbd/oplock.c
@@ -684,6 +684,11 @@ void release_level_2_oplocks_on_change(files_struct *fsp)
don't have to do anything */
for (i=0; i<lck->num_share_modes; i++) {
struct share_mode_entry *e = &lck->share_modes[i];
+
+ if (!is_valid_share_mode_entry(e)) {
+ continue;
+ }
+
if ((e->op_type == NO_OPLOCK) &&
(e->share_file_id == fsp->file_id) &&
(e->dev == fsp->dev) &&
@@ -701,6 +706,10 @@ void release_level_2_oplocks_on_change(files_struct *fsp)
struct share_mode_entry *share_entry = &lck->share_modes[i];
char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
+ if (!is_valid_share_mode_entry(share_entry)) {
+ continue;
+ }
+
/*
* As there could have been multiple writes waiting at the
* lock_share_entry gate we may not be the first to