daprobedone: announce if a disk is write-protected

MFC after:	2 weeks
This commit is contained in:
avg 2018-12-07 12:02:31 +00:00
parent ab139270f3
commit c1fb81f798

View File

@ -2472,6 +2472,11 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
printf("%s%d: %s\n", periph->periph_name,
periph->unit_number, buf);
}
if ((softc->disk->d_flags & DISKFLAG_WRITE_PROTECT) != 0 &&
(softc->flags & DA_FLAG_ANNOUNCED) == 0) {
printf("%s%d: Write Protected\n", periph->periph_name,
periph->unit_number);
}
/*
* Since our peripheral may be invalidated by an error