The branch, master has been updated
       via  14f9e6f dbwrap: Clarify db_open_watched API
       via  22be863 smbd: Fix a few DEBUG statements
       via  0d38e9e dbwrap: Fix a typo
       via  fea8ebc g_lock: Fix DEBUG messages
       via  a56bd0a smbd: Fix a typo
       via  04f6298 smbd: Fix a typo
       via  29eb2fc smbd: Enhance debugging in set_file_size
      from  6ca5ba5 lib: Pass mem_ctx to cache_path()

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


- Log -----------------------------------------------------------------
commit 14f9e6f833f806cb87d8562e8e1d29e78c549ead
Author: Volker Lendecke <[email protected]>
Date:   Thu Aug 16 11:25:54 2018 +0200

    dbwrap: Clarify db_open_watched API
    
    Point out in the API that "backend" talloc_moves into the watched
    database.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Fri Aug 17 21:29:15 CEST 2018 on sn-devel-144

commit 22be863ba3ad2c9269b0154f7540300c37fb1ff0
Author: Volker Lendecke <[email protected]>
Date:   Mon Jul 30 13:00:22 2018 +0200

    smbd: Fix a few DEBUG statements
    
    %u is not necessarily correct for uint32_t, avoid casts
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 0d38e9e84831759ebcd13b40bfe4d70f127b724d
Author: Volker Lendecke <[email protected]>
Date:   Mon Jul 30 16:29:58 2018 +0200

    dbwrap: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Rowland Penny <[email protected]>

commit fea8ebce485c6cdd5c312e7d5caef72d52c904fd
Author: Volker Lendecke <[email protected]>
Date:   Thu Aug 16 11:34:36 2018 +0200

    g_lock: Fix DEBUG messages
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit a56bd0a90f46f384052326f6facc1d8c18a5f537
Author: Volker Lendecke <[email protected]>
Date:   Thu Jul 26 17:56:31 2018 +0200

    smbd: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 04f62984fe7c76dd409197fb72f1697c4d7e1755
Author: Volker Lendecke <[email protected]>
Date:   Thu Jul 26 12:43:30 2018 +0200

    smbd: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 29eb2fc67c7c0b26390ddeda76f4d3aa8c0846c4
Author: Volker Lendecke <[email protected]>
Date:   Tue Aug 7 15:09:04 2018 +0200

    smbd: Enhance debugging in set_file_size
    
    I've stumbled over a case where VFS_FTRUNCATE wasn't called due to an
    unchanged size. Make that easier to detect. Also, get rid of an ancient
    cast to (double).
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

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

Summary of changes:
 lib/dbwrap/dbwrap.c                     |  2 +-
 source3/lib/dbwrap/dbwrap_watch.c       |  8 ++++----
 source3/lib/dbwrap/dbwrap_watch.h       |  2 +-
 source3/lib/g_lock.c                    |  6 +++---
 source3/locking/locking.c               | 22 ++++++++++++++--------
 source3/locking/share_mode_lock.c       |  2 +-
 source3/smbd/open.c                     |  2 +-
 source3/smbd/oplock.c                   |  2 +-
 source3/smbd/smbXsrv_session.c          |  2 +-
 source3/smbd/trans2.c                   |  4 +++-
 source3/torture/test_dbwrap_do_locked.c |  2 +-
 source3/torture/test_dbwrap_watch.c     |  4 ++--
 12 files changed, 33 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index e1d792f..a214a4e 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -457,7 +457,7 @@ struct tevent_req *dbwrap_parse_record_send(
 
        /*
         * Copy the key into our state ensuring the key data buffer is always
-        * available to the all dbwrap backend over the entire lifetime of the
+        * available to all the dbwrap backends over the entire lifetime of the
         * async request. Otherwise the caller might have free'd the key buffer.
         */
        if (key.dsize > sizeof(state->_keybuf)) {
diff --git a/source3/lib/dbwrap/dbwrap_watch.c 
b/source3/lib/dbwrap/dbwrap_watch.c
index 3e91f46..45e1795 100644
--- a/source3/lib/dbwrap/dbwrap_watch.c
+++ b/source3/lib/dbwrap/dbwrap_watch.c
@@ -738,7 +738,7 @@ static size_t dbwrap_watched_id(struct db_context *db, 
uint8_t *id,
 }
 
 struct db_context *db_open_watched(TALLOC_CTX *mem_ctx,
-                                  struct db_context *backend,
+                                  struct db_context **backend,
                                   struct messaging_context *msg)
 {
        struct db_context *db;
@@ -757,9 +757,9 @@ struct db_context *db_open_watched(TALLOC_CTX *mem_ctx,
 
        ctx->msg = msg;
 
-       db->lock_order = backend->lock_order;
-       backend->lock_order = DBWRAP_LOCK_ORDER_NONE;
-       ctx->backend = talloc_move(ctx, &backend);
+       ctx->backend = talloc_move(ctx, backend);
+       db->lock_order = ctx->backend->lock_order;
+       ctx->backend->lock_order = DBWRAP_LOCK_ORDER_NONE;
 
        db->fetch_locked = dbwrap_watched_fetch_locked;
        db->do_locked = dbwrap_watched_do_locked;
diff --git a/source3/lib/dbwrap/dbwrap_watch.h 
b/source3/lib/dbwrap/dbwrap_watch.h
index e94378f..a836ca4 100644
--- a/source3/lib/dbwrap/dbwrap_watch.h
+++ b/source3/lib/dbwrap/dbwrap_watch.h
@@ -25,7 +25,7 @@
 #include "messages.h"
 
 struct db_context *db_open_watched(TALLOC_CTX *mem_ctx,
-                                  struct db_context *backend,
+                                  struct db_context **backend,
                                   struct messaging_context *msg);
 struct tevent_req *dbwrap_watched_watch_send(TALLOC_CTX *mem_ctx,
                                             struct tevent_context *ev,
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 9090a2d..d8298b6 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -167,14 +167,14 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
                          DBWRAP_FLAG_NONE);
        TALLOC_FREE(db_path);
        if (backend == NULL) {
-               DEBUG(1, ("g_lock_init: Could not open g_lock.tdb\n"));
+               DBG_WARNING("Could not open g_lock.tdb\n");
                TALLOC_FREE(result);
                return NULL;
        }
 
-       result->db = db_open_watched(result, backend, msg);
+       result->db = db_open_watched(result, &backend, msg);
        if (result->db == NULL) {
-               DBG_WARNING("g_lock_init: db_open_watched failed\n");
+               DBG_WARNING("db_open_watched failed\n");
                TALLOC_FREE(result);
                return NULL;
        }
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 208f7e2..b268120 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -739,8 +739,10 @@ bool share_mode_stale_pid(struct share_mode_data *d, 
uint32_t idx)
        struct share_mode_entry *e;
 
        if (idx > d->num_share_modes) {
-               DEBUG(1, ("Asking for index %u, only %u around\n",
-                         idx, (unsigned)d->num_share_modes));
+               DBG_WARNING("Asking for index %"PRIu32", "
+                           "only %"PRIu32" around\n",
+                           idx,
+                           d->num_share_modes);
                return false;
        }
        e = &d->share_modes[idx];
@@ -751,14 +753,18 @@ bool share_mode_stale_pid(struct share_mode_data *d, 
uint32_t idx)
                return true;
        }
        if (serverid_exists(&e->pid)) {
-               DEBUG(10, ("PID %s (index %u out of %u) still exists\n",
-                          server_id_str_buf(e->pid, &tmp), idx,
-                          (unsigned)d->num_share_modes));
+               DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") "
+                         "still exists\n",
+                         server_id_str_buf(e->pid, &tmp),
+                         idx,
+                         d->num_share_modes);
                return false;
        }
-       DEBUG(10, ("PID %s (index %u out of %u) does not exist anymore\n",
-                  server_id_str_buf(e->pid, &tmp), idx,
-                  (unsigned)d->num_share_modes));
+       DBG_DEBUG("PID %s (index %"PRIu32" out of %"PRIu32") "
+                 "does not exist anymore\n",
+                 server_id_str_buf(e->pid, &tmp),
+                 idx,
+                 d->num_share_modes);
 
        e->stale = true;
 
diff --git a/source3/locking/share_mode_lock.c 
b/source3/locking/share_mode_lock.c
index 49d4a7c..0bf7b9d 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -86,7 +86,7 @@ static bool locking_init_internal(bool read_only)
                return False;
        }
 
-       lock_db = db_open_watched(NULL, backend, server_messaging_context());
+       lock_db = db_open_watched(NULL, &backend, server_messaging_context());
        if (lock_db == NULL) {
                DBG_ERR("db_open_watched failed\n");
                TALLOC_FREE(backend);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index db5eb4e..cbabea3 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -5005,7 +5005,7 @@ static NTSTATUS lease_match(connection_struct *conn,
                         * Send the breaks and then return
                         * SMB2_LEASE_NONE in the lease handle
                         * to cause them to acknowledge the
-                        * lease break. Consulatation with
+                        * lease break. Consultation with
                         * Microsoft engineering confirmed
                         * this approach is safe.
                         */
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 6362329..295ae1f 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -1153,7 +1153,7 @@ static void 
contend_level2_oplocks_begin_default(files_struct *fsp,
 
        /*
         * do_break_to_none() only operates on the
-        * locking.tdb and send network packets to
+        * locking.tdb and sends network packets to
         * the client. That doesn't require any
         * impersonation, so we just use the
         * raw tevent context here.
diff --git a/source3/smbd/smbXsrv_session.c b/source3/smbd/smbXsrv_session.c
index 557a43f..af47f4a 100644
--- a/source3/smbd/smbXsrv_session.c
+++ b/source3/smbd/smbXsrv_session.c
@@ -89,7 +89,7 @@ NTSTATUS smbXsrv_session_global_init(struct messaging_context 
*msg_ctx)
                return status;
        }
 
-       db_ctx = db_open_watched(NULL, backend, server_messaging_context());
+       db_ctx = db_open_watched(NULL, &backend, server_messaging_context());
        if (db_ctx == NULL) {
                TALLOC_FREE(backend);
                return NT_STATUS_NO_MEMORY;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 0ec20fe..c0f9847 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6355,7 +6355,9 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
-       DEBUG(6,("smb_set_file_size: size: %.0f ", (double)size));
+       DBG_INFO("size: %"PRIu64", file_size_stat=%"PRIu64"\n",
+                (uint64_t)size,
+                get_file_size_stat(psbuf));
 
        if (size == get_file_size_stat(psbuf)) {
                return NT_STATUS_OK;
diff --git a/source3/torture/test_dbwrap_do_locked.c 
b/source3/torture/test_dbwrap_do_locked.c
index 46b326b..2e5305d 100644
--- a/source3/torture/test_dbwrap_do_locked.c
+++ b/source3/torture/test_dbwrap_do_locked.c
@@ -97,7 +97,7 @@ bool run_dbwrap_do_locked1(int dummy)
                return false;
        }
 
-       db = db_open_watched(talloc_tos(), backend, msg);
+       db = db_open_watched(talloc_tos(), &backend, msg);
        if (db == NULL) {
                fprintf(stderr, "db_open_watched failed: %s\n",
                        strerror(errno));
diff --git a/source3/torture/test_dbwrap_watch.c 
b/source3/torture/test_dbwrap_watch.c
index 97d5ea6..5ef6b10 100644
--- a/source3/torture/test_dbwrap_watch.c
+++ b/source3/torture/test_dbwrap_watch.c
@@ -56,7 +56,7 @@ bool run_dbwrap_watch1(int dummy)
                goto fail;
        }
 
-       db = db_open_watched(ev, backend, msg);
+       db = db_open_watched(ev, &backend, msg);
 
        rec = dbwrap_fetch_locked(db, db, key);
        if (rec == NULL) {
@@ -153,7 +153,7 @@ bool run_dbwrap_watch2(int dummy)
                goto fail;
        }
 
-       db = db_open_watched(ev, backend, msg);
+       db = db_open_watched(ev, &backend, msg);
        if (db == NULL) {
                fprintf(stderr, "db_open_watched failed\n");
                goto fail;


-- 
Samba Shared Repository

Reply via email to