From: Alex Zhuravlev Date: Sat, 1 Aug 2015 09:28:23 +0000 (+0300) Subject: LU-6938 osd: fix error handling in osd_xattr_list() X-Git-Tag: 2.7.58~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f5f05e31103eca016c59e392c520b24b607f807f LU-6938 osd: fix error handling in osd_xattr_list() in case of buffer overflow, osd_xattr_list() should leave properly: release the semaphore and the cursor. Change-Id: I750183cb083cb87b3d8adae8fb0f41b61e6689e5 Signed-off-by: Alex Zhuravlev Reviewed-on: http://review.whamcloud.com/15828 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_xattr.c b/lustre/osd-zfs/osd_xattr.c index 777fdb0..2b8636b 100644 --- a/lustre/osd-zfs/osd_xattr.c +++ b/lustre/osd-zfs/osd_xattr.c @@ -919,7 +919,7 @@ int osd_xattr_list(const struct lu_env *env, struct dt_object *dt, rc = strlen(za->za_name); if (lb->lb_buf != NULL) { if (counted + rc + 1 > lb->lb_len) - RETURN(-ERANGE); + GOTO(out_fini, rc = -ERANGE); memcpy(lb->lb_buf + counted, za->za_name, rc + 1); }