summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-02 13:10:40 +0000
committerphk <phk@FreeBSD.org>2003-04-02 13:10:40 +0000
commita47b0e4a84090dba8b66931eb8f2b92fb9fcd799 (patch)
treed557f157f4afa32ca6c4f7a6b17e29b434c4f5fe /sys/geom
parent3cfb76c3170d275b22bf539534de8b9f9b483a18 (diff)
downloadFreeBSD-src-a47b0e4a84090dba8b66931eb8f2b92fb9fcd799.zip
FreeBSD-src-a47b0e4a84090dba8b66931eb8f2b92fb9fcd799.tar.gz
Only orphan things if the open/close actually succeeded.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_subr.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 6acf86e..f2c43fe 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -437,18 +437,18 @@ g_access_rel(struct g_consumer *cp, int dcr, int dcw, int dce)
/* Ok then... */
- /*
- * If we open first write, spoil any partner consumers.
- * If we close last write, trigger re-taste.
- */
- if (pp->acw == 0 && dcw != 0)
- g_spoil(pp, cp);
- else if (pp->acw != 0 && pp->acw == -dcw &&
- !(pp->geom->flags & G_GEOM_WITHER))
- g_post_event(EV_NEW_PROVIDER, NULL, NULL, pp, NULL);
-
error = pp->geom->access(pp, dcr, dcw, dce);
if (!error) {
+ /*
+ * If we open first write, spoil any partner consumers.
+ * If we close last write, trigger re-taste.
+ */
+ if (pp->acw == 0 && dcw != 0)
+ g_spoil(pp, cp);
+ else if (pp->acw != 0 && pp->acw == -dcw &&
+ !(pp->geom->flags & G_GEOM_WITHER))
+ g_post_event(EV_NEW_PROVIDER, NULL, NULL, pp, NULL);
+
pp->acr += dcr;
pp->acw += dcw;
pp->ace += dce;
@@ -473,7 +473,6 @@ g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val)
return (g_handleattr(bp, attribute, &val, sizeof val));
}
-
int
g_handleattr(struct bio *bp, const char *attribute, void *val, int len)
{
OpenPOWER on IntegriCloud