From: Mr NeilBrown Date: Thu, 22 Aug 2019 00:07:38 +0000 (+1000) Subject: LU-12685 llite: fix check for mem-alloc failure. X-Git-Tag: 2.12.58~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0f6302471fd2344aaac58a3b12af2ae108b57f90 LU-12685 llite: fix check for mem-alloc failure. 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 Change-Id: I37521d2da50d71ed6fa0f9f05b7cfb848f0d47d9 Reviewed-on: https://review.whamcloud.com/35873 Tested-by: jenkins Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Tested-by: Maloo --- diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index d2ba2b0..92c7ca8 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1005,8 +1005,8 @@ static int ll_statahead_thread(void *arg) sai, parent->d_name.len, parent->d_name.name); OBD_ALLOC_PTR(op_data); - 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);