From f5f05e31103eca016c59e392c520b24b607f807f Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Sat, 1 Aug 2015 12:28:23 +0300 Subject: [PATCH] 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 --- lustre/osd-zfs/osd_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 1.8.3.1