From 1c95720b285aac9770a7ffa62c91040174dd68b8 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Wed, 27 Jan 2010 11:49:59 -0800 Subject: [PATCH] Flush file blocks to storage before the inode. Otherwise, some blocks might not have been assigned a name and so seriaizing the inode will lose data. --- bluesky/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bluesky/inode.c b/bluesky/inode.c index a052fb4..3c6fa3c 100644 --- a/bluesky/inode.c +++ b/bluesky/inode.c @@ -232,13 +232,13 @@ void bluesky_inode_start_sync(BlueSkyInode *inode, BlueSkyStoreAsync *barrier) { BlueSkyFS *fs = inode->fs; + if (inode->type == BLUESKY_REGULAR) + bluesky_file_flush(inode, barrier); + GString *buf = g_string_new(""); bluesky_serialize_inode(buf, inode); BlueSkyRCStr *data = bluesky_string_new_from_gstring(buf); - if (inode->type == BLUESKY_REGULAR) - bluesky_file_flush(inode, barrier); - char key[64]; sprintf(key, "inode-%016"PRIx64, inode->inum); -- 2.20.1