From patchwork Tue Jul 21 14:58:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 6836891 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC3B3C05AD for ; Tue, 21 Jul 2015 14:59:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDC1B2060D for ; Tue, 21 Jul 2015 14:59:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1201A206CB for ; Tue, 21 Jul 2015 14:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754730AbbGUO6u (ORCPT ); Tue, 21 Jul 2015 10:58:50 -0400 Received: from forward-corp1m.cmail.yandex.net ([5.255.216.100]:32848 "EHLO forward-corp1m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754201AbbGUO6s (ORCPT ); Tue, 21 Jul 2015 10:58:48 -0400 Received: from smtpcorp4.mail.yandex.net (smtpcorp4.mail.yandex.net [95.108.252.2]) by forward-corp1m.cmail.yandex.net (Yandex) with ESMTP id EE40660DFE; Tue, 21 Jul 2015 17:58:43 +0300 (MSK) Received: from smtpcorp4.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp4.mail.yandex.net (Yandex) with ESMTP id B1D362C0310; Tue, 21 Jul 2015 17:58:43 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:2499:8588:6604:38e4]) by smtpcorp4.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yXehvFnQH4-wh9m4o33; Tue, 21 Jul 2015 17:58:43 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1437490723; bh=mSbnfPWwhArEaq33MKXmIJ871fK9MsA/MgU/QCkkKHs=; h=Subject:From:To:Cc:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding; b=qbj/oXO3C/CtrrfD842DF46uWPwT1ArYDE/3TTlU4zLlTY/dh8/1YTaZzOo+c9NqT Yjq3KYrKjaE0oGz8MjV7fU5ucjZdM5feFek2xNUCS+jyxBsCZGKvrjAYfS7I0k4pEW 7i4BGjeey+xphWZ5hqA0RDVZv1khuHe/AlAUAP6s= Authentication-Results: smtpcorp4.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH 1/2] ovl: free stack of paths in ovl_fill_super From: Konstantin Khlebnikov To: linux-unionfs@vger.kernel.org, Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Tue, 21 Jul 2015 17:58:43 +0300 Message-ID: <20150721145843.11975.3849.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 This fixes small memory leak after each successful mount. Kmemleak report: unreferenced object 0xffff88003683fe00 (size 16): comm "mount", pid 2029, jiffies 4294909563 (age 33.380s) hex dump (first 16 bytes): 20 27 1f bb 00 88 ff ff 40 4b 0f 36 02 88 ff ff '......@K.6.... backtrace: [] create_object+0x124/0x2c0 [] kmemleak_alloc+0x7b/0xc0 [] __kmalloc+0x106/0x340 [] ovl_fill_super+0x389/0x9a0 [overlay] [] mount_nodev+0x54/0xa0 [] ovl_mount+0x18/0x20 [overlay] [] mount_fs+0x43/0x170 [] vfs_kern_mount+0x74/0x170 [] do_mount+0x22d/0xdf0 [] SyS_mount+0x7b/0xc0 [] entry_SYSCALL_64_fastpath+0x12/0x76 [] 0xffffffffffffffff Signed-off-by: Konstantin Khlebnikov Fixes: a78d9f0d5d5c ("ovl: support multiple lower layers") --- fs/overlayfs/super.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index a27572894eb1..ea9b1c20d48f 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1049,6 +1049,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) oe->lowerstack[i].dentry = stack[i].dentry; oe->lowerstack[i].mnt = ufs->lower_mnt[i]; } + kfree(stack); root_dentry->d_fsdata = oe;