]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - lib/ext2fs/unix_io.c
libext2fs: don't ignore fsync errors
authorEric Sandeen <sandeen@redhat.com>
Tue, 20 Dec 2016 15:23:29 +0000 (09:23 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 13 Jan 2017 17:31:00 +0000 (12:31 -0500)
commit025d31b17a67953ce96741588bd911e6e66b6e03
tree5e19af717c1a54364780a1ad13eca30f49bbdc47
parenta7ec7532e48660a0239aa8938f22a6b0d90864ab
libext2fs: don't ignore fsync errors

Today, if mke2fs experiences IO errors (say, on a thin device
which filled up during mkfs), mke2fs is silent and returns
success even though the filesystem was not properly created.

Catch errors from the io_channel_flush() callchain to
fix this up.  Fix formatting of the printed error as
well:

...
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information:
Warning, had trouble writing out superblocks.
# echo $?
5

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/closefs.c
lib/ext2fs/unix_io.c
misc/mke2fs.c