[master] d49f707 Sync the complete sign area on smp_sync_sign

Martin Blix Grydeland martin at varnish-cache.org
Wed Oct 10 09:49:18 CEST 2012


commit d49f707a5d7e76d484d1d8923dae06f0cfdaac7a
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue May 29 13:34:59 2012 +0200

    Sync the complete sign area on smp_sync_sign

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 */
 };
 



More information about the varnish-commit mailing list