aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_disk.h
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>2005-11-18 02:43:49 +0000
committerJohn Polstra <jdp@FreeBSD.org>2005-11-18 02:43:49 +0000
commita7e69e8b7d62aefe035142c60657c336046a3f6f (patch)
treefd8fdcdbe252a0fea49dd01324b56a12740040f9 /sys/geom/geom_disk.h
parentd1bb0919f0cc1b2d5eedb527b3b749c1e3db7c8f (diff)
downloadsrc-a7e69e8b7d62aefe035142c60657c336046a3f6f.tar.gz
src-a7e69e8b7d62aefe035142c60657c336046a3f6f.zip
Fix a bug that caused some /dev entries to continue to exist after
the underlying drive had been hot-unplugged from the system. Here is a specific example. Filesystem code had opened /dev/da1s1e. Subsequently, the drive was hot-unplugged. This (correctly) caused all of the associated /dev/da1* entries to be deleted. When the filesystem later realized that the drive was gone it closed the device, reducing the write-access counts to 0 on the geom providers for da1s1e, da1s1, and da1. This caused geom to re-taste the providers, resulting in the devices being created again. When the drive was hot-plugged back in, it resulted in duplicate /dev entries for da1s1e, da1s1, and da1. This fix adds a new disk_gone() function which is called by CAM when a drive goes away. It orphans all of the providers associated with the drive, setting an error condition of ENXIO in each one. In addition, we prevent a re-taste on last close for writing if an error condition has been set in the provider. Sponsored by: Isilon Systems Reviewed by: phk MFC after: 1 week
Notes
Notes: svn path=/head/; revision=152565
Diffstat (limited to 'sys/geom/geom_disk.h')
-rw-r--r--sys/geom/geom_disk.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.h b/sys/geom/geom_disk.h
index 42f5b60e3cc3..23719bf1288b 100644
--- a/sys/geom/geom_disk.h
+++ b/sys/geom/geom_disk.h
@@ -95,6 +95,7 @@ struct disk {
struct disk *disk_alloc(void);
void disk_create(struct disk *disk, int version);
void disk_destroy(struct disk *disk);
+void disk_gone(struct disk *disk);
#define DISK_VERSION_00 0x58561059
#define DISK_VERSION DISK_VERSION_00