From 16b9bd70e1b6353c9f6850e3be91cb8255aec7e6 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Thu, 13 Feb 2025 15:37:10 +0800 Subject: [PATCH] LU-18718 llite: cl_file_inode_init() only for regular file cl_file_inode_init() only applies to regular files, so we'd avoid LBUG-ing it if the pre-condition is not met. cl_file_inode_init()) ASSERTION((((inode->i_mode) & 00170000) == 0100000)) failed: Call Trace: dump_stack+0x41/0x60 lbug_with_loc.cold.8+0x5/0x58 [libcfs] cl_file_inode_init+0x216/0x390 [lustre] ll_update_inode+0x44f/0x710 [lustre] ll_iget+0x228/0x320 [lustre] ll_prep_inode+0x3e5/0xa10 [lustre] ll_lookup_it_finish.constprop.32+0xce/0x10a0 [lustre] ll_lookup_it+0x82f/0x1840 [lustre] ll_lookup_nd+0x112/0x1c0 [lustre] __lookup_hash+0x75/0xa0 do_unlinkat+0x156/0x300 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x66/0xcb Signed-off-by: Bobi Jam Change-Id: I7fef2645ef040cb3c3fd6e4ece062e1c9ab64327 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58057 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Qian Yingjin Reviewed-by: Oleg Drokin --- lustre/llite/lcommon_cl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/llite/lcommon_cl.c b/lustre/llite/lcommon_cl.c index 027a0ad..1169544 100644 --- a/lustre/llite/lcommon_cl.c +++ b/lustre/llite/lcommon_cl.c @@ -127,8 +127,8 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md) int result = 0; __u16 refcheck; - LASSERT(md->body->mbo_valid & OBD_MD_FLID); - LASSERT(S_ISREG(inode->i_mode)); + if (!(md->body->mbo_valid & OBD_MD_FLID) || !S_ISREG(inode->i_mode)) + return 0; env = cl_env_get(&refcheck); if (IS_ERR(env)) -- 1.8.3.1