Whamcloud - gitweb
LU-7025 lfsck: Invalid return value assignment 42/16042/2
authorFan Yong <fan.yong@intel.com>
Wed, 15 Jul 2015 03:24:47 +0000 (11:24 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 24 Aug 2015 15:31:08 +0000 (15:31 +0000)
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 <fan.yong@intel.com>
Change-Id: I8237e1f79588b54c73398f20bd833e81787bf4a6
Reviewed-on: http://review.whamcloud.com/16042
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lfsck/lfsck_layout.c

index 5dcd285..5d3c510 100644 (file)
@@ -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,