[SCM] Samba Shared Repository - branch v3-6-test updated

Stefan Metzmacher metze at samba.org
Mon May 2 07:07:25 MDT 2011


The branch, v3-6-test has been updated
       via  d2c3354 s4:libcli/util/nterr: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
       via  38ea4e9 s3:libsmb/nterr: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
       via  ad8be76 libcli/util/ntstatus: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
       via  bae2c28 talloc: use TC_UNDEFINE_SHRINK_CHUNK() instead of TC_INVALIDATE_SHRINK_CHUNK() for realloc path
      from  187cd18 torture test for bug #8111 - CIFS VFS: unexpected error on SMB posix open.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit d2c3354f2641350518792f8c10d34323d2053f5c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon May 2 12:41:46 2011 +0200

    s4:libcli/util/nterr: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Mon May  2 15:02:56 CEST 2011 on sn-devel-104
    (cherry picked from commit 6dd97ac093ee00281ed029d549d5882d76c2735d)

commit 38ea4e9526528228f04c362a2b3301f84539663f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon May 2 12:41:46 2011 +0200

    s3:libsmb/nterr: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
    
    metze
    (cherry picked from commit 76b3867547dd61d4ac9eda1551945c7c76087f4c)

commit ad8be76e21374df799e6156d013f5f4663c15ddd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon May 2 12:41:46 2011 +0200

    libcli/util/ntstatus: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
    
    metze
    (cherry picked from commit aae1f86952ceea7be0594ca44bf86536fb9aea37)

commit bae2c28276405ff68818a74c140d64101ce72f88
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon May 2 13:50:52 2011 +0200

    talloc: use TC_UNDEFINE_SHRINK_CHUNK() instead of TC_INVALIDATE_SHRINK_CHUNK() for realloc path
    
    If we optimize on top of raw realloc() we need
    TC_INVALIDATE_SHRINK_CHUNK together with TC_UNDEFINE_GROW_CHUNK
    (with was missing and caused false positive valgrind warnings).
    
    But that is really slow, as we do a lot of talloc_realloc calls in samba.
    
    That's why we only to TC_UNDEFINE_SHRINK_CHUNK() for now.
    
    metze
    (cherry picked from commit f0f5ac18e55062dcde28003cebc09fa3eb6ae6a5)

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

Summary of changes:
 lib/talloc/talloc.c         |   37 ++++++++++++++++++++++++++++++++++++-
 libcli/util/ntstatus.h      |    2 ++
 source3/libsmb/nterr.c      |    2 ++
 source4/libcli/util/nterr.c |    2 ++
 4 files changed, 42 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 91452bf..2a956dc 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -178,6 +178,32 @@ static struct {
 	TC_INVALIDATE_SHRINK_VALGRIND_CHUNK(_tc, _new_size); \
 } while (0)
 
+#define TC_UNDEFINE_SHRINK_FILL_CHUNK(_tc, _new_size) do { \
+	if (unlikely(talloc_fill.enabled)) { \
+		size_t _flen = (_tc)->size - (_new_size); \
+		char *_fptr = (char *)TC_PTR_FROM_CHUNK(_tc); \
+		_fptr += (_new_size); \
+		memset(_fptr, talloc_fill.fill_value, _flen); \
+	} \
+} while (0)
+
+#if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_UNDEFINED)
+/* Mark the unused bytes as undefined */
+#define TC_UNDEFINE_SHRINK_VALGRIND_CHUNK(_tc, _new_size) do { \
+	size_t _flen = (_tc)->size - (_new_size); \
+	char *_fptr = (char *)TC_PTR_FROM_CHUNK(_tc); \
+	_fptr += (_new_size); \
+	VALGRIND_MAKE_MEM_UNDEFINED(_fptr, _flen); \
+} while (0)
+#else
+#define TC_UNDEFINE_SHRINK_VALGRIND_CHUNK(_tc, _new_size) do { } while (0)
+#endif
+
+#define TC_UNDEFINE_SHRINK_CHUNK(_tc, _new_size) do { \
+	TC_UNDEFINE_SHRINK_FILL_CHUNK(_tc, _new_size); \
+	TC_UNDEFINE_SHRINK_VALGRIND_CHUNK(_tc, _new_size); \
+} while (0)
+
 #if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_UNDEFINED)
 /* Mark the new bytes as undefined */
 #define TC_UNDEFINE_GROW_VALGRIND_CHUNK(_tc, _new_size) do { \
@@ -1365,7 +1391,16 @@ _PUBLIC_ void *_talloc_realloc(const void *context, void *ptr, size_t size, cons
 			}
 			return ptr;
 		} else if ((tc->size - size) < 1024) {
-			TC_INVALIDATE_SHRINK_CHUNK(tc, size);
+			/*
+			 * if we call TC_INVALIDATE_SHRINK_CHUNK() here
+			 * we would need to call TC_UNDEFINE_GROW_CHUNK()
+			 * after each realloc call, which slows down
+			 * testing a lot :-(.
+			 *
+			 * That is why we only mark memory as undefined here.
+			 */
+			TC_UNDEFINE_SHRINK_CHUNK(tc, size);
+
 			/* do not shrink if we have less than 1k to gain */
 			tc->size = size;
 			return ptr;
diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h
index a7fc579..3e7c629 100644
--- a/libcli/util/ntstatus.h
+++ b/libcli/util/ntstatus.h
@@ -601,6 +601,8 @@ typedef uint32_t NTSTATUS;
 #define NT_STATUS_OBJECTID_NOT_FOUND NT_STATUS(0xC0000000 | 0x02F0)
 #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */
 #define NT_STATUS_DOWNGRADE_DETECTED NT_STATUS(0xC0000000 | 0x0388)
+#define NT_STATUS_NO_S4U_PROT_SUPPORT NT_STATUS(0xC0000000 | 0x040A)
+#define NT_STATUS_CROSSREALM_DELEGATION_FAILURE NT_STATUS(0xC0000000 | 0x040B)
 #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */
 #define NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED NT_STATUS(0xC0000000 | 0x20004)
 #define NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX NT_STATUS(0xC0000000 | 0x20026)
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 3219658..e48f221 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -566,6 +566,8 @@ static const nt_err_code_struct nt_errs[] =
 	{ "NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED", NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED },
 	{ "NT_STATUS_OBJECTID_NOT_FOUND", NT_STATUS_OBJECTID_NOT_FOUND },
 	{ "NT_STATUS_DOWNGRADE_DETECTED", NT_STATUS_DOWNGRADE_DETECTED },
+	{ "NT_STATUS_NO_S4U_PROT_SUPPORT", NT_STATUS_NO_S4U_PROT_SUPPORT },
+	{ "NT_STATUS_CROSSREALM_DELEGATION_FAILURE", NT_STATUS_CROSSREALM_DELEGATION_FAILURE },
 	{ "NT_STATUS_INVALID_LOCK_RANGE", NT_STATUS_INVALID_LOCK_RANGE },
 	{ "NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS", NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS },
 	{ "NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION", NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION },
diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c
index ca998bb..99b5191 100644
--- a/source4/libcli/util/nterr.c
+++ b/source4/libcli/util/nterr.c
@@ -569,6 +569,8 @@ static const nt_err_code_struct nt_errs[] =
 	{ "NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED", NT_STATUS_CURRENT_DOMAIN_NOT_ALLOWED },
 	{ "NT_STATUS_OBJECTID_NOT_FOUND", NT_STATUS_OBJECTID_NOT_FOUND },
 	{ "NT_STATUS_DOWNGRADE_DETECTED", NT_STATUS_DOWNGRADE_DETECTED },
+	{ "NT_STATUS_NO_S4U_PROT_SUPPORT", NT_STATUS_NO_S4U_PROT_SUPPORT },
+	{ "NT_STATUS_CROSSREALM_DELEGATION_FAILURE", NT_STATUS_CROSSREALM_DELEGATION_FAILURE },
 	{ "NT_STATUS_INVALID_LOCK_RANGE", NT_STATUS_INVALID_LOCK_RANGE },
 	{ "NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS", NT_STATUS_ERROR_DS_OBJ_STRING_NAME_EXISTS },
 	{ "NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION", NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION },


-- 
Samba Shared Repository


More information about the samba-cvs mailing list