From 337d720360c743809e7e6a1161ae07a352c26915 Mon Sep 17 00:00:00 2001 From: bobijam Date: Wed, 21 Oct 2009 09:52:22 +0000 Subject: [PATCH] Branch b1_8 b=20592 i=johann i=andrew.perepechko (panda) use kthread_run() instead of kernel_thread() so that log dumper won't stuck in do_exit(). --- lustre/llite/file.c | 15 +++++++++------ lustre/tests/sanity.sh | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 9f8e413..fc45f8c 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -255,7 +255,6 @@ int ll_file_release(struct inode *inode, struct file *file) CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino, inode->i_generation, inode); - if (inode->i_sb->s_root != file->f_dentry) ll_stats_ops_tally(sbi, LPROC_LL_RELEASE, 1); fd = LUSTRE_FPRIVATE(file); @@ -278,6 +277,10 @@ int ll_file_release(struct inode *inode, struct file *file) lli->lli_async_rc = 0; rc = ll_mdc_close(sbi->ll_mdc_exp, inode, file); + + if (OBD_FAIL_TIMEOUT_MS(OBD_FAIL_PTLRPC_DUMP_LOG, obd_fail_val)) + libcfs_debug_dumplog(); + RETURN(rc); } @@ -1512,8 +1515,8 @@ repeat: down_read(&lli->lli_truncate_rwsem); /* Bug 18233 */ - ltd.lock_style = ll_file_get_lock(file, (obd_off)(*ppos), end, - iov_copy, nrsegs_copy, + ltd.lock_style = ll_file_get_lock(file, (obd_off)(*ppos), end, + iov_copy, nrsegs_copy, <d.u.lockh, <d.u.tree, OBD_BRW_READ); if (ltd.lock_style < 0 || ltd.lock_style == LL_LOCK_STYLE_NOLOCK) @@ -1569,9 +1572,9 @@ repeat: (((size - 1) >> CFS_PAGE_SHIFT) < cur_index)) { if (ltd.lock_style != LL_LOCK_STYLE_NOLOCK) { - ll_file_put_lock(inode, end, + ll_file_put_lock(inode, end, ltd.lock_style, - <d.u.lockh, + <d.u.lockh, <d.u.tree, OBD_BRW_READ); up_read(&lli->lli_truncate_rwsem); @@ -1607,7 +1610,7 @@ repeat: * ll_glimpse_size) could get correct values in lsm */ OBD_ALLOC_PTR(xtimes); if (NULL == xtimes) { - ll_file_put_lock(inode, end, ltd.lock_style, + ll_file_put_lock(inode, end, ltd.lock_style, <d.u.lockh, <d.u.tree, OBD_BRW_READ); up_read(&lli->lli_truncate_rwsem); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b834772..03c7e41 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6186,6 +6186,21 @@ test_170() { } run_test 170 "test lctl df to handle corrupted log =====================" +test_171() { # bug20592 +#define OBD_FAIL_PTLRPC_DUMP_LOG 0x50e + $LCTL set_param fail_loc=0x50e + $LCTL set_param fail_val=3000 + multiop_bg_pause $DIR/$tfile Os || true + # cause log dump + sleep 3 + if dmesg | grep "recursive fault"; then + error "caught a recursive fault" + fi + $LCTL set_param fail_loc=0 + true +} +run_test 171 "test libcfs_debug_dumplog_thread stuck in do_exit() ======" + obdecho_create_test() { local OBD=$1 local node=$2 -- 1.8.3.1