Patchwork [10/11] fs-tests: integck: verify truncation only if -v option was given

login
register
mail settings
Submitter Artem Bityutskiy
Date May 17, 2011, 7:38 a.m.
Message ID <1305617896-23711-11-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/95879/
State New
Headers show

Comments

Artem Bityutskiy - May 17, 2011, 7:38 a.m.
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Currently we always verify holes when truncating, but we have -v switch for
this and should do this only if -v was given.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 tests/fs-tests/integrity/integck.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 84e3bef..2140a1b 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -1082,7 +1082,8 @@  static void file_truncate_info(struct file_info *file, int fd,
 	w->random_seed = MAX_RANDOM_SEED + 1;
 	file->raw_writes = w;
 
-	if (new_length > file->length)
+	if (args.verify_ops && !args.power_cut_mode &&
+	    new_length > file->length)
 		file_check_hole(file, fd, file->length,
 				new_length - file->length);