From 976d8b42393070644107bfffdb4fca8e92eee924 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 3 Feb 2009 07:07:13 +0000 Subject: In g_handleattr(), set bp->bio_completed also for the case where len is 0. Otherwise g_getattr() will never succeed when it is handled by g_handleattr_str(). --- sys/geom/geom_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index b9c9d24..b67c0d5 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -882,12 +882,13 @@ g_handleattr(struct bio *bp, const char *attribute, const void *val, int len) } } else if (bp->bio_length == len) { bcopy(val, bp->bio_data, len); - bp->bio_completed = len; } else { printf("%s: %s bio_length %jd len %d -> EFAULT\n", __func__, bp->bio_to->name, (intmax_t)bp->bio_length, len); error = EFAULT; } + if (error == 0) + bp->bio_completed = bp->bio_length; g_io_deliver(bp, error); return (1); } -- cgit v1.1