Received: by 10.223.185.116 with SMTP id b49csp6330587wrg; Wed, 28 Feb 2018 07:41:22 -0800 (PST) X-Google-Smtp-Source: AH8x2256dcxocmbRNBeGJbMPNWkJdqHI6lgkQJnNBtGHJMoz9L1orsra9VMrOIcTYWT3aLo5xUV+ X-Received: by 10.99.63.139 with SMTP id m133mr14415397pga.174.1519832482203; Wed, 28 Feb 2018 07:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519832482; cv=none; d=google.com; s=arc-20160816; b=azu839htf/dvAu2P94zIAHda3a2Qy3qC2IPcyqVo/CgqxW0KGxloGhNUKg12OQWnAf haN5ty6oXXzngj42iC3Yf8F/QyPGKO1OfvWDnpPabjXRi8BxeQqaTjIPoGYwKeYnJh3N UpFiAuCV1GD2QT6nZWYBtb0tOHoJYgKPCkWNcXH2p1NT4wJhhiouWMGgVwYnqiG87Afz FfsYN2HRvQclOcwAen+QFCxQv7AgWuqmxJkGEuY/HZjPZ552+jnVhRRiyO3usd3IUnPW gOEPlVzoBlfRXvCEMiArLe0UiIULxU4ujC2aCi8XYB5ub/9s4TgV6pMfDH2kHnhtDNFx nf7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=EnJ65idMdTdl6aNiUVs+DRLv1f2znBJVcMnmMajmu/A=; b=AXDpZwhSG308puGurQGvIMqd2RYnkUV85G3MHg4Jx0wqAjoIFUwTnaZ4eOQFAz0aO4 gVe9Zh81BN2hXR7ShbRzg0kyNv1Cu8WFFjzhUcr+zLn31IreYAFxF0FKD59BpDC7eyEZ 9/ufcpRnA6wnssPINb966RN1IX3rTTiY4Lq8AQpFpgwnYuYLOCHBzGWnWr+U5V4KYJtP oYucZaWilkXoyTB0R5qh0Fz0Cot/V8whkKT/WZ3gx1ZmcGEAIMDMjMKmWufB765dEXiS 0np8FWRSc2dGLjQc7jtM9iOEzqEKwAurc4HGjty3g4514pn5v8R1vnbQGbhcJif443YB CkoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si1408109plb.717.2018.02.28.07.41.07; Wed, 28 Feb 2018 07:41:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933349AbeB1PjI (ORCPT + 99 others); Wed, 28 Feb 2018 10:39:08 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33199 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbeB1PW2 (ORCPT ); Wed, 28 Feb 2018 10:22:28 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yg-0006XS-Pp; Wed, 28 Feb 2018 15:22:19 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Ye-0008SH-U5; Wed, 28 Feb 2018 15:22:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Jeff Mahoney" , "David Sterba" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 063/254] btrfs: fix missing error return in btrfs_drop_snapshot In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jeff Mahoney commit e19182c0fff451e3744c1107d98f072e7ca377a0 upstream. If btrfs_del_root fails in btrfs_drop_snapshot, we'll pick up the error but then return 0 anyway due to mixing err and ret. Fixes: 79787eaab4612 ("btrfs: replace many BUG_ONs with proper error handling") Signed-off-by: Jeff Mahoney Reviewed-by: David Sterba Signed-off-by: David Sterba [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- fs/btrfs/extent-tree.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -8071,6 +8071,7 @@ int btrfs_drop_snapshot(struct btrfs_roo ret = btrfs_del_root(trans, tree_root, &root->root_key); if (ret) { btrfs_abort_transaction(trans, tree_root, ret); + err = ret; goto out_end_trans; }