diff options
author | Karel Zak | 2017-10-02 13:44:29 +0200 |
---|---|---|
committer | Karel Zak | 2017-10-02 13:44:29 +0200 |
commit | e8365fc1c68a28a8df0d5df3b03fa0eda05b05bc (patch) | |
tree | e503766042ab54b24f866ddc5e3c9cd5e391ad20 /libmount | |
parent | Merge branch 'fix-python_libmount_get_propagation' of https://github.com/gius... (diff) | |
download | kernel-qcow2-util-linux-e8365fc1c68a28a8df0d5df3b03fa0eda05b05bc.tar.gz kernel-qcow2-util-linux-e8365fc1c68a28a8df0d5df3b03fa0eda05b05bc.tar.xz kernel-qcow2-util-linux-e8365fc1c68a28a8df0d5df3b03fa0eda05b05bc.zip |
libmount: add human compatible message for EBADMSG errno
mount: /media/sdb5: mount(2) system call failed: Bad message.
is really ugly for end users. It seems XFS, extN (etc) use EBADMSG for
bad checksums. For network or pseudo filesystems continue to use "Bad
message" error...
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1496764
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount')
-rw-r--r-- | libmount/src/context_mount.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index e84947f00..8ef806314 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -1578,6 +1578,14 @@ int mnt_context_get_mount_excode( snprintf(buf, bufsz, _("no medium found on %s"), src); break; + case EBADMSG: + /* Bad CRC for classic filesystems (e.g. extN or XFS) */ + if (buf && (S_ISBLK(st.st_mode) || S_ISREG(st.st_mode))) { + snprintf(buf, bufsz, _("cannot mount; probably corrupted filesystem on %s"), src); + break; + } + /* fallthrough */ + default: if (buf) { errno = syserr; |