Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2503516pxj; Mon, 10 May 2021 04:42:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2lE27nJ3y9Ug4mIiP8QgtCoGvVmd4VudaXXZISNNshDCLIDuNQ6tYUZWLGPnNdCG4STz8 X-Received: by 2002:a17:906:85da:: with SMTP id i26mr25499644ejy.287.1620646937611; Mon, 10 May 2021 04:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620646937; cv=none; d=google.com; s=arc-20160816; b=t2n0HoefY7rtg4C30YmKLFEOE3yb4A4fRZfA8qX4ouswXcy2jgo1glvPDKjaaz51D9 Qhmm/i7AcGjBf1vH7LXy/79tG/LTBp4g6F9GXbjIsFaRsXz+HvkfFGc42t99EY7Vagm6 qXenj0tF3+I72sNZTCPULG+7yIBIjEEZ55EvdKu7fBvedQ4zlmi9/QAMZPtV8OKKsp1Q tTegZs4iZarvYl5MugX0nFF3gQ6AQQ2OWfhPl7o3QVpn8WdjHGYHr4+J0Uk+kG6G/8aT tRmgQlTmP1Gp2ViJ7KWzWSBtMRG/RfrCZIwaty5BlhxI9fVL4qNdNvQe/Fa5zbqwJtDD j45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kZierIhl9Ygb/BE1jdLmsc3HV1/6f1NESfWSrlgfqgE=; b=qrg3Lcnbc/js7rrArrMwlba2azOmvd/kWiaS7cR7dAyfeE0iL3dxaO4SD1fjmKP30o 6RDAtO77lM/v9fda8r3Botrw/KZW6tbwN511VfberoKRxV9oPA6EcvbzOrGbAvl2kkY8 NCzhO8BJEdBO4EaG3EpnQmPHdC0apLBDihOLYR1eE8j1jXPpS3ZXuuYtYWiPo+C9rq9l lHFoDFAsUMqFlTTKqZmMJeB0EcNifO7MpDcCLNkiHfcxzLfaWoV0xvImSoZsY76vEvaZ FNCzAQlaS0LHV77edUZPu3826FObkYkIlxYW/MrkHP8OHsdlsRh/X5hjXZNvTZ6lHM9K NVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qveQtFeD; 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=pass (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 lk14si13117563ejb.197.2021.05.10.04.41.54; Mon, 10 May 2021 04:42: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=@linuxfoundation.org header.s=korg header.b=qveQtFeD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240963AbhEJLhN (ORCPT + 99 others); Mon, 10 May 2021 07:37:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:42076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233576AbhEJKy5 (ORCPT ); Mon, 10 May 2021 06:54:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C961B61970; Mon, 10 May 2021 10:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643328; bh=9UxqKxbzLJfVW1nRZBSiPPEQqqBLd5TtF5qWnJvu8aU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qveQtFeD2nGMpYe7j3z/sxaHve18U5t5fd2AxM1MQ+Z3Z9TaVrm3nbyN6EvGmHbNf E+Y4BXEv0nw6GzpRqg5bZvvESnYKbtMF9FJmXWbffoKCtuejVllLb7gJ3Z/CNpFtSE IwYHoujtn2BHAV1MYnf2iOsqrLyEJf0V/dvcPGqM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Liu Zhi Qiang , Ye Bin , Andreas Dilger , Theodore Tso Subject: [PATCH 5.10 269/299] ext4: fix ext4_error_err save negative errno into superblock Date: Mon, 10 May 2021 12:21:06 +0200 Message-Id: <20210510102013.820585699@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ye Bin commit 6810fad956df9e5467e8e8a5ac66fda0836c71fa upstream. Fix As write_mmp_block() so that it returns -EIO instead of 1, so that the correct error gets saved into the superblock. Cc: stable@kernel.org Fixes: 54d3adbc29f0 ("ext4: save all error info in save_error_info() and drop ext4_set_errno()") Reported-by: Liu Zhi Qiang Signed-off-by: Ye Bin Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20210406025331.148343-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/mmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -56,7 +56,7 @@ static int write_mmp_block(struct super_ wait_on_buffer(bh); sb_end_write(sb); if (unlikely(!buffer_uptodate(bh))) - return 1; + return -EIO; return 0; }