Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1701900pxb; Thu, 16 Sep 2021 13:23:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWxR+MMnwmTWkFfQ2xnWRQfiExA3qz9gVyKpQbeKx7KT3HUID5nC/C7dTJClG3OMb4S/zL X-Received: by 2002:a17:906:f243:: with SMTP id gy3mr8238119ejb.327.1631823781732; Thu, 16 Sep 2021 13:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823781; cv=none; d=google.com; s=arc-20160816; b=yYyVixX8NWXWC9YIwPyW+TmzzkUW9EobV0VU66KcIw5yEbggnNao/exmYO4rFWqDgo uWkUCP6X5LlepTXarxKPX1tPk3HFT+3vlOqb4QHNMPEbzAGmp7XYjq2xl7TVCztA+nkl SD+gRPejKV2s5r/0Fxtim9YyCEHL9SNLUi09jtzSy5NGHKMFJHXaqkuMCKo53Ob7DQd/ q/T0tVxk2JPCpMqTmpKZaj5aRsNNuCytmyk17Iweu53mlQfmWqAqyYuXYq1PZHUeSBli yYWhyCZbLLlijW7Ra99iDfVpHbix2IAoDu9VnPFN7hGdx0xNJ/CHnfVxOVzwM4QLnfrz H9Wg== 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=uATE69Beg061PYd9T2qlsty1HAm2QvOyMAtl+XMM2j8=; b=WQagaCZMZMdwv4OCli5+4Pr6qO1cDV3RYBzsg1HGYzip8Ctk9e6PmwlFV/CW/UykF4 hNk4GkBfRGsFks1lI+0fvrCehZgb+lB9cPmWy6FHPYGRF4WtTRzB4RdNs0PWXKgEzdrN F8JdUgbi4cqPYg1rZWxOUdX2dbq39QfLNjlP1HFAlnUlnLaXc3uuqA+geUYMUNPdVn6e dMq8nHJdQNP88rILlUVa8jxG2NDKGaBxnWmRw3lZCEunRgM6natZU8bsDRE9E2csgxan 0vmRHhxxznxxexUMlnMvSvNzmQ9XviPFbIdtDuzE8Q0Htcsq+a8qVXHkgZPyqSGnhGJh b6Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="CLR/5dNT"; 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 a10si4509055ejf.122.2021.09.16.13.22.36; Thu, 16 Sep 2021 13:23:01 -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="CLR/5dNT"; 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 S241876AbhIPQ0X (ORCPT + 99 others); Thu, 16 Sep 2021 12:26:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241093AbhIPQTQ (ORCPT ); Thu, 16 Sep 2021 12:19:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA77A6138B; Thu, 16 Sep 2021 16:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808788; bh=Pa/TsOTkeToUqSfDytYXPjHwWOrJDllgJUZXJA2hrxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CLR/5dNTWSwaoUvqiIr8mukE5e1fciBAKZ343qrljutLQJ6Hzlq64IBTDsLel+OHI tFJ7TrmeOswQ4t8DYzNACYS37iY4fEfIDRcaqhVNgNK+vyew7RYBNp6RIsdzstqPkH tNYGjCO8BhBcaAckM8QNFWtQ8KeFZkRrYxMzCOuA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , "Matthew Wilcox (Oracle)" , Sasha Levin Subject: [PATCH 5.10 223/306] iomap: pass writeback errors to the mapping Date: Thu, 16 Sep 2021 17:59:28 +0200 Message-Id: <20210916155801.654535592@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Darrick J. Wong [ Upstream commit b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3 ] Modern-day mapping_set_error has the ability to squash the usual negative error code into something appropriate for long-term storage in a struct address_space -- ENOSPC becomes AS_ENOSPC, and everything else becomes EIO. iomap squashes /everything/ to EIO, just as XFS did before that, but this doesn't make sense. Fix this by making it so that we can pass ENOSPC to userspace when writeback fails due to space problems. Signed-off-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Sasha Levin --- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 10cc7979ce38..caed9d98c64a 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1045,7 +1045,7 @@ iomap_finish_page_writeback(struct inode *inode, struct page *page, if (error) { SetPageError(page); - mapping_set_error(inode->i_mapping, -EIO); + mapping_set_error(inode->i_mapping, error); } WARN_ON_ONCE(i_blocks_per_page(inode, page) > 1 && !iop); -- 2.30.2