From 604c7396b25c8e3a8e3ecf415d9f6f2bf1cbc6fd Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Wed, 15 Jul 2015 11:24:47 +0800 Subject: [PATCH] LU-7025 lfsck: Invalid return value assignment In lfsck_layout_scan_stripes(), the following code section: if (lso == NULL) { struct lu_attr *attr = &info->lti_la; rc = dt_attr_get(env, parent, attr); if (rc != 0) { rc = PTR_ERR(lso); goto next; } ... } When dt_attr_get() returns failure, we should NOT assign the "rc" as "PTR_ERR(lso)", instead, just use the current "rc". Signed-off-by: Fan Yong Change-Id: I8237e1f79588b54c73398f20bd833e81787bf4a6 Reviewed-on: http://review.whamcloud.com/16042 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/lfsck/lfsck_layout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index 5dcd285..5d3c510 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -4274,10 +4274,8 @@ static int lfsck_layout_scan_stripes(const struct lu_env *env, struct lu_attr *attr = &info->lti_la; rc = dt_attr_get(env, parent, attr); - if (rc != 0) { - rc = PTR_ERR(lso); + if (rc != 0) goto next; - } lso = lfsck_assistant_object_init(env, lfsck_dto2fid(parent), attr, -- 1.8.3.1