From patchwork Tue Jun 14 13:56:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fred Isaman X-Patchwork-Id: 879062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5EDv36d020022 for ; Tue, 14 Jun 2011 13:57:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751569Ab1FNN5C (ORCPT ); Tue, 14 Jun 2011 09:57:02 -0400 Received: from mx2.netapp.com ([216.240.18.37]:23188 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646Ab1FNN5B (ORCPT ); Tue, 14 Jun 2011 09:57:01 -0400 X-IronPort-AV: E=Sophos;i="4.65,364,1304319600"; d="scan'208";a="555416671" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 14 Jun 2011 06:56:36 -0700 Received: from localhost.localdomain (gagan-lxp.hq.netapp.com [10.55.74.36] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p5EDuamx010823; Tue, 14 Jun 2011 06:56:36 -0700 (PDT) From: Fred Isaman To: linux-nfs@vger.kernel.org Cc: Trond Myklebust , Fred Isaman Subject: [PATCH 1/1] nfs4.1: pnfs_find_lseg only looks at first element in list Date: Tue, 14 Jun 2011 09:56:28 -0400 Message-Id: <1308059788-17381-1-git-send-email-iisaman@netapp.com> X-Mailer: git-send-email 1.7.2.1 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 (demeter2.kernel.org [140.211.167.43]); Tue, 14 Jun 2011 13:57:04 +0000 (UTC) The break condition to skip out of the loop if we've gone too far was reversed, causing the function to abort after looking at the first list entry. Reported-by: Peng Tao Signed-off-by: Fred Isaman --- fs/nfs/pnfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 1abb300..c640f91 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -895,7 +895,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo, ret = get_lseg(lseg); break; } - if (cmp_layout(range, &lseg->pls_range) > 0) + if (cmp_layout(range, &lseg->pls_range) < 0) break; }