Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp452760pxb; Thu, 9 Sep 2021 04:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2/sWvQfOvcLuZxX+Xj6EvJfi7YgrODag1e7Nq+krdQbaAG4mMo89iz0V/M0m9f7Xww7N3 X-Received: by 2002:aa7:c993:: with SMTP id c19mr2789600edt.239.1631188632477; Thu, 09 Sep 2021 04:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188632; cv=none; d=google.com; s=arc-20160816; b=dQ7j2r+GYv+2caTSBSXcVXccOlrPfCnqhRjieZyKmtyox3wxvNSuyTwRDhgdh+K9pa A97AiHRi2F4Q1zk229s0M6R6UiW1C4aespbKqgiaR5RKCNj97Kc8QXQ3qhnXgdva1spf 5ofzntxjeaOk7XKj4NksLow6s3ZhBK72hlkUHJBEnHJhgvDdCfif9VoHlBlsbK0nBDzJ Jun1DmuHRK15zoP+6698mzgcFgmgQmgR8h3bW9rZtfwB2r/bhAz2iJyn6RrAsB5VEu7y bCOy+N1SDfJKVvzcxo4rFPiTpauIW10MwI61bc8NT02nScHd4Mrnw+g7894er3e/qNiE h7Jw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EeFqvEe6BTYlp4lfoWwcLfqhNc1bxhCZYJXC1kyd7fA=; b=vaI+zhcS8doqUw9QJkkaDkwI56Te36346ovLtSCCcNxg90vV+4lH26XngnVTv9vHTl feMitmP9JzlmuqARg7n5Sk/s6LHYwPSNGTYtkaWPYEzuagaKzbH46kmxCdV/ZN3DlYzy yngyMmELiti3TMCl4KTBZjcgsWsIiwEwedEdJCANsS7huu3WGbwBLQFQnYD+GBMjCmCC 7WUR5DR8tVDv+DqV2JhXQ1Ic293VwghNrH4AlbD/MnYquFCa0WOe6veWuLZc3U0RHBqg kBlOTO+x/HwdeXqwn7fhNpoL0uzJlKMNqSDWe/p28v7D3XDyba+ScOZ11Stlx8Jqj4X2 8F6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CrGW+5P6; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si1771587ejj.616.2021.09.09.04.56.48; Thu, 09 Sep 2021 04:57:12 -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=k20201202 header.b=CrGW+5P6; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242933AbhIIL4i (ORCPT + 99 others); Thu, 9 Sep 2021 07:56:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:33230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241089AbhIILxj (ORCPT ); Thu, 9 Sep 2021 07:53:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 570C76138D; Thu, 9 Sep 2021 11:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187881; bh=E0Wwtt/RpBwqOEd5e7ec+rsEkQxJmd7cg46/1odlycA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CrGW+5P6XFqDSyv4lLwvo3AyHMm/LrjG747uCDOu7xjg/LRbWqK7trnpxBCRaLmFo bbxZ/fHMEVOB3QtPXNEKyDBBsmMivaMJ1bgXMo4QAlxVZiOvmRCxN+67hB62eMWZcW mCSCg3TudC7nfceXFl6Q3jKP8HIRZj1niW4mAh7KCQ5Tiyi7rrb2ixnXvVNnvObdS6 wE2/hRZNDWTkzhsCn/FA4LHebUY7946qk/UGCI/ceuYbtdr3l/zCDrETiwBbjwjipB +JcJFij1Kg3ICwO69QhLgnvge6tKzeGrh9ZNE35/DVM/UYRHGCeXdqFL76rMslIe7A Xrj+nEK+6BaOw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Darrick J. Wong" , Matthew Wilcox , Sasha Levin , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 164/252] iomap: pass writeback errors to the mapping Date: Thu, 9 Sep 2021 07:39:38 -0400 Message-Id: <20210909114106.141462-164-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-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: "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 87ccb3438bec..b06138c6190b 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1016,7 +1016,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