The branch, master has been updated via c3211c8 s3/locking: Fix comments to reflect code flow via 48ad1db s3: Don't copy back the stat struct from stat_cache_lookup if we did not get a hit on the full path. from e5298c8 uid_wrapper: Fix Tab/indent error with python3
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit c3211c8e592468916550283026044867359157cb Author: Anoop C S <anoo...@redhat.com> Date: Tue Sep 18 12:27:02 2018 +0530 s3/locking: Fix comments to reflect code flow * posix_pending_close_db is an in-memory database and not a tdb. Therefore adjusting comments to convey the correct meaning of the database. * we do not have posix_locking_close_file() any more which got renamed to locking_close_file(). Thus fixing comment to mention the new name. Signed-off-by: Anoop C S <anoo...@redhat.com> Reviewed-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Sep 19 22:23:28 CEST 2018 on sn-devel-144 commit 48ad1db3c5b513863a8f7868d2a92ebb8df2a27e Author: Richard Sharpe <richard.sha...@primarydata.com> Date: Mon Sep 17 15:38:06 2018 -0700 s3: Don't copy back the stat struct from stat_cache_lookup if we did not get a hit on the full path. Signed-off-by: Richard Sharpe <realrichardsha...@gmail.com> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/locking/posix.c | 8 ++++---- source3/smbd/statcache.c | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 79c33cf..a9fb58c 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -509,7 +509,7 @@ static void delete_lock_ref_count(const files_struct *fsp) ****************************************************************************/ /**************************************************************************** - Add an fd to the pending close tdb. + Add an fd to the pending close db. ****************************************************************************/ static void add_fd_to_close_entry(const files_struct *fsp) @@ -599,7 +599,7 @@ static size_t get_posix_pending_close_entries(TALLOC_CTX *mem_ctx, /**************************************************************************** Deal with pending closes needed by POSIX locking support. - Note that posix_locking_close_file() is expected to have been called + Note that locking_close_file() is expected to have been called to delete all locks on this fsp before this function is called. ****************************************************************************/ @@ -637,7 +637,7 @@ int fd_close_posix(const struct files_struct *fsp) /* * No outstanding locks. Get the pending close fd's - * from the tdb and close them all. + * from the db and close them all. */ count = get_posix_pending_close_entries(talloc_tos(), fsp, &fd_array); @@ -653,7 +653,7 @@ int fd_close_posix(const struct files_struct *fsp) } /* - * Delete all fd's stored in the tdb + * Delete all fd's stored in the db * for this dev/inode pair. */ diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index 27f9dec..5162ec0 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -261,10 +261,7 @@ bool stat_cache_lookup(connection_struct *conn, * Count the number of times we have done this, we'll * need it when reconstructing the string. */ - - if (sizechanged) { - num_components++; - } + num_components++; if ((*chk_name == '\0') || ISDOT(chk_name) || ISDOTDOT(chk_name)) { @@ -301,7 +298,12 @@ bool stat_cache_lookup(connection_struct *conn, TALLOC_FREE(translated_path); return False; } - *pst = smb_fname.st; + /* + * Only copy the stat struct back if we actually hit the full path + */ + if (num_components == 0) { + *pst = smb_fname.st; + } if (!sizechanged) { memcpy(*pp_name, translated_path, -- Samba Shared Repository