From patchwork Wed Mar 23 17:39:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 656531 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 p2NHejIL017538 for ; Wed, 23 Mar 2011 17:41:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752978Ab1CWRjq (ORCPT ); Wed, 23 Mar 2011 13:39:46 -0400 Received: from mx2.netapp.com ([216.240.18.37]:16464 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965Ab1CWRjp (ORCPT ); Wed, 23 Mar 2011 13:39:45 -0400 X-IronPort-AV: E=Sophos;i="4.63,232,1299484800"; d="scan'208";a="533728870" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 23 Mar 2011 10:39:43 -0700 Received: from [10.30.28.156] (liguori-lxp.hq.netapp.com [10.30.28.156] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p2NHdg5d009529; Wed, 23 Mar 2011 10:39:43 -0700 (PDT) Message-ID: <4D8A305D.9010803@netapp.com> Date: Wed, 23 Mar 2011 13:39:41 -0400 From: Bryan Schumaker User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Lightning/1.0b2 Lanikai/3.1.9 MIME-Version: 1.0 To: "Myklebust, Trond" CC: "linux-nfs@vger.kernel.org" Subject: [PATCH 1/3] NFS: Ensure that we update the readdir filp->f_pos correctly 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 23 Mar 2011 17:41:38 +0000 (UTC) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index f685f15..a9824ce 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -291,7 +291,6 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri if (diff >= array->size) { if (array->eof_index >= 0) goto out_eof; - desc->current_index += array->size; return -EAGAIN; } @@ -312,6 +311,7 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des for (i = 0; i < array->size; i++) { if (array->array[i].cookie == *desc->dir_cookie) { + desc->file->f_pos = desc->current_index + i; desc->cache_entry_index = i; return 0; } @@ -343,6 +343,7 @@ int nfs_readdir_search_array(nfs_readdir_descriptor_t *desc) if (status == -EAGAIN) { desc->last_cookie = array->last_cookie; + desc->current_index += array->size; desc->page_index++; } nfs_readdir_release_array(desc->page);