Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1101533pxa; Thu, 20 Aug 2020 02:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztWJYErviwYmOoOVab9iB963D7ddMrIo9TtwTfgjxTi/QKX3Odfa0P/6FaFwgotGVvQWJa X-Received: by 2002:aa7:de8f:: with SMTP id j15mr1911475edv.135.1597915757106; Thu, 20 Aug 2020 02:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597915757; cv=none; d=google.com; s=arc-20160816; b=0rc4Dya+Vf0WaCpbbTq6Jjg3fGt33/8RicnCnP9XPQKuWf1QzPHy1lJ99VCt9aot6T Fpdr4tKX7s2qtveQhA2mP5lHMWaTcPb/uqWHAtvwltFvaVWeV/oWepHPH6hqOLQt6VgV NlYDFGIOOUxvrm5WlRHmg3le/jKaeGDZWTWd4ZPapd+9zceGfvKFBbISlwECqMVFRfX2 /Up3Lpviw38e8s60UkTxyMn4tMgAn/vjWOg8IynRRYVXcblHc0dikQ9YV7EvB0y9sf+L yq/eMGfyqPBbJ3ux750Mk2PgOSFIMKfDGY5Ba5ngpet0iYnOexMp2o4S9eX39UNSlB2I CHuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8hVjWoXiVvw4JfNaJltIUerhaCQR7/J4Gylr13dp/tU=; b=uFr4OB+uiY9Zk06wYvBdznetaeeBFPgbvnYczADqWbiePm8u1d8yMEgdsxN7oO25go 7IdnXDR1DJwzL3ysEh6sjWqZSPBXld4ko8vJe5ZmfipVTbTroRmPHiQO9hyy7mhMUIiO Q2UGroV6eGBNrGglL/nVrm1n+JyIvggla26OaibHd5pGhC0x4REhOKvxMmhzlsGp3vFB cyHJedGelx1ALeScE4FO2ZwsVK9rsUluilTyqoUXKgmLPso6OM+HaB72z0t9Z3+KbDXJ XvEWF9ZdChsDWxbl7SqDPZnGmiF5ugFgOCZcPJh5js35Xigf9Yk07BMny7GuOvAPMMwe rLWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PvAY3mLQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si843303ejz.135.2020.08.20.02.28.53; Thu, 20 Aug 2020 02:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PvAY3mLQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbgHTJ1S (ORCPT + 99 others); Thu, 20 Aug 2020 05:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgHTJ0L (ORCPT ); Thu, 20 Aug 2020 05:26:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52A6A22D03; Thu, 20 Aug 2020 09:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915570; bh=jGRWsaqRLoqev79/Xwgz7bNFRX+HkBGl7u0ryE7d7hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvAY3mLQdDaFZpm2IItRtcCwZrqPOpcnTvt0iSJgMZ4QE1PkNZdY4YZoeR68Wyp7W TvVQNtl8c4Bi9UHX0VETjJn0P99X9BTLgCVc/z+hXuorO1bT8Pab8VZssjbKVmna1k T7eMV0DVdzmPRNvfTGHIjI3DESP3wvmlTaM9AmRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , David Sterba Subject: [PATCH 5.8 031/232] btrfs: dont WARN if we abort a transaction with EROFS Date: Thu, 20 Aug 2020 11:18:02 +0200 Message-Id: <20200820091614.266545204@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit f95ebdbed46a4d8b9fdb7bff109fdbb6fc9a6dc8 upstream. If we got some sort of corruption via a read and call btrfs_handle_fs_error() we'll set BTRFS_FS_STATE_ERROR on the fs and complain. If a subsequent trans handle trips over this it'll get EROFS and then abort. However at that point we're not aborting for the original reason, we're aborting because we've been flipped read only. We do not need to WARN_ON() here. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ctree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3198,7 +3198,7 @@ do { \ /* Report first abort since mount */ \ if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \ &((trans)->fs_info->fs_state))) { \ - if ((errno) != -EIO) { \ + if ((errno) != -EIO && (errno) != -EROFS) { \ WARN(1, KERN_DEBUG \ "BTRFS: Transaction aborted (error %d)\n", \ (errno)); \