From patchwork Tue Jun 2 01:26:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6525781 Return-Path: X-Original-To: patchwork-linux-nfs@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 31AFEC0020 for ; Tue, 2 Jun 2015 01:26:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58B6B20569 for ; Tue, 2 Jun 2015 01:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A1E52055D for ; Tue, 2 Jun 2015 01:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754128AbbFBB0X (ORCPT ); Mon, 1 Jun 2015 21:26:23 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:33736 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbbFBB0W (ORCPT ); Mon, 1 Jun 2015 21:26:22 -0400 Received: by pdbqa5 with SMTP id qa5so120692575pdb.0; Mon, 01 Jun 2015 18:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=SruhaUpwmaoW+joSZXFqaU26HopQ3b8ALTQdOhMjKRA=; b=U60fxZdurNkAFzONPu6T06MP/LyHiUg9lPF1SHCaIn1D/amUQ5FRBzV/dzyrmjiLEl kDFgI9m6Rd2eUelAEZu35u9aFW+ReWczQ4yFIaYi9BKT+B9pXs75kS/gl0+3cXLGuZQE g9tUWkFTDEAhp5d0lDdj7FLpuDMJM1PJwWr9rpeijmg1x5csibEqM0JIbVI6whNjuUUi 6k/g0p7WD8LvJhEXqBCLD+4qx6VWt+rdnrWpH2P9L3sDm2vpeLdJHnbq8v1LZhz/LsKF x5zAd9kIckWXT52DefBfp0y3al1WKcmy5MvYYYxvU6wNNacRCiiU8CHnzPzMAqtfndgK 0FpQ== X-Received: by 10.68.57.229 with SMTP id l5mr7920344pbq.130.1433208382333; Mon, 01 Jun 2015 18:26:22 -0700 (PDT) Received: from [192.168.99.19] ([104.143.41.79]) by mx.google.com with ESMTPSA id xo3sm15519833pbb.74.2015.06.01.18.26.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 18:26:21 -0700 (PDT) Message-ID: <556D0637.4060901@gmail.com> Date: Tue, 02 Jun 2015 09:26:15 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "J. Bruce Fields" , Al Viro , linux-fsdevel@vger.kernel.org, "linux-nfs@vger.kernel.org" CC: NeilBrown , Trond Myklebust , kinglongmee@gmail.com Subject: [PATCH 1/5 v3] fs_pin: Fix uninitialized value in fs_pin Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Avoid using kmalloc for memory allocationg without initialized, done in fs_pin at stack space may contains strange value. v1 --> v3, Adds macro for header file Signed-off-by: Kinglong Mee --- include/linux/fs_pin.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/fs_pin.h b/include/linux/fs_pin.h index 3886b3b..0dde7b7 100644 --- a/include/linux/fs_pin.h +++ b/include/linux/fs_pin.h @@ -1,3 +1,6 @@ +#ifndef _LINUX_FS_PIN_H +#define _LINUX_FS_PIN_H + #include struct fs_pin { @@ -16,9 +19,12 @@ static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *)) INIT_HLIST_NODE(&p->s_list); INIT_HLIST_NODE(&p->m_list); p->kill = kill; + p->done = 0; } void pin_remove(struct fs_pin *); void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *); void pin_insert(struct fs_pin *, struct vfsmount *); void pin_kill(struct fs_pin *); + +#endif