smbd panic at find_oplock_types().

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Sep 9 05:12:35 MDT 2014


On Sat, Sep 06, 2014 at 09:55:40AM -0700, Jeremy Allison wrote:
> On Sat, Sep 06, 2014 at 09:50:25AM -0700, Jeremy Allison wrote:
> > 
> > INTERNAL_OPEN_ONLY is a synonym for req==NULL,
> > and we probably can now just remove it as a
> > flag ever passed into SMB_VFS_CREATE_FILE(),
> > at least in master. It represents an open that
> > is being done on behalf of the smbd to achieve
> > another task, and not at the direct request of
> > the client (which is why req == NULL).
> 
> Yeah, looking inside master in open_file_ntcreate()
> we have:
> 
>         if (req == NULL) {
>                 /* Ensure req == NULL means INTERNAL_OPEN_ONLY */
>                 SMB_ASSERT(((oplock_request & INTERNAL_OPEN_ONLY) != 0));
>         } else {
>                 /* And req != NULL means no INTERNAL_OPEN_ONLY */
>                 SMB_ASSERT(((oplock_request & INTERNAL_OPEN_ONLY) == 0));
>         }
> 
> so once we've fixed this we can add a patch
> that removes all uses of INTERNAL_OPEN_ONLY
> from all other files except open.c, and moves
> this block of header:

Remember that INTERNAL_OPEN_ONLY has the effect that this request will
never be deferred. For me that's the main use of this flag: Not all
callers are prepared to handle open_was_deferred. We need an indication
to open_file_ntcreate to never defer a call. Or even better, we need to
replace the existing deferral mechanism with a tevent_req based design,
but that's certainly a future project.

What about the attached patch? This fixes batch26. I haven't
run an autobuild yet, starting that in a minute.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 47d0f36dc6631dead285b373d1d5486d0badb44f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 9 Sep 2014 10:53:52 +0000
Subject: [PATCH] smbd: Fix bug 10797

---
 source3/smbd/open.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 67ba25e..478e67c 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1083,7 +1083,7 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
 		return;
 	}
 
-	if (share_entry->share_file_id == 0) {
+	if (share_entry->op_mid == 0) {
 		/* INTERNAL_OPEN_ONLY */
 		return;
 	}
@@ -1264,6 +1264,11 @@ static bool validate_oplock_types(struct share_mode_lock *lck)
 			continue;
 		}
 
+		if (e->op_mid == 0) {
+			/* INTERNAL_OPEN_ONLY */
+			continue;
+		}
+
 		if (e->op_type == NO_OPLOCK && is_stat_open(e->access_mask)) {
 			/* We ignore stat opens in the table - they
 			   always have NO_OPLOCK and never get or
-- 
1.7.9.5



More information about the samba-technical mailing list