Patchwork [08/11] fs-tests: integck: return error if fsync fails

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

Comments

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

If 'fsync()' or 'fdatasync()' fail we have to return an error, but we by
mistake were returning 0 (success).

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

Patch

diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 81d384f..83706f8 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -1280,6 +1280,8 @@  static int file_write(struct file_info *file, int fd)
 				pcv("fdatasync failed for %s",
 				    get_file_name(file));
 		}
+		if (ret)
+			return -1;
 		file->clean = 1;
 	}