summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror/g_mirror.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-11-09 23:15:40 +0000
committerpjd <pjd@FreeBSD.org>2004-11-09 23:15:40 +0000
commita2d5ae235db70465d84ce92765d3ed0ae37f28c0 (patch)
tree4761fe10bb69211f066b5cc05d16ad8f7b72cf1a /sys/geom/mirror/g_mirror.c
parent8fe1c8565771b852ee289cd3aa35ade92db714f7 (diff)
downloadFreeBSD-src-a2d5ae235db70465d84ce92765d3ed0ae37f28c0.zip
FreeBSD-src-a2d5ae235db70465d84ce92765d3ed0ae37f28c0.tar.gz
Don't rely on DIRTY flag to be sure that consumer if open, because
DIRTY flag can be removed in idle process. Use consumer's acw field instead to avoid opening consumer twice.
Diffstat (limited to 'sys/geom/mirror/g_mirror.c')
-rw-r--r--sys/geom/mirror/g_mirror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 750aa05..192e415 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -584,7 +584,7 @@ g_mirror_write_metadata(struct g_mirror_disk *disk,
/*
* Open consumer if it wasn't opened and remember to close it.
*/
- if ((disk->d_flags & G_MIRROR_DISK_FLAG_DIRTY) == 0) {
+ if (cp->acw == 0) {
error = g_access(cp, 0, 1, 1);
G_MIRROR_DEBUG(2, "Access %s r%dw%de%d = %d",
cp->provider->name, 0, 1, 1, error);
OpenPOWER on IntegriCloud