From patchwork Wed May 11 10:21:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9067421 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F38829F1C1 for ; Wed, 11 May 2016 10:21:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A95820114 for ; Wed, 11 May 2016 10:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E98D5201C7 for ; Wed, 11 May 2016 10:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752214AbcEKKV1 (ORCPT ); Wed, 11 May 2016 06:21:27 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36801 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbcEKKVZ (ORCPT ); Wed, 11 May 2016 06:21:25 -0400 Received: by mail-qk0-f193.google.com with SMTP id l68so2731032qkf.3 for ; Wed, 11 May 2016 03:21:25 -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=F4A0zCjYsRJuemSJDGchMw9kZnYT+zTC0B0zC7iRTfc=; b=dmKs98ziog3GQvP7ey0XOwzoCt5EahVNOGB8rtAUstIWlzhrgZoOjLQ4UOXTfL97T3 ScdFVrtEstOCedo1GSrL7XCjZvSQXS/9slJNqkkIxB/DJBo2g1RZ4zGN/GGKcGan/muO C0i8p89ug6J79AIQnhgG+VaLvs5atq0/lWdVbAFYMKHdE2bK/mpmekmHIcwMbBLiDXe7 IAe5n+VEURIerr5IP/wuQxHJuJdaloXaM+xAKIKAYxg0T+iwExCAYTg5O9uNWEu97oZT G2FmDDPCOC2aoTdT1Ol9scGpz6vHq7UAVrYRM5TNovskIZR7+iOFqL3c+vGrkiQfnNHq HW4w== 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=F4A0zCjYsRJuemSJDGchMw9kZnYT+zTC0B0zC7iRTfc=; b=SPyGmevK6lbPHTfB1+VJZKuga58uoM9Tw6n3CDR3kOljDnHAGxpsgWVfYF52cgKjcj XcxlqBG5xERmyK6ckmEAfK48BVR7Ck10j2Nxbg+j4bnaxISDRBLsw90z7LHXe0T9yu8e AtT7XzF1wbn1i8DxR0eb6lJMCqlJmXBEC6tfhVnSSPDmkS8beCk7uYs9KQPvmy6EtM0t ov5YCFwP+JzEm7U3Uycf6supDxzdYiP6cSaXl6tlpuDzYFtriAoCKXNQC7wNXey4+9lq 1x9NoBcgr0Z5NSzA7BbQkCY/82Kuztg3aIrQgd/6AfaoUFubDTUWAjvlY7oBOQpvCp+K 3mgA== X-Gm-Message-State: AOPr4FX2Thp1K8VwY7dP1bpCeKUDUMAjwzf3sCQ6PvS4E2SQfO+kuEdidt2tHIONjHMLlw== X-Received: by 10.55.23.138 with SMTP id 10mr2461193qkx.149.1462962084602; Wed, 11 May 2016 03:21:24 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id r127sm3048446qkf.47.2016.05.11.03.21.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 May 2016 03:21:23 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 1/9] pnfs: don't merge new ff lsegs with ones that have LAYOUTRETURN bit set Date: Wed, 11 May 2016 06:21:06 -0400 Message-Id: <1462962074-6989-2-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462962074-6989-1-git-send-email-jeff.layton@primarydata.com> References: <1462962074-6989-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 60d690dbc947..08cd5f856321 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; }