From patchwork Thu Aug 30 17:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10582485 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 A04CD5A4 for ; Thu, 30 Aug 2018 17:43:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F95128676 for ; Thu, 30 Aug 2018 17:43:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83F222C363; Thu, 30 Aug 2018 17:43:26 +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 2C84D28676 for ; Thu, 30 Aug 2018 17:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbeH3Vqk (ORCPT ); Thu, 30 Aug 2018 17:46:40 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:40304 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbeH3Vqk (ORCPT ); Thu, 30 Aug 2018 17:46:40 -0400 Received: by mail-qt0-f196.google.com with SMTP id h4-v6so11302289qtj.7 for ; Thu, 30 Aug 2018 10:43:24 -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=Vmwt0Cy/WxIAbUmDMizmrqJULNUg9H158POyDXrkHZU=; b=VFw6N4ngsgzHjqFws7CdPulPkOFp7qEP/bxO5mMR9GTan/Pu/aO2Y1F7q+AeyZ+OXc M9m+tuWLntnZMP11MwO7UgDj5m2bysa2z25UR63We5x7eGXx/QlXp4QQXx72lOfjrUY2 RK9KHs+bmfUlj10Cc2UcytKQ5Squd8jPVgA11+IqJ8HTp6AmdCHbZNnhplVyj8z+QrHf d/4jy60IusCVBfHBAU63o3NCSpNxwKv+C0nyXpZnesMM04lfaPaWnSQEWenCccvFKl9r m3fwgdRhDRBJLF2Wd+ipyDFPDPCOS0GzNaRX6dV9rRYjAJeHYI3yDtQYok2swIJg1pxN d/zQ== 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=Vmwt0Cy/WxIAbUmDMizmrqJULNUg9H158POyDXrkHZU=; b=CDWwqjiTGwIN69hinDW9fZYDUivgQIGqkiciL2dJwER3QPJD+gMb/wYCuQFeLgGupj l7s5yJXy/nYc3PYfxp30SEFIpC8Q2D70FL6v4r9oUSHV7BnyocGIidi+GxkL2N6Ri5/W kRnoMnkQOHn37IsMBNAufCWq4hOvGHIgb4B9G1rbG4wzzTSjtdiG835Meh07HQ0lD0kz /Qpcq/8n3bhEIw24SxoOpNFS7NQiJpLB2MGKsyP2QaJGFX6hPZ/pgdlAI6WYUlZaJF/t 4IllLLhWlbN+b1RPs5XpKa5Or0FIrBlzOXshQF9jzHZ2fdZH/G4gBllABgnMVXtKRdG2 TYGA== X-Gm-Message-State: APzg51Dd+SxdJ43ZOl/h0Mxmf3B4zoGBrHEou5XW8g7OkFRKf9ln7OJd sutPnJv5gTpfuXHtPWR+rhlDDiRWsIrJdw== X-Google-Smtp-Source: ANB0VdZaV87n58Jl1bE1zZgmdNAs2aXm3U08iop/K1Fw4I5IPqZR+WiadfL71ZQRg6WZ/ZacsbvplQ== X-Received: by 2002:aed:3bc5:: with SMTP id s5-v6mr12812763qte.207.1535651004090; Thu, 30 Aug 2018 10:43:24 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id x76-v6sm4466515qkx.25.2018.08.30.10.43.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 10:43:23 -0700 (PDT) From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH 31/35] btrfs: clear delayed_refs_rsv for dirty bg cleanup Date: Thu, 30 Aug 2018 13:42:21 -0400 Message-Id: <20180830174225.2200-32-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 keep track of dirty bg's as a reservation in the delayed_refs_rsv, so when we abort and we cleanup those dirty bgs we need to drop their reservation so we don't have accounting issues and lots of scary messages on umount. Signed-off-by: Josef Bacik --- fs/btrfs/disk-io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index caaca8154a1a..54fbdc944a3f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4412,6 +4412,7 @@ void btrfs_cleanup_dirty_bgs(struct btrfs_transaction *cur_trans, spin_unlock(&cur_trans->dirty_bgs_lock); btrfs_put_block_group(cache); + btrfs_delayed_refs_rsv_release(fs_info, 1); spin_lock(&cur_trans->dirty_bgs_lock); } spin_unlock(&cur_trans->dirty_bgs_lock);