[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Dec 16 20:28:05 UTC 2019


The branch, master has been updated
       via  97ad50544aa smbd: Use explicit share_mode_wakeup_waiters()
       via  1c188c3716a smbd: Use explicit share_mode_wakeup_waiters()
       via  6abcc83366f smbd: Explicitly state when modifying share_mode_data
       via  fe7f241225d torture4: Fix a typo
       via  810fd90a6fb smbd: Fix a typo
       via  f42e089a6ef smbd: Avoid casts in open_directory()
      from  af2d54bfce8 s3: smbd: msdfs: Factor out the code to create a msdfs:referral,list into a separate function.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 97ad50544aaecd07b4a8f39cd329ed484aa38d6e
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 13 14:40:03 2019 +0100

    smbd: Use explicit share_mode_wakeup_waiters()
    
    We don't need to unparse the locking.tdb record, we just need to wake
    up waiters when removing an oplock
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Mon Dec 16 20:27:59 UTC 2019 on sn-devel-184

commit 1c188c3716a76a290e9e7f529ead782bea936690
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 13 14:40:03 2019 +0100

    smbd: Use explicit share_mode_wakeup_waiters()
    
    We don't need to unparse the locking.tdb record, we just need to wake
    up waiters when downgrading a lease
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6abcc83366f5f3203e9454b444c7d0ada7fed41e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 10 18:55:39 2019 +0100

    smbd: Explicitly state when modifying share_mode_data
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fe7f241225db97d02a060118a342c824ab51e471
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 13 16:31:35 2019 +0100

    torture4: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 810fd90a6fb3cd95f0025321d080aad04afa994d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 13 16:06:43 2019 +0100

    smbd: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f42e089a6efa36adc0d835cb51a1a612b40fa1c9
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 13 16:05:05 2019 +0100

    smbd: Avoid casts in open_directory()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/locking/share_mode_lock.c |  2 +-
 source3/smbd/open.c               | 23 +++++++++++++----------
 source3/smbd/oplock.c             |  8 +-------
 source4/torture/smb2/sharemode.c  |  2 +-
 4 files changed, 16 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index cf972fc4b61..6704f34523a 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -2068,7 +2068,7 @@ bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp)
 			&fsp->lease->lease.lease_key);
 	}
 
-	lck->data->modified = true; /* signal watchers */
+	share_mode_wakeup_waiters(fsp->file_id);
 
 	return true;
 }
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d3d77cee631..d1c3f6badc8 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2575,8 +2575,10 @@ grant:
 		}
 	}
 
-	if (granted & SMB2_LEASE_READ) {
+	if ((granted & SMB2_LEASE_READ) &&
+	    ((lck->data->flags & SHARE_MODE_LEASE_READ) == 0)) {
 		lck->data->flags |= SHARE_MODE_LEASE_READ;
+		lck->data->modified = true;
 	}
 
 	DBG_DEBUG("oplock type 0x%x on file %s\n",
@@ -4208,15 +4210,16 @@ static NTSTATUS open_directory(connection_struct *conn,
 		file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
 	}
 
-	DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
-		 "share_access = 0x%x create_options = 0x%x, "
-		 "create_disposition = 0x%x, file_attributes = 0x%x\n",
+	DBG_INFO("opening directory %s, access_mask = 0x%"PRIx32", "
+		 "share_access = 0x%"PRIx32" create_options = 0x%"PRIx32", "
+		 "create_disposition = 0x%"PRIx32", "
+		 "file_attributes = 0x%"PRIx32"\n",
 		 smb_fname_str_dbg(smb_dname),
-		 (unsigned int)access_mask,
-		 (unsigned int)share_access,
-		 (unsigned int)create_options,
-		 (unsigned int)create_disposition,
-		 (unsigned int)file_attributes));
+		 access_mask,
+		 share_access,
+		 create_options,
+		 create_disposition,
+		 file_attributes);
 
 	status = smbd_calculate_access_mask(conn, smb_dname, false,
 					    access_mask, &access_mask);
@@ -4394,7 +4397,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 	/* Don't store old timestamps for directory
 	   handles in the internal database. We don't
 	   update them in there if new objects
-	   are creaded in the directory. Currently
+	   are created in the directory. Currently
 	   we only update timestamps on file writes.
 	   See bug #9870.
 	*/
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 6a3b1f77688..2c4449b10b2 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -653,13 +653,7 @@ NTSTATUS downgrade_lease(struct smbXsrv_connection *xconn,
 		  lease_state,
 		  nt_errstr(status));
 
-	/*
-	 * No, we did not modify the share mode array. We did modify
-	 * the leases_db. But without this we don't notify a lease
-	 * break waiter via dbwrap_watch_record. We need to make
-	 * leases_db watched too.
-	 */
-	lck->data->modified = true;
+	share_mode_wakeup_waiters(id);
 
 	fsps_lease_update(sconn, &id, key);
 
diff --git a/source4/torture/smb2/sharemode.c b/source4/torture/smb2/sharemode.c
index 5b1b8c4afba..6a581cd60ab 100644
--- a/source4/torture/smb2/sharemode.c
+++ b/source4/torture/smb2/sharemode.c
@@ -545,7 +545,7 @@ done:
 
 /*
  * Test conflicting sharemodes through SMB2: First open file with
- * different access masks, second open requests potentially conflict
+ * different access masks, second open requests potentially conflicting
  * sharemode.
  */
 static bool test_smb2_access_sharemode(struct torture_context *tctx,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list