]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: return error if fsync fails
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 17 May 2011 03:26:45 +0000 (06:26 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 20 May 2011 09:48:42 +0000 (12:48 +0300)
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

index 81d384f64ef972966e332abd60fdce4d40e30d23..83706f8f1dc1d84742935fc76e3e92a8ddddb16f 100644 (file)
@@ -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;
        }