From c8a022ad299bd61bc4ab6d2048e97908764eabb2 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Fri, 14 Mar 2014 13:37:41 -0500 Subject: [PATCH] LU-4718 osp: clear oxe_ready on old oxe In osp_xattr_get() and osp_declare_xattr_set() avoid NULL pointer deferences in the error handling cases by clearing oxe_ready on the old xattr cache entries. Signed-off-by: John L. Hammond Change-Id: I54f69e2d3e6570528e5a26bc9dd6e079a773a1a8 Reviewed-on: http://review.whamcloud.com/9672 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Alex Zhuravlev Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/osp/osp_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/osp/osp_object.c b/lustre/osp/osp_object.c index 4658f48..f30c9d3 100644 --- a/lustre/osp/osp_object.c +++ b/lustre/osp/osp_object.c @@ -753,7 +753,7 @@ unlock: "cache for "DFID": rc = %d\n", dname, name, PFID(lu_object_fid(&dt->do_lu)), rc); spin_lock(&obj->opo_lock); - oxe->oxe_ready = 0; + old->oxe_ready = 0; spin_unlock(&obj->opo_lock); GOTO(out, rc); @@ -840,7 +840,7 @@ int osp_declare_xattr_set(const struct lu_env *env, struct dt_object *dt, ": rc = %d\n", dt->do_lu.lo_dev->ld_obd->obd_name, name, PFID(lu_object_fid(&dt->do_lu)), rc); spin_lock(&o->opo_lock); - oxe->oxe_ready = 0; + old->oxe_ready = 0; spin_unlock(&o->opo_lock); return 0; -- 1.8.3.1