From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E2E9C43463 for ; Fri, 18 Sep 2020 02:07:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F394238E3 for ; Fri, 18 Sep 2020 02:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394837; bh=DDxF845h1pAP92mHR2gh3x4UCcQR5hpUgSszHYxM3+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mvNSuqBeKN0Oc5YAovXdLTii6W9tYR+fxE+sHYrsmpk3FTARzIikBT9gIVGKJLSub 6vZaEbZtGK2gpMeomG53NYkAxLyc2SmwjLNwin0PG2fUBtkJyG8AQPVwJvQ4xeN0mx OI+rxIgDyAHbX/WBZ6d830+MXJGj4xbfBauYbJVA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727895AbgIRCHN (ORCPT ); Thu, 17 Sep 2020 22:07:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:57128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbgIRCHI (ORCPT ); Thu, 17 Sep 2020 22:07:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 157C223A03; Fri, 18 Sep 2020 02:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394820; bh=DDxF845h1pAP92mHR2gh3x4UCcQR5hpUgSszHYxM3+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lC/aKjn9/UtHRLrLzoBoIzWwxKOdAiDL8+Ga0/2qu2EQ7sQn03Y55YSz0MFadK5vo GOIFrmHzJQ7f7562Dy0OWQmgR5/1ACKjJyFJoBOSDG+Xoqq9ew5Z+gKEpnfQopRFgl 0lQM1vw/KUu6d3lm8Ae5QfU5wk2nZNGBo+34/vMU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Sterba , Sasha Levin , linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 286/330] btrfs: don't force read-only after error in drop snapshot Date: Thu, 17 Sep 2020 22:00:26 -0400 Message-Id: <20200918020110.2063155-286-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Sterba [ Upstream commit 7c09c03091ac562ddca2b393e5d65c1d37da79f1 ] Deleting a subvolume on a full filesystem leads to ENOSPC followed by a forced read-only. This is not a transaction abort and the filesystem is otherwise ok, so the error should be just propagated to the callers. This is caused by unnecessary call to btrfs_handle_fs_error for all errors, except EAGAIN. This does not make sense as the standard transaction abort mechanism is in btrfs_drop_snapshot so all relevant failures are handled. Originally in commit cb1b69f4508a ("Btrfs: forced readonly when btrfs_drop_snapshot() fails") there was no return value at all, so the btrfs_std_error made some sense but once the error handling and propagation has been implemented we don't need it anymore. Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/extent-tree.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 541497036cc24..60c3a03203fae 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5429,8 +5429,6 @@ out: */ if (!for_reloc && !root_dropped) btrfs_add_dead_root(root); - if (err && err != -EAGAIN) - btrfs_handle_fs_error(fs_info, err, NULL); return err; } -- 2.25.1