From patchwork Sat Mar 6 04:44:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 83875 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o264idrK032177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 6 Mar 2010 04:45:16 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NnlsO-0000ez-IE; Sat, 06 Mar 2010 04:44:32 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NnlsN-0000em-En for v9fs-developer@lists.sourceforge.net; Sat, 06 Mar 2010 04:44:31 +0000 X-ACL-Warn: Received: from e28smtp02.in.ibm.com ([122.248.162.2]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NnlsL-0006t4-TE for v9fs-developer@lists.sourceforge.net; Sat, 06 Mar 2010 04:44:31 +0000 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp02.in.ibm.com (8.14.3/8.13.1) with ESMTP id o264iLfn017555 for ; Sat, 6 Mar 2010 10:14:21 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o264iLne2953258 for ; Sat, 6 Mar 2010 10:14:21 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o264iKci005295 for ; Sat, 6 Mar 2010 10:14:21 +0530 Received: from localhost.localdomain ([9.77.124.141]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o264iJ67005272; Sat, 6 Mar 2010 10:14:20 +0530 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Sat, 6 Mar 2010 10:14:16 +0530 Message-Id: <1267850656-14653-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.1.147.g6d84b In-Reply-To: <1267850656-14653-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1267850656-14653-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Spam-Score: -0.1 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.1 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NnlsL-0006t4-TE Subject: [V9fs-developer] [PATCH -V3 3/3] fs/9p: re-init the wstat in readdir loop X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 06 Mar 2010 04:45:16 +0000 (UTC) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 6580aa4..d8a3afe 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -76,6 +76,15 @@ static inline int dt_type(struct p9_wstat *mistat) return rettype; } +static void p9stat_init(struct p9_wstat *stbuf) +{ + stbuf->name = NULL; + stbuf->uid = NULL; + stbuf->gid = NULL; + stbuf->muid = NULL; + stbuf->extension = NULL; +} + /** * v9fs_dir_readdir - read a directory * @filp: opened file structure @@ -131,8 +140,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) rdir->head = 0; rdir->tail = err; } - while (rdir->head < rdir->tail) { + p9stat_init(&st); err = p9stat_read(rdir->buf + rdir->head, buflen - rdir->head, &st, fid->clnt->proto_version);