diff options
author | Alan Somers <asomers@FreeBSD.org> | 2018-02-14 20:15:32 +0000 |
---|---|---|
committer | Alan Somers <asomers@FreeBSD.org> | 2018-02-14 20:15:32 +0000 |
commit | 0bab7fa8a72a0deea00c99fe7cd77ff20bdbb1c3 (patch) | |
tree | 0b3d89290eb9334c44e87ea52878afb158663f41 /sys/geom | |
parent | 70c144dc782e3148c42698508974edba686d4bde (diff) | |
download | src-0bab7fa8a72a0deea00c99fe7cd77ff20bdbb1c3.tar.gz src-0bab7fa8a72a0deea00c99fe7cd77ff20bdbb1c3.zip |
geli: append "/eli" to the underlying provider's physical path
If the underlying provider's physical path is null, then the geli device's
physical path will be, too. Otherwise, it will append "/eli". This will make
geli work better with zfsd(8).
PR: 224962
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D13979
Notes
Notes:
svn path=/head/; revision=329273
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/eli/g_eli.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index 94ef2d02f183..8b6ed5c0d46c 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -212,6 +212,16 @@ g_eli_crypto_rerun(struct cryptop *crp) return (error); } +static void +g_eli_getattr_done(struct bio *bp) +{ + if (bp->bio_error == 0 && + !strcmp(bp->bio_attribute, "GEOM::physpath")) { + strlcat(bp->bio_data, "/eli", bp->bio_length); + } + g_std_done(bp); +} + /* * The function is called afer reading encrypted data from the provider. * @@ -380,7 +390,10 @@ g_eli_start(struct bio *bp) case BIO_FLUSH: case BIO_DELETE: case BIO_ZONE: - cbp->bio_done = g_std_done; + if (bp->bio_cmd == BIO_GETATTR) + cbp->bio_done = g_eli_getattr_done; + else + cbp->bio_done = g_std_done; cp = LIST_FIRST(&sc->sc_geom->consumer); cbp->bio_to = cp->provider; G_ELI_LOGREQ(2, cbp, "Sending request."); |