From cf6efbdb726ceae10a9f3c770bc7af9d15571a80 Mon Sep 17 00:00:00 2001 From: Lokesh Nagappa Jaliminche Date: Wed, 10 Feb 2016 19:30:44 +0530 Subject: [PATCH] LU-7613 llite: changes to avoid cache corruption ll_find_alias is responsible for getting alias for inode which can be reused. Directories are assumed to have unique alias, where in case of non-directories there can be multiple aliases. In case of lustre there can be two type of aliases i.e. discon_alias and invalid_alias. Usage of discon_alias in case of non-directories may corrupt dcache and leads to kernel crash. Changes made to avoid use of discon_alias in case of non-directories. Seagate-bug-id: MRP-2739, MRP-3601 Change-Id: Ieb9dabab0784bdb3c52e2cb32be1a766ffe55313 Signed-off-by: Lokesh Nagappa Jaliminche Reviewed-by: Ujjwal Lanjewar Reviewed-by: Ashish Purkar Reviewed-by: Andrew Perepechko Tested-by: Parinay Vijayprakash Kondekar Reviewed-on: http://review.whamcloud.com/17732 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- lustre/llite/namei.c | 3 ++- lustre/tests/parallel-scale-nfs.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 1c17b50..1427c6a 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -399,7 +399,8 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) LASSERT(alias != dentry); spin_lock(&alias->d_lock); - if (alias->d_flags & DCACHE_DISCONNECTED) + if ((alias->d_flags & DCACHE_DISCONNECTED) && + S_ISDIR(inode->i_mode)) /* LASSERT(last_discon == NULL); LU-405, bz 20055 */ discon_alias = alias; else if (alias->d_parent == dentry->d_parent && diff --git a/lustre/tests/parallel-scale-nfs.sh b/lustre/tests/parallel-scale-nfs.sh index 0f8fead..4f698c3 100755 --- a/lustre/tests/parallel-scale-nfs.sh +++ b/lustre/tests/parallel-scale-nfs.sh @@ -12,6 +12,7 @@ fi . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging +racer=$LUSTRE/tests/racer/racer.sh . $LUSTRE/tests/setup-nfs.sh check_and_setup_lustre @@ -98,6 +99,11 @@ test_iorfpp() { } run_test iorfpp "iorfpp" +test_racer_on_nfs() { + $racer $CLIENTS +} +run_test racer_on_nfs "racer on NFS client" + # cleanup nfs cleanup_nfs "$MOUNT" "$lustre_client" "$CLIENTS" || \ error_noexit false "cleanup_nfs failed" -- 1.8.3.1