From patchwork Wed Jan 10 16:55:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10155695 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 11A6F601A1 for ; Wed, 10 Jan 2018 16:55:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03AFE1FE8D for ; Wed, 10 Jan 2018 16:55:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBD4A201F5; Wed, 10 Jan 2018 16:55:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 725B71FE8D for ; Wed, 10 Jan 2018 16:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbeAJQzh (ORCPT ); Wed, 10 Jan 2018 11:55:37 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:44478 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbeAJQzg (ORCPT ); Wed, 10 Jan 2018 11:55:36 -0500 Received: by mail-qk0-f193.google.com with SMTP id u76so4913609qku.11 for ; Wed, 10 Jan 2018 08:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=HAQPKUujhJVKj0ZUmstwl/L1KMWkPnLL2nxVigdrL98=; b=uL91PpLEpoVvSL92Cv4in9ovX7kBAqwtlCRiFHERNh7KOrPcVr0psxYzFZ41/Vw9s2 1y96pDSMf1LzO5H1sNLwGvd937WgEZKQcP3+52+5nJEftp6aknWy7KmCMaDviRCC/U9F hXit2cR1wQ5JF0BfpINkPhQ5Ug6WHwOX32TmSudL/c3CBOY/fZ1LaZ15Ia8C0Y7Z0o0G E/3N4fSE7tcG6TUCiX2ckqNOael8ZUO1x+Pfa206lulAkgIg9zsCI2l4Dj6SrmHAN3au E5tiFzeSrmCxqYicTkeHtAMbrgC4Oj7EpP5AvgfYnyebvSxx5Dve6Y/9E+IB9xeH4v8R Z4VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HAQPKUujhJVKj0ZUmstwl/L1KMWkPnLL2nxVigdrL98=; b=uH2MkR/0PrbzvTmJxlWvqOo45NvBRVDHufeL8MFBncDOmkPXZ3GmyMNYmaRfEGg9BG 2q7PDn/jvBhhaMeEtBZZ5DlV1EaqQGQA0leC7+ZaY1Hw1cSw8WERQEP8nz1NpCXo/Rci 6CigB5f0e+5sVNTiIwGFVHKoKEWanQSQL2UmlAsJOSKjG0xZDj/0RhNeKNWvic6kQ7Or p3MAOOxOSI25mZJcXNmy63Mxa3hRBuhj8ANVJZ/VHdsPeYEb14qGc2Z4fhWmzUQ+4sPe eRnf8BAv41jN6L5Y+ZS1wy7CrAl8GMBBow08J4/4aKKIyR6PPRZIzoRBa+GuWm60LXHF GHyw== X-Gm-Message-State: AKGB3mKVtAZgC4+dmXUXr2ai/OcaibnU76ANh9xVI6QSfPMDGyrhj/ce puINCq4KPB3n03f4mF62d7SCySLKpTo= X-Google-Smtp-Source: ACJfBos2y4wnYiWptIQn4dI8GzpEJRdkDTVqCIr7Zk7NR2+AZvFK8RqeCtda3fDF+MOMz2VRJUwZRA== X-Received: by 10.55.42.21 with SMTP id q21mr26039144qkh.282.1515603336070; Wed, 10 Jan 2018 08:55:36 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id h21sm10906653qte.44.2018.01.10.08.55.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 08:55:35 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH] btrfs: return 0 for success in btrfs_alloc_data_chunk_ondemand Date: Wed, 10 Jan 2018 11:55:34 -0500 Message-Id: <1515603334-21423-1-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 2.7.5 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 From: Josef Bacik My delayed refs rsv patches uncovered a problem in btrfs_alloc_data_chunk_ondemand where we don't clear ret before returning, so we could have whatever left over value we had from trying to do a chunk allocation or whatever that may have failed. Since we know we've succeeded at this point just unconditionally return 0. This fixed the xfstests failures I was seeing with my delayed refs rsv patches. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo --- fs/btrfs/extent-tree.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index dbae25d882de..33c9efbfc9a7 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4387,8 +4387,7 @@ int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes) trace_btrfs_space_reservation(fs_info, "space_info", data_sinfo->flags, bytes, 1); spin_unlock(&data_sinfo->lock); - - return ret; + return 0; } int btrfs_check_data_free_space(struct inode *inode,