From patchwork Sat Jan 30 20:51:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Madiraju X-Patchwork-Id: 8172331 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 773039FC36 for ; Sat, 30 Jan 2016 20:52:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5AF620328 for ; Sat, 30 Jan 2016 20:52:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECDE220320 for ; Sat, 30 Jan 2016 20:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755195AbcA3Uvu (ORCPT ); Sat, 30 Jan 2016 15:51:50 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=L/LrWVczQ8ItkYlqWLPzhxYOCa7Slvl7QUAYkes63uA=; b=Trwvr5vqBowqCtEurd7aaC2JO17Y/QkWe0u7/9watU8jjtsmRQ+0eEf99f54AglfOD zSg4tPLZC//hhzscqZVgAh8Cj+B6UxwvaOvfns6/1K1SUwu5cDhqwJv58fOML8GX26JT s30jva99wqI0KIUP9t7jh+2P6GHOBZLk2OoaeuxJQPrsTa047MeYKOusObpDuPVK+6W6 iNCHjd5VrGPM65En1h5QMXCTRMt66mIe8it60i8in4n8OdWgrBR9YNxpObw+8EyLRunK qMT1rSov7M7rx1voaTnRynhghL16VSMHMp0wEJ8uVRuUpb1KOmGa0uYDPTbHddHJ3p9k GjAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=L/LrWVczQ8ItkYlqWLPzhxYOCa7Slvl7QUAYkes63uA=; b=mhp75oeMlF/BGSoI0cujiPXyHCWX7z0FmuzZERP6ElLx6wGSu7fgKZlklIVQwB2uPi mAURLq5duA39xlBJx2yIzAnN+GFOZ1eVzIRCD+HmvI5oYUMeq09cuTIUqS5AiYlo/QkN cxJ2Pa3vEjFML8R/mAd90ZzCuLkg4lOErz7xrS9KWSIYR0SDzhmfAsZjgPQWGbQj1eUK fiM2hNXCoTSgDQxk5HJ8inOnYcoa/GlNoL1DHqd0MNjeiqI9F3kqQL73+2wR6XXTz/Yo QdTkLBZHHldv3RQMVQIApnd5nAg1z7uZwAFwqIyDiq4Ab0pBjAvho1KKcftOZdDLpoHC 5iOg== X-Gm-Message-State: AG10YOTo0zl/Gous6VP2Hbc0I4ucQVxEId57fFHMpg7c0we8ka4incw4wXj0BXXNGo3bsg== X-Received: by 10.98.16.139 with SMTP id 11mr25021809pfq.128.1454187109489; Sat, 30 Jan 2016 12:51:49 -0800 (PST) Received: from localhost.localdomain (c-73-158-111-174.hsd1.ca.comcast.net. [73.158.111.174]) by smtp.gmail.com with ESMTPSA id mj1sm32379255pab.34.2016.01.30.12.51.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); 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> X-Mailer: git-send-email 1.9.1 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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