From patchwork Thu Aug 30 17:42:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10582453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43D3417DE for ; Thu, 30 Aug 2018 17:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33C6E284DA for ; Thu, 30 Aug 2018 17:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2891328676; Thu, 30 Aug 2018 17:42:58 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D081D284DA for ; Thu, 30 Aug 2018 17:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbeH3VqL (ORCPT ); Thu, 30 Aug 2018 17:46:11 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:38099 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbeH3VqL (ORCPT ); Thu, 30 Aug 2018 17:46:11 -0400 Received: by mail-qt0-f193.google.com with SMTP id x7-v6so11304078qtk.5 for ; Thu, 30 Aug 2018 10:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=iVdjKP73AAIgXhtYXJOwe/s1mAUajIn/crILotUVzmE=; b=K3U7yiReTNV8tLdlhlyCDveaiyYKD6/S1YomreVW9abR6MgP/aTV13WO/pFdg0iGBj CP/AfEQ32ggKi6OdSuISyqbem6zfO+lqANTdm7cIXfyTObDUW5KteNud2RyVX2oogjss 8d2kf8hymTjIZDJR7S7tewGoF0EsPMgmTiq3ZUe3p66OvND2JHsplkfUzHqrQWzonVQj DqqEEMv4HNJnT5rfzKuWa0KE4iJVQJxnyEHmJphxIwyQz0W2yidwNJ1MmmxLnfw7qpwU qK9ZmUFhVOLMtyBqBTXnaNcNNmWvWeO9PSYTSIKFVmyu+BpyMFxjOhXn5gu2XUbLYS1Q bpwQ== 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; bh=iVdjKP73AAIgXhtYXJOwe/s1mAUajIn/crILotUVzmE=; b=AIXeNKrzjEfsc0gM4jXf5Id8LUp3ypNlW9XrO0I2KyUMHgwGyGfovIyzaEohzYQ3eN YXtgT4k+fhi43AOhCOm337PROwa/0CeyzpsF7DDDM7eIsNMDpKsDalbaZEfHsY1PTwWv 3awhjSRnWp5cvBFcMfCFrf2s3/VbJZzbhuFB79ZjwPnAdnLpfNNdl4aN2z5IkvG79Sb7 RYSyWVR51LORle7s2t/bpSv9uGPL9aKknrrhL3SCc/60vf4Y+x1wlMQ4lmGghxWtPXFj tqVMN7N4e1b8ZZBY0IE5Fp67LLnfhTjBq9ooPYl/2DEYgbQGJFFLlr4+E+Fp+RF2bfG3 7MUA== X-Gm-Message-State: APzg51AW72AzIaWGN5hxxIEjutv+ENBHswwUSjw19X7VK8Ix1q4pgfIH 2lo23nlJ2qkQrvB3DbJF3JSWgQ8U+dGGJg== X-Google-Smtp-Source: ANB0VdZibFGxS1vgCRNXEP6eY/HUHh2D0ur4/JpobQ7Ljla+QbCV5JvW/+PBPDGlNYiiwKFFfNRH4A== X-Received: by 2002:ac8:3c3:: with SMTP id z3-v6mr13021518qtg.39.1535650975493; Thu, 30 Aug 2018 10:42:55 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id f129-v6sm4097800qkb.40.2018.08.30.10.42.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 10:42:54 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH 15/35] btrfs: run delayed iputs before committing Date: Thu, 30 Aug 2018 13:42:05 -0400 Message-Id: <20180830174225.2200-16-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180830174225.2200-1-josef@toxicpanda.com> References: <20180830174225.2200-1-josef@toxicpanda.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We want to have a complete picture of any delayed inode updates before we make the decision to commit or not, so make sure we run delayed iputs before making the decision to commit or not. Signed-off-by: Josef Bacik --- fs/btrfs/extent-tree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 7c0e99e1f56c..064db7ebaf67 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4831,6 +4831,10 @@ static int may_commit_transaction(struct btrfs_fs_info *fs_info, goto commit; } + mutex_lock(&fs_info->cleaner_delayed_iput_mutex); + btrfs_run_delayed_iputs(fs_info); + mutex_unlock(&fs_info->cleaner_delayed_iput_mutex); + spin_lock(&delayed_rsv->lock); reclaim_bytes += delayed_rsv->reserved; spin_unlock(&delayed_rsv->lock);