From patchwork Wed Jul 19 22:09:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9853271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E7D0C602BD for ; Wed, 19 Jul 2017 22:10:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D836728700 for ; Wed, 19 Jul 2017 22:10:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD55728717; Wed, 19 Jul 2017 22:10:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EE3E28700 for ; Wed, 19 Jul 2017 22:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755421AbdGSWKM (ORCPT ); Wed, 19 Jul 2017 18:10:12 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36414 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755272AbdGSWKK (ORCPT ); Wed, 19 Jul 2017 18:10:10 -0400 Received: by mail-it0-f65.google.com with SMTP id r9so27486ita.3 for ; Wed, 19 Jul 2017 15:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=qWuvCHSHV47PrFeQgwOOOqfeSk+Q2ES5cvLKcUMnKbI=; b=gI15aCyTT5R+RjaOewMgfsOoF+ExmjibhPUAI2LMq9kSmpvKdw8ikBia5p4UmXN5UW BFEdeta2yzna808xPysg+lXgfo8bYub+nQZ9VdH8Eyk5UOzhvc5o5eMZzOGwFuOdDuUy rfapUl4GVsk4oi4fRNQfj4yHwMKjZUhbsfoTSNLLIoOI/2yqB/Sw2gK/ZMhHkdZo8q46 qMhqF5tpr0ojpQ7cyeMBHI0ldfKAJRbDl6YEr51WTHc32Cp9hN50QAh1mFn/ZOt3WeQW zAtf6i2vsmVgPQoIN5SdUERxK96U/Mnfp8JMxYJWp+7OIF9fxi6vYDW7HxbZTDBkAGq6 4oEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=qWuvCHSHV47PrFeQgwOOOqfeSk+Q2ES5cvLKcUMnKbI=; b=jqKzTX0kR9gLQlJqK1c9Dav8a8Ku8/JmqJaMjbXZxD5fXuHAoli10NJ3HNTRZ2QsYw AVj25zuuZvwXMC+luVJnyG2AXhZnKT8VrTL3M2BteKIjQA+y20t8NMOJfr20opr5F5bZ f/b7RGBlNAf1E1gZXg+cfS4bGvulmkeXZNX7UE+AtosBImAan/GtXtzmAjXJKQyjRwrf QlO9F1GVB+BjpNtIUmTysYGuDAkOz39FDL22RG1dMRaGbRHUmAC62tKt95YpDU+ciWXI rUASuZfLCNf5rns8REGgZ2CVvlpTSgVYP2GzKQsmExT/RF85mADgBWzZo7Aowon7twfw w7Tg== X-Gm-Message-State: AIVw112gSUXhLsyo2kMisXh08ocQF28xS7YaRdKWtyteEuoLxNev+Uij Av/xlFEGJyxzSg== X-Received: by 10.36.117.202 with SMTP id y193mr1401302itc.111.1500502210374; Wed, 19 Jul 2017 15:10:10 -0700 (PDT) Received: from leira.trondhjem.org (c-68-49-162-121.hsd1.mi.comcast.net. [68.49.162.121]) by smtp.gmail.com with ESMTPSA id 9sm518333iop.9.2017.07.19.15.10.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jul 2017 15:10:09 -0700 (PDT) From: Trond Myklebust To: Chuck Lever , linux-nfs@vger.kernel.org Subject: [PATCH 08/20] NFS: Don't unlock writebacks before declaring PG_WB_END Date: Wed, 19 Jul 2017 18:09:43 -0400 Message-Id: <20170719220955.58210-9-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170719220955.58210-8-trond.myklebust@primarydata.com> References: <20170719220955.58210-1-trond.myklebust@primarydata.com> <20170719220955.58210-2-trond.myklebust@primarydata.com> <20170719220955.58210-3-trond.myklebust@primarydata.com> <20170719220955.58210-4-trond.myklebust@primarydata.com> <20170719220955.58210-5-trond.myklebust@primarydata.com> <20170719220955.58210-6-trond.myklebust@primarydata.com> <20170719220955.58210-7-trond.myklebust@primarydata.com> <20170719220955.58210-8-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't want nfs_lock_and_join_requests() to start fiddling with the request before the call to nfs_page_group_sync_on_bit(). Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 84b6818e5278..bb38c881fc48 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -335,8 +335,11 @@ static void nfs_end_page_writeback(struct nfs_page *req) { struct inode *inode = page_file_mapping(req->wb_page)->host; struct nfs_server *nfss = NFS_SERVER(inode); + bool is_done; - if (!nfs_page_group_sync_on_bit(req, PG_WB_END)) + is_done = nfs_page_group_sync_on_bit(req, PG_WB_END); + nfs_unlock_request(req); + if (!is_done) return; end_page_writeback(req->wb_page); @@ -596,7 +599,6 @@ nfs_lock_and_join_requests(struct page *page) static void nfs_write_error_remove_page(struct nfs_page *req) { - nfs_unlock_request(req); nfs_end_page_writeback(req); generic_error_remove_page(page_file_mapping(req->wb_page), req->wb_page); @@ -1019,7 +1021,6 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) remove_req: nfs_inode_remove_request(req); next: - nfs_unlock_request(req); nfs_end_page_writeback(req); nfs_release_request(req); } @@ -1406,7 +1407,6 @@ static void nfs_redirty_request(struct nfs_page *req) { nfs_mark_request_dirty(req); set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags); - nfs_unlock_request(req); nfs_end_page_writeback(req); nfs_release_request(req); }