aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2013-10-25 19:19:12 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2013-10-25 19:19:12 +0000
commitd6d78db57f839cad9bb5e100e4a0f249eee5b2a6 (patch)
treedc60ebcf360ca88130b3309ee3dcb548d97af395 /sys/geom/geom_disk.c
parent498fa7c1f9c8fa941e443c8c11c280b1853d8557 (diff)
Reject attempts to attack a disk device that has the old NEEDSGIANT
flag set. Reviewed by: mav
Notes
Notes: svn path=/head/; revision=257131
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index d7fa43ab421c..effc3b773314 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -657,6 +657,13 @@ disk_create(struct disk *dp, int version)
dp->d_name, dp->d_unit);
return;
}
+ if (dp->d_flags & DISKFLAG_RESERVED) {
+ printf("WARNING: Attempt to add non-MPSAFE disk %s%d\n",
+ dp->d_name, dp->d_unit);
+ printf("WARNING: Ignoring disk %s%d\n",
+ dp->d_name, dp->d_unit);
+ return;
+ }
KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy"));
KASSERT(dp->d_name != NULL, ("disk_create need d_name"));
KASSERT(*dp->d_name != 0, ("disk_create need d_name"));