From: Olaf Faaland Date: Mon, 21 Mar 2016 20:32:23 +0000 (-0700) Subject: LU-7893 osd-zfs: calls dmu_objset_disown() with NULL X-Git-Tag: 2.8.51~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F19052%2F2;p=fs%2Flustre-release.git LU-7893 osd-zfs: calls dmu_objset_disown() with NULL 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 Change-Id: I04ce39fbf97a87978c5819731ee1eba9debe6db2 Reviewed-on: http://review.whamcloud.com/19052 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 9c19163..43ae76d 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -1028,7 +1028,8 @@ static int osd_mount(const struct lu_env *env, 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; }