Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2600852ybc; Mon, 18 Nov 2019 01:33:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwTsL3auf0gg0taZImzEnbGD3ZuJkh558+rBbwTL2F8rjmSRzP4TK5veNaQGVwCwa9pQiVa X-Received: by 2002:a17:906:3285:: with SMTP id 5mr24381485ejw.143.1574069600654; Mon, 18 Nov 2019 01:33:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574069600; cv=none; d=google.com; s=arc-20160816; b=zFrSPyIAb5dcJ0sFGjV8p31AISjS/NN2AP9Wm0jOJ8K82s5ERgdVNhKDH0g0ZaXtkJ qwzvXN0OXYVYo/c+R5W/ZbGEuZ8n1PTtoCKLewnzWYPI42nCSx0WWB6KTwQVkigzZVDb flYB/dEXyQnT3w0fRHRe0JLI6Uo0pTksmkCS5lWBUKJnNwPwcIeAMarKuC5b3mMfs2/g ZmE+aW6u0auHgPsw7GtVO3EIcP5PY8peE5LPZkXO8Eh4NjyFCBNPqwqunk/ev1CX1wkg HykEinLRWfaiu4wXKObpdIKTSIA54cLVmbExYd6GunPu5KsaQIGI729TxWKATcc9EGHo Jixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=1hFMezwrGVKWk0HMPWz7ztpF2aYShL7eOg+yvngRjPg=; b=VW2CKqhOF9Uw1jyWvOGw0n3AsDAC5wGw2N6wIh1jkA3Hx73bAsMvo5estAYT+tXC8R pDUsSNK6hu9mmSyOix8x2kwtJEvCJgvluUMCniiTRk2Cya1Ug+vodMKcSbPF4XW9Bwn4 H8Yz/Aoy3HbEx5dpfQStOHw/E762HB3aF+bdAgOoLdEU8uZl33WY5Ekm4ZDCzPgj1dsa LcPNeggVlX4zSJ0IzrD7UBByCcu7DQVsbeNhyJdeVKLbRoRl+1UtsENxHoArZ1YP7jCF gncxSced4Ap7ZmBtDrlYN2dm1txn7cT/qKa+rfWEIyuA54zI1vIQxisbmonpbhxgHrJ3 sWWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M82pkd31; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si13858366ede.45.2019.11.18.01.32.56; Mon, 18 Nov 2019 01:33:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M82pkd31; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbfKRJbu (ORCPT + 99 others); Mon, 18 Nov 2019 04:31:50 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36309 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfKRJbu (ORCPT ); Mon, 18 Nov 2019 04:31:50 -0500 Received: by mail-lj1-f194.google.com with SMTP id k15so18062849lja.3 for ; Mon, 18 Nov 2019 01:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=1hFMezwrGVKWk0HMPWz7ztpF2aYShL7eOg+yvngRjPg=; b=M82pkd31rW+kbu60py2lDuLFMqw420cdkQJ/2Ha6dBPWr9LPoKweQEassu1OHR1C31 fQLWmajTPKvRB+Rg6EgKFsqWrabyYMwNT0Cpgvu1d7kfUr172ylV9FTY0JrabkphE61d VTbNz295/zA+9+qr36ZpEKL53ZZNCC1Nu4N/60OsWUM9Cz59d7+LW5WSBRGetib61ymC /Jzq0/Fs7vmHcqLG+VOnSxw+cpz/gIkmsjtpwcdrU2cfsWhvU6fh2eDwLOlkNXlyxyy5 qDtJk4K92sAvLa20k7IJD+EDDfpIlSlFCnQrsIvqI4MnH/V1Ywk9V62upXbTsOtmMhvU Tnkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1hFMezwrGVKWk0HMPWz7ztpF2aYShL7eOg+yvngRjPg=; b=a3aBtuk8T2kOLnbIppILOJgmVVXTyEz3NUKS5nWWrd4Rm5LsTBtTiG1W4/OtNvlPAa HXiqxHhNjV5odsguTwZS11Cn7CvVMPMQufs2c4Q2HQ4UThsq8B65XdpqMFaVD4tEKDL1 Cr0RRJSUvJexHZcWqvD9WJ15/IrO2VaWcv8dxM6wgofueXtzhS18gfAvMTMPOXCo5sUz nSJJIjQ+RYurPOXD3gTqJZmhhTXN6eoHuCYeS3U2TRdacDMZmDUFUAIR+KgbkbqhDaI+ GeXlfmNCZ/Nil9B4SNQ6AvzlAE97E6rx/kCQtTDULPUhZUUNGf6SrShB8V+7nHpmgsvg yU2A== X-Gm-Message-State: APjAAAWsh27mDxfhAWYukIdTCPoEBWm5caKUEbw2kT0+diBppvbewDjx Lskd9IZWXsZgSsiZYGt58ulApRJIuw== X-Received: by 2002:a2e:7c12:: with SMTP id x18mr8100184ljc.130.1574069507769; Mon, 18 Nov 2019 01:31:47 -0800 (PST) Received: from localhost.localdomain (ti0389q160-4901.bb.online.no. [88.95.63.95]) by smtp.gmail.com with ESMTPSA id w11sm9521631lji.45.2019.11.18.01.31.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 01:31:47 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn Date: Mon, 18 Nov 2019 10:29:35 +0100 Message-Id: <20191118092935.4283-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191118092935.4283-1-trond.myklebust@hammerspace.com> References: <20191118092935.4283-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If nfs4_delegreturn_prepare needs to wait for a layoutreturn to complete then make sure we drop the sequence slot if we hold it. Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn operation for return-on-close") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d1a7facfa926..2d3c12f68204 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6256,8 +6256,10 @@ static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data) d_data = (struct nfs4_delegreturndata *)data; - if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task)) + if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task)) { + nfs4_sequence_done(task, &d_data->res.seq_res); return; + } lo = d_data->args.lr_args ? d_data->args.lr_args->layout : NULL; if (lo && !pnfs_layout_is_valid(lo)) { -- 2.23.0