From patchwork Sun Nov 21 19:21:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 346081 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oALJLpo8014641 for ; Sun, 21 Nov 2010 19:21:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790Ab0KUTVr (ORCPT ); Sun, 21 Nov 2010 14:21:47 -0500 Received: from mx2.netapp.com ([216.240.18.37]:49411 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713Ab0KUTVq (ORCPT ); Sun, 21 Nov 2010 14:21:46 -0500 X-IronPort-AV: E=Sophos;i="4.59,232,1288594800"; d="scan'208";a="485296817" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 21 Nov 2010 11:21:32 -0800 Received: from heimdal.trondhjem.org.com ([10.58.57.137]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id oALJLTjZ027910; Sun, 21 Nov 2010 11:21:31 -0800 (PST) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 4/8] NFS: Fix a page leak in uncached_readdir() Date: Sun, 21 Nov 2010 14:21:18 -0500 Message-Id: <1290367282-5445-4-git-send-email-Trond.Myklebust@netapp.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1290367282-5445-3-git-send-email-Trond.Myklebust@netapp.com> References: <1290367282-5445-1-git-send-email-Trond.Myklebust@netapp.com> <1290367282-5445-2-git-send-email-Trond.Myklebust@netapp.com> <1290367282-5445-3-git-send-email-Trond.Myklebust@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 21 Nov 2010 19:21:56 +0000 (UTC) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 42e66e9..353f47c 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -763,13 +763,14 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, goto out; } + desc->page_index = 0; + desc->page = page; + if (nfs_readdir_xdr_to_array(desc, page, inode) == -1) { status = -EIO; goto out_release; } - desc->page_index = 0; - desc->page = page; status = nfs_do_filldir(desc, dirent, filldir); out: