diff options
author | marcel <marcel@FreeBSD.org> | 2009-02-03 07:07:13 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-02-03 07:07:13 +0000 |
commit | 976d8b42393070644107bfffdb4fca8e92eee924 (patch) | |
tree | 6ada64c196a49f2aa501eedfbdb502f883b3ae54 /sys/geom/geom_subr.c | |
parent | a6e2805c4b56188fa1b2d482e8366c299c456114 (diff) | |
download | FreeBSD-src-976d8b42393070644107bfffdb4fca8e92eee924.zip FreeBSD-src-976d8b42393070644107bfffdb4fca8e92eee924.tar.gz |
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().
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r-- | sys/geom/geom_subr.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |