ll_update_lsm_md() should reset md->lmv to NULL
right after it is assigned to lli_lsm_md, otherwise
it might be double freed if failure happens.
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I4f069e3445a957860c2853c6f32104885edc33fa
Reviewed-on: http://review.whamcloud.com/16382
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
if (rc != 0)
RETURN(rc);
+ /* set md->lmv to NULL, so the following free lustre_md
+ * will not free this lsm */
+ md->lmv = NULL;
lli->lli_lsm_md = lsm;
OBD_ALLOC_PTR(attr);
OBD_FREE_PTR(attr);
-
- /* set lsm_md to NULL, so the following free lustre_md
- * will not free this lsm */
- md->lmv = NULL;
CDEBUG(D_INODE, "Set lsm %p magic %x to "DFID"\n", lsm,
lsm->lsm_md_magic, PFID(ll_inode2fid(inode)));
RETURN(0);