diff options
author | phk <phk@FreeBSD.org> | 2002-09-27 21:12:47 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-27 21:12:47 +0000 |
commit | 3a17cc7881e25a35f83573bd5088037483956909 (patch) | |
tree | 8e5da9bbbb236d19b8004141879a03c0c83536a0 /sys/geom | |
parent | f0a4656fe324bd391d2057ac5a37d5fecb9371e4 (diff) | |
download | FreeBSD-src-3a17cc7881e25a35f83573bd5088037483956909.zip FreeBSD-src-3a17cc7881e25a35f83573bd5088037483956909.tar.gz |
Setattr should not retry on EBUSY, we could get EBUSY back because
a disklabel modification tries to change an open device, and no
counter-examples exists.
Be less facist about when we can do Setattr, the openmodes of devices
are so loosely managed that the "exclusive" count is almost useless.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_io.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index ac71f66..8489a70 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -172,19 +172,15 @@ g_io_setattr(const char *attr, struct g_consumer *cp, int len, void *ptr) int error; g_trace(G_T_BIO, "bio_setattr(%s)", attr); - do { - bp = g_new_bio(); - bp->bio_cmd = BIO_SETATTR; - bp->bio_done = NULL; - bp->bio_attribute = attr; - bp->bio_length = len; - bp->bio_data = ptr; - g_io_request(bp, cp); - error = biowait(bp, "gsetattr"); - g_destroy_bio(bp); - if (error == EBUSY) - tsleep(&error, 0, "setattr_busy", hz); - } while(error == EBUSY); + bp = g_new_bio(); + bp->bio_cmd = BIO_SETATTR; + bp->bio_done = NULL; + bp->bio_attribute = attr; + bp->bio_length = len; + bp->bio_data = ptr; + g_io_request(bp, cp); + error = biowait(bp, "gsetattr"); + g_destroy_bio(bp); return (error); } @@ -260,8 +256,13 @@ g_io_request(struct bio *bp, struct g_consumer *cp) return (g_io_fail(bp, EPERM)); break; case BIO_SETATTR: - if ((cp->acw == 0) || (cp->ace == 0)) + /* XXX: Should ideally check for (cp->ace == 0) */ + if ((cp->acw == 0)) { + printf("setattr on %s mode (%d,%d,%d)\n", + cp->provider->name, + cp->acr, cp->acw, cp->ace); return (g_io_fail(bp, EPERM)); + } break; default: return (g_io_fail(bp, EPERM)); |