From patchwork Thu May 25 08:38:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13254917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A399EC7EE2C for ; Thu, 25 May 2023 08:39:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D5C1900002; Thu, 25 May 2023 04:39:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 184D56B0075; Thu, 25 May 2023 04:39:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 073EC900002; Thu, 25 May 2023 04:39:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E9D8A6B0074 for ; Thu, 25 May 2023 04:39:10 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B179D40AD1 for ; Thu, 25 May 2023 08:39:10 +0000 (UTC) X-FDA: 80828127660.13.B45C053 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id ACF001C0015 for ; Thu, 25 May 2023 08:39:07 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Vk7c7bG6; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685003948; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Hkz4KYmd+qyivCKCvtUuaLboauM+EJmqeUCBu8NMbLs=; b=6wdgsSmirUapvkqvW7gkHGJEdHCaiclxko0yRIqkaNdIw+eiWNCG78n9lZRVIgx3pEFGJv ddjN0BuIdniK5++XzP9c9y6AM4NZ88f09YvDg0ONFtUD96ibIyL2NF/xjNkQxI+nqaPKS3 5HG4raoxTRUi5fWa2Xem6ER9IDvUlo4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Vk7c7bG6; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685003948; a=rsa-sha256; cv=none; b=z8TaMxtKNleb+nC8UGCgrQl/KhsJ1cSVBCuR7jp73qbCzLy6eXb89GzG9OzNnhNB5sCcSP ZSN3IBY8K+IGNbEFSH8Cf5VJh1hhcrtcx9il3bOQbTa5uMkKifK2Im+tkDbhL/b8JLvLtp 3xTj7dzeWkE0tNshcqY8Mj/l85Elmvw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685003947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hkz4KYmd+qyivCKCvtUuaLboauM+EJmqeUCBu8NMbLs=; b=Vk7c7bG6eLsQq9i9j5O5xrzeKLsVUb50H5vQuVYgyvXspg/e2CedBqDaJ2y0Hl+rntilfW Vx7dWFRmVLz8jvW1DPOTDnhRLekqsQWv4pSD8iDkqiXFiWIP8+AUgU7n2b1NK4GEzsPcBO zK6WemY8WuNn0TG4gyD5uCHi9pJuAGA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-0cOG5D8xOvCHAP0HOjqVgw-1; Thu, 25 May 2023 04:39:01 -0400 X-MC-Unique: 0cOG5D8xOvCHAP0HOjqVgw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B6F885A5BD; Thu, 25 May 2023 08:39:01 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.192.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06397492B00; Thu, 25 May 2023 08:38:57 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Damien Le Moal cc: dhowells@redhat.com, Naohiro Aota , Johannes Thumshirn , Christoph Hellwig , Al Viro , Jens Axboe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@kvack.org Subject: [PATCH] zonefs: Call zonefs_io_error() on any error from filemap_splice_read() MIME-Version: 1.0 Content-ID: <3788352.1685003937.1@warthog.procyon.org.uk> Date: Thu, 25 May 2023 09:38:57 +0100 Message-ID: <3788353.1685003937@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ACF001C0015 X-Stat-Signature: y9c6ywft8gm3c1jeq94dhqecn48es9w7 X-HE-Tag: 1685003947-604516 X-HE-Meta: U2FsdGVkX1+OJ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cQLm+rF05Qtu3E2D+PrxxzI++2h2RDmA+ZWPUgOc3i+P6LvYNfMmQxCgCYJajLyzWsALa41dUFPX8W0YxWgYRw6viU3M+fOpGkYELlNFIVcdaPJ8d2aJFbx78/T4Zf/UadE97dYMj2l1toZ7YdvD7CarVam7AMqRWi3HJ+y7lnkiTtxL0lPHrMi7ss9be/kF2ihh49B5iPTI0bwPpsFElYTBgaDDdFKrQCHpmXI5yWRYx4bL1ZKoabCyvrmipQaJ/wbS5ExKObIgUtvthQqn3hoAb4ZdrHT6fliyn/y7ysDH8drKCpO3HB4jMZ8q0Iae9/zrmdJomVdkjx8sZqmMFswTFcmqs1Uf8vfwj0Fvo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Call zonefs_io_error() after getting any error from filemap_splice_read() in zonefs_file_splice_read(), including non-fatal errors such as ENOMEM, EINTR and EAGAIN. Suggested-by: Damien Le Moal Link: https://lore.kernel.org/r/5d327bed-b532-ad3b-a211-52ad0a3e276a@kernel.org/ Signed-off-by: David Howells cc: Naohiro Aota cc: Johannes Thumshirn cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Reviewed-by: Johannes Thumshirn --- fs/zonefs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/file.c b/fs/zonefs/file.c index 65d4c4fe6364..0660cffc5ed8 100644 --- a/fs/zonefs/file.c +++ b/fs/zonefs/file.c @@ -782,7 +782,7 @@ static ssize_t zonefs_file_splice_read(struct file *in, loff_t *ppos, if (len > 0) { ret = filemap_splice_read(in, ppos, pipe, len, flags); - if (ret == -EIO) + if (ret < 0) zonefs_io_error(inode, false); }