From patchwork Mon Aug 9 11:33:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sripathi Kodi X-Patchwork-Id: 118362 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o79Bm6Ds011891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 9 Aug 2010 11:48:42 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OiQpg-0006Uv-MC; Mon, 09 Aug 2010 11:47:56 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OiQpf-0006Un-Uj for v9fs-developer@lists.sourceforge.net; Mon, 09 Aug 2010 11:47:55 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of in.ibm.com designates 202.81.31.144 as permitted sender) client-ip=202.81.31.144; envelope-from=sripathik@in.ibm.com; helo=e23smtp02.au.ibm.com; Received: from e23smtp02.au.ibm.com ([202.81.31.144]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OiQpe-0000Nf-DR for v9fs-developer@lists.sourceforge.net; Mon, 09 Aug 2010 11:47:55 +0000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp02.au.ibm.com (8.14.4/8.13.1) with ESMTP id o79BT75J002292 for ; Mon, 9 Aug 2010 21:29:07 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o79BXCu51511606 for ; Mon, 9 Aug 2010 21:33:12 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o79BXCDc025025 for ; Mon, 9 Aug 2010 21:33:12 +1000 Received: from sripathi.in.ibm.com ([9.124.46.102]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o79BXB5j025017; Mon, 9 Aug 2010 21:33:11 +1000 Received: from sripathi.in.ibm.com (sripathi.in.ibm.com [127.0.0.1]) by sripathi.in.ibm.com (Postfix) with ESMTP id 93C4A26C04; Mon, 9 Aug 2010 17:03:10 +0530 (IST) From: Sripathi Kodi To: v9fs-developer@lists.sourceforge.net Date: Mon, 09 Aug 2010 17:03:10 +0530 Message-ID: <20100809113310.6427.40503.stgit@sripathi.in.ibm.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OiQpe-0000Nf-DR Cc: lucho@ionkov.net Subject: [V9fs-developer] [PATCH] 9p: Pass the correct end of buffer to p9dirent_read 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: , 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, 09 Aug 2010 11:48:42 +0000 (UTC) diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 16c8a2a..616150f 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -242,7 +242,8 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent, while (rdir->head < rdir->tail) { err = p9dirent_read(rdir->buf + rdir->head, - buflen - rdir->head, &curdirent, + rdir->tail - rdir->head, + &curdirent, fid->clnt->proto_version); if (err < 0) { P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);