From patchwork Sun May 24 15:10:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6471581 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 F409F9F1C1 for ; Sun, 24 May 2015 15:10:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84F2720384 for ; Sun, 24 May 2015 15:10:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA3FF20395 for ; Sun, 24 May 2015 15:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751159AbbEXPKg (ORCPT ); Sun, 24 May 2015 11:10:36 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34463 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbbEXPKe (ORCPT ); Sun, 24 May 2015 11:10:34 -0400 Received: by pabru16 with SMTP id ru16so54181092pab.1; Sun, 24 May 2015 08:10:34 -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 :references:in-reply-to:content-type:content-transfer-encoding; bh=LyqcrOHXMrZACgQWCuhbSBJ8mnB7k9+mJcO5qiUkiHY=; b=AnNzyhMMYDgUnpJhSvAQf97Pino0/zfEkfPTECYtFq45QmFWs0SgKWltLelR3siMQY 75g83WI/5U3+incOC4nRgCvdzFVlDiIrAM6DSlxpNUlK8mHFiLJoMIY+zmkxXptnHdah P/kRL9wbD8zw5K36KXKei/8zZMUi1t99csknNu1YoKlg9vanswKclNqAHilqOjTQyHRu eFRl14mz0VTcU8MCji/CdXFZswZdzyB+nlAlvFk/gfcO4WbdpVZnUIuxNDQ6ZHR9aZu+ aHXD4osgpROT8cWHKAKFpkIUzCVhFTBIFdBuZdeqeQPKuZzU/fXXfdBkjJIf048jBgp9 ALoA== X-Received: by 10.70.90.209 with SMTP id by17mr31835908pdb.2.1432480234073; Sun, 24 May 2015 08:10:34 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id kh6sm7427796pbc.50.2015.05.24.08.10.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 08:10:33 -0700 (PDT) Message-ID: <5561E9E1.4070906@gmail.com> Date: Sun, 24 May 2015 23:10:25 +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" , NeilBrown CC: Trond Myklebust , Steve Dickson , kinglongmee@gmail.com Subject: [PATCH 1/5 v2] fs_pin: Fix uninitialized value in fs_pin References: <5561E7E4.50604@gmail.com> In-Reply-To: <5561E7E4.50604@gmail.com> 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, 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 Without initialized, done in fs_pin at stack space may contains strange value. v2, same as v1. 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