[sheepdog] [PATCH] sheep: read timestmap with correct size in do_epoch_log_read()

Hitoshi Mitake mitake.hitoshi at gmail.com
Fri Mar 29 13:25:32 CET 2013


do_epoch_log_read() reads timestamp with sizeof(timestamp). But the
size should be sizeof(*timestamp). This would cause problems on 32bit
architectures.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/store.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/store.c b/sheep/store.c
index c5101aa..2a551ba 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -105,8 +105,8 @@ static int do_epoch_log_read(uint32_t epoch, struct sd_node *nodes, int len,
 	nr_nodes = ret / sizeof(struct sd_node);
 
 	if (timestamp) {
-		ret = xread(fd, timestamp, sizeof(timestamp));
-		if (ret != sizeof(timestamp))
+		ret = xread(fd, timestamp, sizeof(*timestamp));
+		if (ret != sizeof(*timestamp))
 			goto err;
 	}
 
-- 
1.7.5.1




More information about the sheepdog mailing list