From 014401912b1f2589c0ea8fdd1db5680863fd08f6 Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Thu, 18 Apr 2024 22:53:10 -0400 Subject: [PATCH] LU-17745 llite: fix the umount panic due to BDI unregister There is a regression in the patch for LU-16954 on the old RHEL kernel (RHEL8.2). When the Lustre is unmounted, the client gets a crash. In LU-16954, to avoid the remount failure, we explicitly unregister the sysfs for the @bdi on the new kernel such as Unbutu 2204 v5.15 kernel. However, this is not needed for the old kernel such RHEL 8.2. In this patch, we remove the explicit unregister for the old kenel to avoid the client crash during unmount. Lustre-change: https://review.whamcloud.com/54850 Lustre-commit: facff17860ff9a577bad0bf8fb932e869475e011 Fixes: dcc1dd39a6 ("LU-16954 llite: add SB_I_CGROUPWB on super block for cgroup") Test-Parameters: clientdistro=ubuntu2204 testlist=sanity-sec Test-Parameters: clientdistro=el8.9 testlist=sanity-sec Signed-off-by: Qian Yingjin Change-Id: Ic6df572744bed8994c08fb1369cc9beccbe2d87a Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55166 Tested-by: jenkins Tested-by: Maloo --- lustre/llite/llite_lib.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index be89fb8..3780072 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1354,16 +1354,12 @@ out_free_cfg: static void ll_bdi_device_unregister(struct backing_dev_info *bdi) { +#if !defined(HAVE_BDI_DEBUG_STATS) && defined(SB_I_CGROUPWB) && \ + !defined(SB_I_PERSB_BDI) if (bdi->dev == NULL) return; -#if defined(SB_I_CGROUPWB) && !defined(SB_I_PERSB_BDI) -#ifdef HAVE_BDI_DEBUG_STATS - debugfs_remove(bdi->debug_stats); - debugfs_remove(bdi->debug_dir); -#else debugfs_remove_recursive(bdi->debug_dir); -#endif device_unregister(bdi->dev); bdi->dev = NULL; #endif -- 1.8.3.1