From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43ED7D07D for ; Thu, 2 Oct 2025 17:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759425395; cv=none; b=rNKqHtg0dYIvlNeG+BAPxyaqc/AG7bcY8Ucz7FDnv2EdrcLcHC932PEWhCdVpqs3IdJXHIP5+NcJLbHLwineWhG8JbBPTFxHYB44GA0fCNB2d1Ppm+0uNvbPmHvu4avOvkgRxnJF3cIhAZGqxl002+qYFyCLNI1exp10t+n5/3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759425395; c=relaxed/simple; bh=eqDn2n47zBXwEfzuao5AJpDGCY3+38EubDDycidAmqk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NcCttyKOpPLQi/kyjMBB1UV9rDSm4Z1LShrOzd22Tiu9622QD44KmnJHi/eGli2LoStTQUcjwVgIASSIAMUg0mvxZWw+Y2SCm4SM5oq2lyCxAis2ri7m1tRQOvR6GUIhD8dVa/5vQJbAL2WEXTMF1CV7Awd31yYY4rD+P9qhbIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QrbAAgaI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QrbAAgaI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759425391; 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=uBZAPpBoJYcjxeUO1B1GGGCJTdS2JFaHba0BJbJEY5U=; b=QrbAAgaIF7NPC6+4LJizCkoVTm7fpQaui/O06njUs4wEus6f70PV+X4ymEJHBc14UyfiYi oqEDhXkwBpaZexuHOpUUAT2mM/QIF5Z5B6NQxDmnduTYBciEGvydakrZN1PReIutd9m78P Y5D/3QNQqmubyQrHwF7TF649o7GZ9NU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-K6v6lvvkPIK3OrG1_kg0pA-1; Thu, 02 Oct 2025 13:16:30 -0400 X-MC-Unique: K6v6lvvkPIK3OrG1_kg0pA-1 X-Mimecast-MFC-AGG-ID: K6v6lvvkPIK3OrG1_kg0pA_1759425388 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D8EB01956050; Thu, 2 Oct 2025 17:16:27 +0000 (UTC) Received: from bfoster.redhat.com (unknown [10.22.64.54]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E4D2D1800452; Thu, 2 Oct 2025 17:16:26 +0000 (UTC) From: Brian Foster To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: Christian Brauner Subject: [PATCH v2 0/2] iomap: ->iomap_end() error handling fixes Date: Thu, 2 Oct 2025 13:20:36 -0400 Message-ID: <20251002172038.477207-1-bfoster@redhat.com> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Hi all, This is a couple small error handling fixes for ->iomap_end() errors (via iomap_iter()). The immediate problem here was that the ->iomap_end() error return started overriding an iter.status error code, which on ext4 happened to trigger dio fallback to buffered I/O in some cases. Jan has actually fixed that separately in ext4 [1], but I wanted to take an independent look at iomap to see if it is worth fixing as well. The more I poked around the more it seemed like it's more appropriate to return the initial error code in iter.status if one is pending. I also eventually noticed the DAX vs. reflink case documented in patch 2, which further tweaks the error handling and supports the former reasoning. These are separate patches because they are separate issues. This has survived my testing since the RFC was posted and some Reviewed-by's have trickled in, so there are no real changes for v1 other than adding those tags. Thoughts, reviews, flames appreciated. Brian [1] https://lore.kernel.org/linux-ext4/20250901112739.32484-2-jack@suse.cz/ v2: - Added more R-b tags. v1: https://lore.kernel.org/linux-fsdevel/20250908130102.101790-1-bfoster@redhat.com/ - Added R-b tags. rfc: https://lore.kernel.org/linux-fsdevel/20250902150755.289469-1-bfoster@redhat.com/ Brian Foster (2): iomap: prioritize iter.status error over ->iomap_end() iomap: revert the iomap_iter pos on ->iomap_end() error fs/iomap/iter.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -- 2.51.0