From patchwork Mon Mar 1 15:28:00 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: 82983 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 o21FSMud003991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 1 Mar 2010 15:28:59 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 1Nm7Xb-0005lq-N2; Mon, 01 Mar 2010 15:28:15 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nm7Xa-0005lj-2j for v9fs-developer@lists.sourceforge.net; Mon, 01 Mar 2010 15:28:14 +0000 X-ACL-Warn: Received: from e23smtp08.au.ibm.com ([202.81.31.141]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Nm7XY-0006rY-H9 for v9fs-developer@lists.sourceforge.net; Mon, 01 Mar 2010 15:28:13 +0000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp08.au.ibm.com (8.14.3/8.13.1) with ESMTP id o21FS4cu011568 for ; Tue, 2 Mar 2010 02:28:04 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o21FS4tu1359950 for ; Tue, 2 Mar 2010 02:28:04 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o21FS4vf021396 for ; Tue, 2 Mar 2010 02:28:04 +1100 Received: from localhost.localdomain ([9.77.192.73]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o21FS2e0021331; Tue, 2 Mar 2010 02:28:02 +1100 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Mon, 1 Mar 2010 20:58:00 +0530 Message-Id: <1267457280-19915-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.83.g241b9 X-Spam-Score: -2.4 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -2.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Nm7XY-0006rY-H9 Subject: [V9fs-developer] [PATCH] 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]); Mon, 01 Mar 2010 15:28:59 +0000 (UTC) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 15cce53..0b0ea64 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -131,8 +131,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->dotu); diff --git a/include/net/9p/client.h b/include/net/9p/client.h index fb00b32..f48f093 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -208,6 +208,7 @@ void p9_client_cb(struct p9_client *c, struct p9_req_t *req); int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int); int p9stat_read(char *, int, struct p9_wstat *, int); void p9stat_free(struct p9_wstat *); +void p9stat_init(struct p9_wstat *); #endif /* NET_9P_CLIENT_H */ diff --git a/net/9p/protocol.c b/net/9p/protocol.c index fc70147..5097e93 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -91,6 +91,15 @@ p9pdu_dump(int way, struct p9_fcall *pdu) #endif EXPORT_SYMBOL(p9pdu_dump); +void p9stat_init(struct p9_wstat *stbuf) +{ + stbuf->name = NULL; + stbuf->uid = NULL; + stbuf->gid = NULL; + stbuf->muid = NULL; + stbuf->extension = NULL; +} + void p9stat_free(struct p9_wstat *stbuf) { kfree(stbuf->name);