Whamcloud - gitweb
LU-7893 osd-zfs: calls dmu_objset_disown() with NULL 52/19052/2
authorOlaf Faaland <faaland1@llnl.gov>
Mon, 21 Mar 2016 20:32:23 +0000 (13:32 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 28 Mar 2016 18:46:26 +0000 (18:46 +0000)
When a ZFS-backed target is mounted, and dmu_objset_own() fails,
osd_mount() follows a goto err: and calls dmu_objset_disown(NULL).
This triggers a kernel panic due to NULL pointer dereference.

Call dmu_objset_disown() only if objset_t o->od_os is non-NULL.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Change-Id: I04ce39fbf97a87978c5819731ee1eba9debe6db2
Reviewed-on: http://review.whamcloud.com/19052
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_handler.c

index 9c19163..43ae76d 100644 (file)
@@ -1028,7 +1028,8 @@ static int osd_mount(const struct lu_env *env,
        osd_unlinked_drain(env, o);
 err:
        if (rc) {
        osd_unlinked_drain(env, o);
 err:
        if (rc) {
-               dmu_objset_disown(o->od_os, o);
+               if (o->od_os)
+                       dmu_objset_disown(o->od_os, o);
                o->od_os = NULL;
        }
 
                o->od_os = NULL;
        }