diff options
author | phk <phk@FreeBSD.org> | 1999-09-20 17:04:39 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-09-20 17:04:39 +0000 |
commit | 9099b1bf20932c2e0c9c759308946a5702d6911a (patch) | |
tree | e986038d9d0d227299ddad25374893b766a47895 /sys/kern/subr_diskslice.c | |
parent | 19d447ede456df41e0e64646f33a6c084e813eb6 (diff) | |
download | FreeBSD-src-9099b1bf20932c2e0c9c759308946a5702d6911a.zip FreeBSD-src-9099b1bf20932c2e0c9c759308946a5702d6911a.tar.gz |
Add a DSO_BAD144 flag which indicates that the driver actually understand
BAD144 handling.
Reject DIOCSBAD and labels with BAD144 tables if the driver cannot grok it.
Reviewed by: bde
Diffstat (limited to 'sys/kern/subr_diskslice.c')
-rw-r--r-- | sys/kern/subr_diskslice.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 439496c..34225b8 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -429,6 +429,8 @@ dsioctl(dev, cmd, data, flags, sspp) return (0); case DIOCSBAD: + if ((ssp->dss_oflags & DSO_BAD144) == 0) + return (ENODEV); if (slice == WHOLE_DISK_SLICE) return (ENODEV); if (!(flags & FWRITE)) @@ -829,11 +831,17 @@ dsopen(dev, mode, flags, sspp, lp) continue; } if (lp1->d_flags & D_BADSECT) { + if ((flags & DSO_BAD144) == 0) { + log(LOG_ERR, + "%s: bad sector table no supported\n", + sname); + continue; + } btp = malloc(sizeof *btp, M_DEVBUF, M_WAITOK); TRACE(("readbad144\n")); msg = readbad144(dev1, lp1, btp); if (msg != NULL) { - log(LOG_WARNING, + log(LOG_ERR, "%s: cannot find bad sector table (%s)\n", sname, msg); free(btp, M_DEVBUF); |