diff options
author | Mark Johnston <markj@FreeBSD.org> | 2019-01-02 15:52:16 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2019-01-02 15:52:16 +0000 |
commit | 438622af062bc61836f46c138292ceab68b335b3 (patch) | |
tree | a254930cf875ee96ee322c9f3cf51b237fb3b9a8 /sys/geom/mirror/g_mirror.c | |
parent | 9bfc7fa41dbe87e6838a3d17f28b3953c0be3dbd (diff) | |
download | src-438622af062bc61836f46c138292ceab68b335b3.tar.gz src-438622af062bc61836f46c138292ceab68b335b3.zip |
Use g_handleattr() to reply to GEOM::candelete queries.
g_handleattr() fills out bp->bio_completed; otherwise, g_getattr()
returns an error in response to the query. This caused BIO_DELETE
support to not be propagated through stacked configurations, e.g.,
a gconcat of gmirror volumes would not handle BIO_DELETE even when
the gmirrors do. g_io_getattr() was not affected by the problem.
PR: 232676
Reported and tested by: noah.bergbauer@tum.de
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=342687
Diffstat (limited to 'sys/geom/mirror/g_mirror.c')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 125f81b98e6a..5ccb8362e19a 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -1086,16 +1086,15 @@ g_mirror_candelete(struct bio *bp) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - int *val; + int val; sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; } - val = (int *)bp->bio_data; - *val = (disk != NULL); - g_io_deliver(bp, 0); + val = disk != NULL; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void |