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>
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;