diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-09-23 15:28:17 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-01-18 00:58:15 -0500 |
commit | 7c4bbd8f052af2b2be84293ddeff0d36e35b5a8f (patch) | |
tree | cdb1e0731a7da44cfaa44810e9a29771497d9c47 | |
parent | 4d2dcb56d276aff8ed0a730152dcbeda32257da8 (diff) | |
download | e2fsprogs-7c4bbd8f052af2b2be84293ddeff0d36e35b5a8f.tar.gz |
tune2fs: print error message when closing the fs fails
I encountered an I/O error on writing the superblock on a drive:
...
pwrite64(3, ..., 114688, 97844727808) = 114688
fsync(3) = -1 EIO (Input/output error)
close(3) = 0
...
The error was silently ignored, only indicated by the exit value. Let's
print an error message.
The error message was taken from mke2fs in order to reuse the
translations.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | misc/tune2fs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c index f3ce443ca..b1e49b37c 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -3450,5 +3450,13 @@ closefs: if (feature_64bit) convert_64bit(fs, feature_64bit); - return (ext2fs_close_free(&fs) ? 1 : rc); + + retval = ext2fs_close_free(&fs); + if (retval) { + com_err("tune2fs", retval, + _("while writing out and closing file system")); + rc = 1; + } + + return rc; } |