From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:35518 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754455AbcA3Uvu (ORCPT ); Sat, 30 Jan 2016 15:51:50 -0500 Received: by mail-pf0-f195.google.com with SMTP id 66so5033680pfe.2 for ; Sat, 30 Jan 2016 12:51:49 -0800 (PST) From: Santosh Madiraju To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, madiraju Subject: [PATCH 2/2] fs: fix bug where dentry freed earlier, might be getting freed again. Date: Sat, 30 Jan 2016 12:51:46 -0800 Message-Id: <1454187106-10827-1-git-send-email-madiraju.santosh@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: madiraju While shrinking the dentry list in shrink_dentry_list function, if DCACHE_MAY_FREE flag is set, it frees the dentry, and it again tries to do it in dentry_kill. Signed-off-by: Santosh Madiraju --- fs/dcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 92d5140..7aa2252 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -986,8 +986,8 @@ static void shrink_dentry_list(struct list_head *list) spin_unlock(&parent->d_lock); continue; } - - __dentry_kill(dentry); + if (dentry) + __dentry_kill(dentry); /* * We need to prune ancestors too. This is necessary to prevent -- 1.9.1