Thread (4 messages) 4 messages, 2 authors, 2016-12-07
STALE3498d

[PATCH 2/2] ext2fs: check fsync error code

From: Dmitry Monakhov <hidden>
Date: 2016-12-07 13:31:59
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

testcase: f_mke2fs_baddisk
Signed-off-by: Dmitry Monakhov <redacted>
---
 lib/ext2fs/unix_io.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 429ea24..6c54cbe 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -1030,7 +1030,10 @@ static errcode_t unix_flush(io_channel channel)
 #ifndef NO_IO_CACHE
 	retval = flush_cached_blocks(channel, data, 0);
 #endif
-	fsync(data->dev);
+	if(fsync(data->dev)) {
+		if (!retval)
+			retval = errno;
+	}
 	return retval;
 }
 
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help