From patchwork Tue Sep 9 21:51:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 4872981 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 02DD39F32E for ; Tue, 9 Sep 2014 21:51:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F03F20179 for ; Tue, 9 Sep 2014 21:51:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A36320142 for ; Tue, 9 Sep 2014 21:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbaIIVvw (ORCPT ); Tue, 9 Sep 2014 17:51:52 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:61806 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752047AbaIIVvv (ORCPT ); Tue, 9 Sep 2014 17:51:51 -0400 Received: by mail-ig0-f181.google.com with SMTP id h15so5342080igd.2 for ; Tue, 09 Sep 2014 14:51:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vJKDNdVYAv8NZuBVuD3N5NKp4Vnezeypd0/jWfIWLNQ=; b=aBTqh2hK4PH4uWp+zLth7SI3j4A2CaNsjWvVJt9r6K/rg/j3TN40Wzmg3KEqbNcgZD QQ4xbtdJt4ZSy4RYoynPK8ChJylk1By4mnC2R4g3Exo7va7zgIBFwfEDirfjbHiS7RHd tExfXLkYE3RWTBd93+i4CmvplmJCA602EMq+BgOnhmW2o9hmtzTa2XxUQjmp1kgnI3ef PIA9pObw2mDrnNLO8mZ2Yp7A0F0Djg12uss0A+OuXMOqmJ93Ia2siymtcRcbIvy56k/z Z8sYDKc6M58Q6cUQKBi8pyZDWV8PeK16hKQt3XD1m1R5Sb2NvSwKDY30G5CqMUZk6iFr jGQg== X-Gm-Message-State: ALoCoQlNG3SAwfuQIQ8Q5hPaiwW+rCA4s8FodXi0X0f5hO1h13nFLSUhJh+9/ljKeAe89Q1S74Bm X-Received: by 10.43.151.5 with SMTP id kq5mr6089445icc.87.1410299511230; Tue, 09 Sep 2014 14:51:51 -0700 (PDT) Received: from gavrio-wifi.robotsandstuff.fake (c-98-209-19-144.hsd1.mi.comcast.net. [98.209.19.144]) by mx.google.com with ESMTPSA id ad2sm243716igd.19.2014.09.09.14.51.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 09 Sep 2014 14:51:50 -0700 (PDT) From: Weston Andros Adamson To: trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson Subject: [PATCH] pnfs: fix filelayout_retry_commit when idx > 0 Date: Tue, 9 Sep 2014 17:51:47 -0400 Message-Id: <1410299507-10339-1-git-send-email-dros@primarydata.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP filelayout_retry_commit was recently split out from alloc_ds_commits, but was done in such a way that the bucket pointer always starts at index 0 no matter what the @idx argument is set to. The intention of the @idx argument is to retry commits starting at bucket @idx. This is called when alloc_ds_commits fails for a bucket. Signed-off-by: Weston Andros Adamson --- fs/nfs/filelayout/filelayout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 1359c4a27393..90978075f730 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -1269,11 +1269,12 @@ filelayout_search_commit_reqs(struct nfs_commit_info *cinfo, struct page *page) static void filelayout_retry_commit(struct nfs_commit_info *cinfo, int idx) { struct pnfs_ds_commit_info *fl_cinfo = cinfo->ds; - struct pnfs_commit_bucket *bucket = fl_cinfo->buckets; + struct pnfs_commit_bucket *bucket; struct pnfs_layout_segment *freeme; int i; - for (i = idx; i < fl_cinfo->nbuckets; i++, bucket++) { + for (i = idx; i < fl_cinfo->nbuckets; i++) { + bucket = &fl_cinfo->buckets[i]; if (list_empty(&bucket->committing)) continue; nfs_retry_commit(&bucket->committing, bucket->clseg, cinfo);