From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757330AbcHWVNU (ORCPT ); Tue, 23 Aug 2016 17:13:20 -0400 Received: from linuxhacker.ru ([217.76.32.60]:50938 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756230AbcHWVMg (ORCPT ); Tue, 23 Aug 2016 17:12:36 -0400 From: Oleg Drokin To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , James Simmons Cc: Linux Kernel Mailing List , Lustre Development List , Lokesh Nagappa Jaliminche , Oleg Drokin Subject: [PATCH 6/8] staging/lustre/llite: changes to avoid cache corruption Date: Tue, 23 Aug 2016 17:11:40 -0400 Message-Id: <1471986702-682922-7-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471986702-682922-1-git-send-email-green@linuxhacker.ru> References: <1471986702-682922-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lokesh Nagappa Jaliminche 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 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7613 Reviewed-by: Niu Yawei Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 788a3f0..b7d448f 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -363,7 +363,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 && -- 2.7.4