From nobody Tue Feb 10 00:02:41 2026 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 C3E2E313523 for ; Mon, 8 Dec 2025 12:11:06 +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=1765195868; cv=none; b=i+imnK0Gd9lEtP9RSOCksyQ5LjHOfMRYLVzbRaplRm20RiH0xTlNFgkWG1xKaUCr2lQm8c3FYLef+mYmleGn7f8zzNFYI5PIBp/bv6n4zyF59k8qY5nnFe9H350AQEqLSCh8GnOJdXiR2MWcYYKoRZ1HaZCVKjSr5Jc2hMu3x4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765195868; c=relaxed/simple; bh=VlZgUuAKsZkQhKNfzcqI5wh1dvmrS6O//2iahLfBSA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i69a94mPElrQ6+pyLhuIfH7/yQaSZY1aXwQgHDwrZCEoTkXB2dQTFGO1syfx4isK2h4ksCM5bwBYdax/lyjUmxPG3zS9oZhwYhMsjZba28/SgDk7MGRaFx5yIPD5iadQ6zh1FXqv0d6K93Y2Q6pULXwj0CjX2Kth5H2ApJq6XRY= 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=BSf8GbHY; 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="BSf8GbHY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765195865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+3g+DHtAfN0xhOXLyepP76BJ3LQslId9qvhKNR5qEE4=; b=BSf8GbHY6YBE/XlA8Jjp7eDgZGIBPAV+pUg8gT393MGWc16NBvJUr7ckShokbnLBxW8rMk Rw80mT3gfLNolutn6j8PS2+6Te1Mfieh0Bxi2+u2SDuUpTg81Yzm9dUlvTZuQPqBJrTrtN DXQJk2AdDXskgx8YnMih8WRelBIuubQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-316-YOFxhWDIMl2j-uVaNl9jVg-1; Mon, 08 Dec 2025 07:11:03 -0500 X-MC-Unique: YOFxhWDIMl2j-uVaNl9jVg-1 X-Mimecast-MFC-AGG-ID: YOFxhWDIMl2j-uVaNl9jVg_1765195862 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ECE9518001C6; Mon, 8 Dec 2025 12:11:01 +0000 (UTC) Received: from pasta.fast.eng.rdu2.dc.redhat.com (unknown [10.44.34.3]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CFF1F1955F24; Mon, 8 Dec 2025 12:10:58 +0000 (UTC) From: Andreas Gruenbacher To: Christoph Hellwig , Jens Axboe , Chris Mason , David Sterba Cc: Andreas Gruenbacher , linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-raid@vger.kernel.org, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [RFC 09/12] bio: switch to bio_set_status in submit_bio_noacct Date: Mon, 8 Dec 2025 12:10:16 +0000 Message-ID: <20251208121020.1780402-10-agruenba@redhat.com> In-Reply-To: <20251208121020.1780402-1-agruenba@redhat.com> References: <20251208121020.1780402-1-agruenba@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" In submit_bio_noacct(), call bio_endio() and return directly when successful. That way, bio_set_status(bio, status) will only be called for actual errors and the compiler can optimize out the 'status !=3D BLK_STS_OK' check inside bio_set_status(). Signed-off-by: Andreas Gruenbacher --- block/blk-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 4f7b7cf50d23..95cbb3ffcf9f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -816,8 +816,8 @@ void submit_bio_noacct(struct bio *bio) if (!bdev_write_cache(bdev)) { bio->bi_opf &=3D ~(REQ_PREFLUSH | REQ_FUA); if (!bio_sectors(bio)) { - status =3D BLK_STS_OK; - goto end_io; + bio_endio(bio); + return; } } } @@ -882,7 +882,7 @@ void submit_bio_noacct(struct bio *bio) not_supported: status =3D BLK_STS_NOTSUPP; end_io: - bio->bi_status =3D status; + bio_set_status(bio, status); bio_endio(bio); } EXPORT_SYMBOL(submit_bio_noacct); --=20 2.51.0