Module Name: src Committed By: hannken Date: Thu Mar 13 10:22:35 UTC 2014
Modified Files: src/sys/dev: md.c Log Message: No need to detach (and return EBUSY) if dk_openmask is non-zero. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/md.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/md.c diff -u src/sys/dev/md.c:1.67 src/sys/dev/md.c:1.68 --- src/sys/dev/md.c:1.67 Sat Jun 30 10:52:31 2012 +++ src/sys/dev/md.c Thu Mar 13 10:22:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.67 2012/06/30 10:52:31 tsutsui Exp $ */ +/* $NetBSD: md.c,v 1.68 2014/03/13 10:22:35 hannken Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.67 2012/06/30 10:52:31 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.68 2014/03/13 10:22:35 hannken Exp $"); #ifdef _KERNEL_OPT #include "opt_md.h" @@ -340,6 +340,10 @@ mdclose(dev_t dev, int flag, int fmt, st break; } dk->dk_openmask = dk->dk_copenmask | dk->dk_bopenmask; + if (dk->dk_openmask != 0) { + mutex_exit(&dk->dk_openlock); + return 0; + } mutex_exit(&dk->dk_openlock);