When mounting a UFS filesystem, return EINTEGRITY rather than EIO

when a superblock check-hash error is detected. This change clarifies
a mount that failed due to media hardware failures (EIO) from a mount
that failed due to media errors (EINTEGRITY) that can be corrected by
running fsck(8).

Sponsored by: Netflix
This commit is contained in:
mckusick 2020-03-11 21:00:40 +00:00
parent c9814c28fc
commit 91ea5037fd
2 changed files with 5 additions and 1 deletions

View File

@ -307,6 +307,10 @@ No space remains in the mount table.
.It Bq Er EINVAL .It Bq Er EINVAL
The super block for the file system had a bad magic The super block for the file system had a bad magic
number or an out of range block size. number or an out of range block size.
.It Bq Er EINTEGRITY
The super block for the file system had a bad check hash.
The check hash can usually be corrected by running
.Xr fsck 8 .
.It Bq Er ENOMEM .It Bq Er ENOMEM
Not enough memory was available to read the cylinder Not enough memory was available to read the cylinder
group information for the file system. group information for the file system.

View File

@ -416,7 +416,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk,
return (0); return (0);
} }
fs->fs_fmod = 0; fs->fs_fmod = 0;
return (EINVAL); return (EINTEGRITY);
} }
/* Have to set for old filesystems that predate this field */ /* Have to set for old filesystems that predate this field */
fs->fs_sblockactualloc = sblockloc; fs->fs_sblockactualloc = sblockloc;