Whamcloud - gitweb
LU-6434 ofd: object reference leaks in ofd_preprw_write 70/14370/2
authorLi Xi <lixi@ddn.com>
Mon, 6 Apr 2015 13:28:31 +0000 (21:28 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 9 Apr 2015 03:23:15 +0000 (03:23 +0000)
In ofd_preprw_write(), the object should be released when an
error happenes.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Icd143f994d63c97472fb7d24cb9517da516280b7
Reviewed-on: http://review.whamcloud.com/14370
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ofd/ofd_io.c

index f46a916..177f58b 100644 (file)
@@ -649,6 +649,7 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
 err:
        dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
        ofd_read_unlock(env, fo);
 err:
        dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
        ofd_read_unlock(env, fo);
+       ofd_object_put(env, fo);
        /* ofd_grant_prepare_write() was called, so we must commit */
        ofd_grant_commit(env, exp, rc);
 out:
        /* ofd_grant_prepare_write() was called, so we must commit */
        ofd_grant_commit(env, exp, rc);
 out: