From 3d43658fc36e5821d8b094c1c2365e9520dbe9fe Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Wed, 9 Jan 2019 15:43:59 -0500 Subject: [PATCH] LU-11845 osd-zfs: Support encrypted ZFS datasets Call zfs::dmu_objset_own and zfs::dmu_objset_disown with decrypt=B_TRUE This is called the same way as in zfs modules. Fixes: 0fedb017c1 ("LU-9890 osd-zfs: dmu_objset_own/disown changes") Test-Parameters: envdefinitions=ZFS_MKFS_OPTS="encryption=on -o keylocation=file:///etc/adjtime -o keyformat=passphrase" testlist=sanity fstype=zfs Signed-off-by: Nathaniel Clark Change-Id: I1d9bc1a579ac26706a9f6cc5a0d52649ce005228 Reviewed-on: https://review.whamcloud.com/33999 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- lustre/osd-zfs/osd_handler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index b224c59..9f23711 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -904,7 +904,7 @@ static int osd_objset_open(struct osd_device *o) rc = -osd_dmu_objset_own(o->od_mntdev, DMU_OST_ZFS, o->od_dt_dev.dd_rdonly ? B_TRUE : B_FALSE, - B_FALSE, o, &o->od_os); + B_TRUE, o, &o->od_os); if (rc) { CERROR("%s: can't open %s\n", o->od_svname, o->od_mntdev); @@ -969,7 +969,7 @@ static int osd_objset_open(struct osd_device *o) out: if (rc != 0 && o->od_os != NULL) { - osd_dmu_objset_disown(o->od_os, B_FALSE, o); + osd_dmu_objset_disown(o->od_os, B_TRUE, o); o->od_os = NULL; } @@ -1202,7 +1202,7 @@ static int osd_mount(const struct lu_env *env, osd_unlinked_drain(env, o); err: if (rc && o->od_os) { - osd_dmu_objset_disown(o->od_os, B_FALSE, o); + osd_dmu_objset_disown(o->od_os, B_TRUE, o); o->od_os = NULL; } @@ -1249,7 +1249,7 @@ static void osd_umount(const struct lu_env *env, struct osd_device *o) txg_wait_synced(dmu_objset_pool(o->od_os), 0ULL); /* close the object set */ - osd_dmu_objset_disown(o->od_os, B_FALSE, o); + osd_dmu_objset_disown(o->od_os, B_TRUE, o); o->od_os = NULL; } -- 1.8.3.1