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

Submitted by Artem Bityutskiy on May 17, 2011, 7:38 a.m.

Details

Message ID 1305617896-23711-9-git-send-email-dedekind1@gmail.com
State Accepted
Commit d1446aa7c64113d0822f9a04326e417d60ae34c2
Headers show

Commit Message

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 hide | download patch | download mbox

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;
 	}