From 3d12eaaa97fd5a1ab7ba1e0a523d766339025838 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 11 Jun 2011 10:17:54 +0200 Subject: [PATCH] More precise error message if a file is modified. --- sync.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sync.c b/sync.c index 530984cb..f66f1bfc 100644 --- a/sync.c +++ b/sync.c @@ -152,8 +152,13 @@ static int state_sync_process(struct snapraid_state* state, int parity_f, int qa || handle[j].st.st_mtime != block_file_get(block)->mtime || handle[j].st.st_ino != block_file_get(block)->inode ) { - fprintf(stderr, "Unexpected change at file '%s'.\n", handle[j].path); - fprintf(stderr, "WARNING! You cannot modify data disk during a sync. Rerun the sync command when finished.\n"); + if (handle[j].st.st_size != block_file_get(block)->size) + fprintf(stderr, "Unexpected size change at file '%s'.\n", handle[j].path); + else if (handle[j].st.st_mtime != block_file_get(block)->mtime) + fprintf(stderr, "Unexpected time change at file '%s'.\n", handle[j].path); + else + fprintf(stderr, "Unexpected inode change from %"PRIu64" to %"PRIu64" at file '%s'.\n", block_file_get(block)->inode, handle[j].st.st_ino, handle[j].path); + fprintf(stderr, "WARNING! You cannot modify files during a sync. Rerun the sync command when finished.\n"); fprintf(stderr, "Stopping at block %u\n", i); ++unrecoverable_error; goto bail;