From patchwork Tue May 17 16:28:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9114241 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 525FBBF29F for ; Tue, 17 May 2016 16:29:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74DB7202EC for ; Tue, 17 May 2016 16:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C389201B9 for ; Tue, 17 May 2016 16:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195AbcEQQ3C (ORCPT ); Tue, 17 May 2016 12:29:02 -0400 Received: from mail-qg0-f65.google.com ([209.85.192.65]:33087 "EHLO mail-qg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755882AbcEQQ3A (ORCPT ); Tue, 17 May 2016 12:29:00 -0400 Received: by mail-qg0-f65.google.com with SMTP id 90so1830574qgz.0 for ; Tue, 17 May 2016 09:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o1nsGGPUtJXdFyJuvlocSd9YecnMfWWGM4UenFr12NE=; b=GFwYgLFkFgO/7Ej01OEO2wJEnwy01jeCNtlEjDijBwGwmfsrbj+x3JdxCUC3saBZ+b syoh2Ywk3fm3dlyL80/11dUMyWxFHzLZfgYvr19Mdh/aupysFtDJxar39xr6cwW5v9gK veSfuuXCdOktsjB2EnsnMIBGqI8ODKGs+o/DUkp6GmUrK6WrkEwNi7aHSHB8jZPfI1rO v9JPHIQzirqRdrP11sdSHJCAxcZksC6kImI61goKn6a+AEaio7QegNdUejfUutZzCtSs v+v0UN8AFZGrm+6hz+072uaDXylpgFC6jRiPs90/X8Gnxfov/Dt9OZ1kpdvPVLxyeNiK 0WmA== 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:in-reply-to :references; bh=o1nsGGPUtJXdFyJuvlocSd9YecnMfWWGM4UenFr12NE=; b=HT3T8vc611F6HePj7IuSg304GYI3HFdGByAG9FXjBpFs5uS2C/efLMpRFDj9qhrD/h ddcbYIgeIjMA7s3cMjgtncZhxOwvtrW2EG5jzdJkWSCeBIKmZDr3t93dhibaUIXNRMSV 8fN59qfnyvQmZXs41q5pSV4+ReEIqFs/B0DsDBehKjhv21g1p1+or5XalCw2zFvCEvSC +2M1o034337MAvV/Wt1qBO1uGaB+AkqYbxLNUHKMBz3zIKeBTri4wqmwelFD6AY8PJum b+KxLsW2DOwEpq9sSZw7zyXpKcKav48zRb4vNsdEkrg9LxFCFvsv83njCUjrSc/wCv+t i1Yg== X-Gm-Message-State: AOPr4FWLwAoyW1d+CkEKRjQViVO3Kk5kaS1KhT1z9SFRHIwovBcHMW+v3v3uP+Ez3nSC1g== X-Received: by 10.140.197.5 with SMTP id s5mr2702059qha.17.1463502539500; Tue, 17 May 2016 09:28:59 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id a31sm1685827qga.34.2016.05.17.09.28.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 09:28:58 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: Thomas Haynes , linux-nfs@vger.kernel.org, hch@lst.de Subject: [PATCH v4 04/13] pnfs: don't merge new ff lsegs with ones that have LAYOUTRETURN bit set Date: Tue, 17 May 2016 12:28:39 -0400 Message-Id: <1463502528-11519-5-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463502528-11519-1-git-send-email-jeff.layton@primarydata.com> References: <1463502528-11519-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Otherwise, we'll end up returning layouts that we've just received if the client issues a new LAYOUTGET prior to the LAYOUTRETURN. Signed-off-by: Jeff Layton --- fs/nfs/flexfilelayout/flexfilelayout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f58cd2a14d5e..127a65fa639a 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -298,6 +298,8 @@ ff_lseg_merge(struct pnfs_layout_segment *new, { u64 new_end, old_end; + if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags)) + return false; if (new->pls_range.iomode != old->pls_range.iomode) return false; old_end = pnfs_calc_offset_end(old->pls_range.offset, @@ -318,8 +320,6 @@ ff_lseg_merge(struct pnfs_layout_segment *new, new_end); if (test_bit(NFS_LSEG_ROC, &old->pls_flags)) set_bit(NFS_LSEG_ROC, &new->pls_flags); - if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags)) - set_bit(NFS_LSEG_LAYOUTRETURN, &new->pls_flags); return true; }