Whamcloud - gitweb
LU-12685 llite: fix check for mem-alloc failure. 73/35873/3
authorMr NeilBrown <neilb@suse.com>
Thu, 22 Aug 2019 00:07:38 +0000 (10:07 +1000)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Sep 2019 05:12:05 +0000 (05:12 +0000)
A change to allocation of op_data in ll_statahead_thread()
appears to have assumed that OBD_ALLOC_PTR() would set the
pointer to ERR_PTR(-ENOMEM) on failure.  It actually sets
it to NULL, so the test needs to be changed accordingly.

Test-Parameters: trivial
Fixes: ae828cd3b092 ("LU-4684 llite: add lock for dir layout data")
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I37521d2da50d71ed6fa0f9f05b7cfb848f0d47d9
Reviewed-on: https://review.whamcloud.com/35873
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>

index d2ba2b0..92c7ca8 100644 (file)
@@ -1005,8 +1005,8 @@ static int ll_statahead_thread(void *arg)
               sai, parent->d_name.len, parent->d_name.name);
-       if (IS_ERR(op_data))
-               GOTO(out, rc = PTR_ERR(op_data));
+       if (!op_data)
+               GOTO(out, rc = -ENOMEM);
        if (sbi->ll_flags & LL_SBI_AGL_ENABLED)
                ll_start_agl(parent, sai);