[PATCH 04/13] Sync the complete sign area on smp_sync_sign

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 1 12:26:11 CEST 2012


---
 bin/varnishd/storage/storage_persistent_subr.c |    2 +-
 include/persistent.h                           |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/varnishd/storage/storage_persistent_subr.c b/bin/varnishd/storage/storage_persistent_subr.c
index f7c748e..9933541 100644
--- a/bin/varnishd/storage/storage_persistent_subr.c
+++ b/bin/varnishd/storage/storage_persistent_subr.c
@@ -159,7 +159,7 @@ smp_sync_sign(const struct smp_signctx *ctx)
 	int i;
 
 	/* XXX: round to pages */
-	i = msync((void*)ctx->ss, ctx->ss->length + SHA256_LEN, MS_SYNC);
+	i = msync((void*)ctx->ss, ctx->ss->length + SMP_SIGN_SPACE, MS_SYNC);
 	if (i && 0)
 		fprintf(stderr, "SyncSign(%p %s) = %d %s\n",
 		    ctx->ss, ctx->id, i, strerror(errno));
diff --git a/include/persistent.h b/include/persistent.h
index ff9207e..f0cb7f5 100644
--- a/include/persistent.h
+++ b/include/persistent.h
@@ -111,6 +111,8 @@ struct smp_sign {
 	char			ident[8];
 	uint32_t		unique;
 	uint64_t		mapped;
+	/* The length field is the length of the signed data only
+	 * (does not include struct smp_sign) */
 	uint64_t		length;		/* NB: Must be last */
 };
 
-- 
1.7.9.5




More information about the varnish-dev mailing list