From 82c4663b12552e382cbc059bae1cbb871b3c5941 Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Wed, 11 Mar 2020 01:14:45 +0800 Subject: [PATCH] LU-13349 llite: statahead should skip entry while fid changed The fid could change in the Statahead, so the entry should be skipped in such case. (lcommon_cl.c:147:cl_file_inode_init()) ASSERTION( (((inode->i_mode) & 00170000) == 0100000) ) failed: kernel: LustreError:(lcommon_cl.c:147:cl_file_inode_init()) LBUG kernel: Pid: 106684, comm: ll_sa_94894 3.10.0-957.el7.x86_64 #1 kernel: Call Trace: kernel: [] libcfs_call_trace+0x8c/0xc0 [libcfs] kernel: [] lbug_with_loc+0x4c/0xa0 [libcfs] kernel: [] cl_file_inode_init+0x2f6/0x380 [lustre] kernel: [] ll_update_inode+0x2d5/0x5e0 [lustre] kernel: [] ll_iget+0x253/0x350 [lustre] kernel: [] ll_prep_inode+0x262/0x930 [lustre] kernel: [] sa_handle_callback+0x37c/0x9d0 [lustre] kernel: [] ll_statahead_thread+0x4d6/0x1c60 [lustre] kernel: [] kthread+0xd1/0xe0 kernel: [] ret_from_fork_nospec_begin+0x7/0x21 Signed-off-by: Yang Sheng Change-Id: Ieee99cc935a111cf05f65b64512b546d2e9b3c74 Reviewed-on: https://review.whamcloud.com/37868 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexander Boyko Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/llite/statahead.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index 749640e..2adb72d 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -658,14 +658,14 @@ static void sa_instantiate(struct ll_statahead_info *sai, GOTO(out, rc = -EFAULT); child = entry->se_inode; - if (child) { - /* revalidate; unlinked and re-created with the same name */ - if (unlikely(!lu_fid_eq(&minfo->mi_data.op_fid2, - &body->mbo_fid1))) { + /* revalidate; unlinked and re-created with the same name */ + if (unlikely(!lu_fid_eq(&minfo->mi_data.op_fid2, &body->mbo_fid1))) { + if (child) { entry->se_inode = NULL; iput(child); - child = NULL; } + /* The mdt_body is invalid. Skip this entry */ + GOTO(out, rc = -EAGAIN); } it->it_lock_handle = entry->se_handle; -- 1.8.3.1