From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-00364e01.pphosted.com (mx0b-00364e01.pphosted.com [148.163.139.74]) (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 CEA1D38D01B for ; Tue, 22 Sep 2026 02:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.139.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790045662; cv=none; b=PVI/1QkkRoftnL0U/GF7TVEQ5gRvvOhQ7qtZ7MC1FaWM5pCo76xSflFJkaOgn3SYYHVJ6j1usljfhAr0WDXG2okBAsEvvaetQGIihaivnbRYGsM7roBDj6iI40sNrAFye/YWQlqmU5VYVKQB1Y2jYk4+eso4VNjjjOPCFbdrgeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790045662; c=relaxed/simple; bh=+NX+E9VVrg+IkpOn4F94en4KlIqUN7N51FNbjgbNX0I=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=rrSY58sQSGcag/qCHKFFPpO6e0u4NDnLhJsZs704ZlU4b/M6x+o4de6AS16Qrp3RfVBt4zjNgo2L0PtzE5Bk0DNQCL0nutOlpWtRryINC/eaXWjDole4wNv/cFR7/TuEB/steHY2tOnJsJs2li6zNatWuuTH5wS03UKaywWtd0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=columbia.edu; spf=pass smtp.mailfrom=columbia.edu; dkim=pass (2048-bit key) header.d=columbia.edu header.i=@columbia.edu header.b=khulNkai; dkim=pass (2048-bit key) header.d=columbia.edu header.i=@columbia.edu header.b=PTsQBJNs; arc=none smtp.client-ip=148.163.139.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=columbia.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=columbia.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=columbia.edu header.i=@columbia.edu header.b="khulNkai"; dkim=pass (2048-bit key) header.d=columbia.edu header.i=@columbia.edu header.b="PTsQBJNs" Received: from pps.filterd (m0499198.ppops.net [127.0.0.1]) by mx0b-00364e01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68M2X04C1444181 for ; Mon, 21 Sep 2026 22:54:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=columbia.edu; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pps01; bh=OnQKuo+ikBaHSZ2r1ZTqsmXlj1 SSrmY/7Jz3zqEVUv4=; b=khulNkaiQEEsAjJucAQlTLanmFCW6rkTaT1g2J9MzB 0wvZTi2o5QoqunAxBk4PcgYncW+ih5BBbpCazzT8o3SiW9BssxaSlaIma4FNPd+u cdt303prZ3jyqAOxWCfl3JPzMqJH+8VpoDprOxwRCzLUyQF89EejNIcrHbGRSeKO CI87ojfuk+rsbyvYNWsBwh+pFJtEUN0Vq8WMYXxRyntWwfw8omZZBCeYofNKYrZp I0oZu0kstDNlUQwNQrNtuQpwVWGFNyIkAbgs3B1DP7Ps6UN9k+r1VuO0wQQjYqHd kzavlXYl1UEzRsYyTxngkg/hTcmmnON0rlWukjwndUJA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0b-00364e01.pphosted.com (PPS) with ESMTPS id 4gudres2sw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 21 Sep 2026 22:54:12 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-532d420abc1so22758841cf.1 for ; Mon, 21 Sep 2026 19:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=columbia.edu; s=lionmail; t=1790045652; x=1790650452; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=OnQKuo+ikBaHSZ2r1ZTqsmXlj1SSrmY/7Jz3zqEVUv4=; b=PTsQBJNslWp6ICZhYSfMQcFfJzjfWTxBKc4JrMGQEQqut/x4knSSDZFAu2YMlY3TfS PWv+5LMNhagWst2LWF4LxcRsJGeyS3rZLXHJoGrGp1LPgtonAYpilHKtmbLhfVYlI9nu 81THK/E5Fmi+DNbcanm7aJZc2epbmcT5aWhdSmL6kFpLvLB42Ij+5wwbNRDcp9K7bu1G P88ZWVHXMfCDJ+SBV28I5ILYtwIEhYQWbJaeFUydm+KK6hPfeWtXu+Jd94sHCS9DuWrj gEzBqbwc8pe9xP+1up92+9mdMFb1pTPu92T/E5FhfgJIsYxQji3JQKEj6a2pVuszXsGs JPvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790045652; x=1790650452; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=OnQKuo+ikBaHSZ2r1ZTqsmXlj1SSrmY/7Jz3zqEVUv4=; b=eZ0JxKw9hdSDGDWMFR2BAxLYaqzN+NvPyKPssYZslKMKgf2Z/JGoaEzhJzcA/ha43I QOc2aKFHrVFMWcmklQXsCm6uJIp+KGtc70sLF3ZpJfrFxkTd2RvUGtJWdFPYSOK3ZwJY hqvVZ6bYm+ihzKH2ly9LFj6EuJvCXj2QZz7My4kzmYjWbeyezlbCB+TVpjfz6RLnp5gN DUTAL3T5brOZoQuoVEfSQOpoIj1IIbdGvCs6MiRE9BTUwi+pbzeMRgyt+fSkz++ADOj3 9PDKbg2uT19p12nc9l7idl4ICXbLalXSVpnD95qhAgUQR/bRmiqqbfOOAKvfKhB5SiJL CGYQ== X-Forwarded-Encrypted: i=1; AKwUvBz2Hp9mU63ET0CJGYS2YbkM2d06dhuUtGZ88gtAdBKm/3zKgW/6PEQFLxvurYEbekBSU0w86fv1EJAEsbQ=@vger.kernel.org X-Gm-Message-State: AFuF++knurHr0/heavMeb0aMtBZNIvB5n7PdYAzuXMpFSnBE/ie9qmXA Dr8/tQWOai4iVicMQwkWTKN6qRKOzXreRszFymv1Aa1a5t9QlDG4QPN70NpNbuZlNw0MkSce9UJ acM9fFKv5Trzrs6X5/pKocQ0TKlDOu1uyR+yDd/Vh9GiGPyelUl7u0Dt4gwMtfg== X-Gm-Gg: AYBFou3DwsyNEmEp/olVo1O5hjWl4msomENVD4kIqOCBu77G3LgDh7+pWPPDHFRDEm1 PM+sXw07fyiCpio3NxnQKloO3+pMrH8cosrtJNZJXVpC/FqAMqCCStDFuiqyZQhJUQdCYRoCZ1P /dwztUX38x1wnY5nvgf7ZzYsUQeOs9to3x4xVLYE6xm3y3b9paC6j3KsI8F1JdakSEJrkKmJlB+ Tm+FHNKjOdjmm3g73QOVAtYQGkB78yhKV75jF14/+ZTRgWiL1cGcSinyo/BFHb/0OlQSstpLoLT EwA//mQF/dDcURp8PWyy8PDHP80XVX8mzTvqHmBJqSpCx0lLrnpWAivR9o5Dt26ZK52JNvhqCQ4 eQhAUbhQlrvDoMHpSy323oyL4jtTpuY0dECEQwJ81Wfan X-Received: by 2002:a05:622a:1b22:b0:532:d202:3280 with SMTP id d75a77b69052e-532d8d69442mr38335281cf.17.1790045651962; Mon, 21 Sep 2026 19:54:11 -0700 (PDT) X-Received: by 2002:a05:622a:1b22:b0:532:d202:3280 with SMTP id d75a77b69052e-532d8d69442mr38335081cf.17.1790045651477; Mon, 21 Sep 2026 19:54:11 -0700 (PDT) Received: from [127.0.1.1] (dyn-160-39-33-242.dyn.columbia.edu. [160.39.33.242]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-532e18fce9fsm2048421cf.15.2026.09.21.19.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2026 19:54:10 -0700 (PDT) From: Tal Zussman Subject: [PATCH v4 0/8] block device fixes for large block sizes, IOCB_NOWAIT, and direct I/O Date: Mon, 21 Sep 2026 22:53:57 -0400 Message-Id: <20260921-blkdev-fixes-v4-0-e2801f71ede9@columbia.edu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAMXtsWoC/23Nyw7CIBAF0F9pWIuBAftw5X8YFzwGi9bWFEs0p v8u1Ri1cXkz99y5k4C9x0DW2Z30GH3wXZuCXGTE1KrdI/U2ZQIMclYyTnVztBip81cMtCi45kZ wiVqTRM49Pg9JbHevHAZ9QHOZNqZG7cOl62/Pf5FPvfc0/E5HThlVJTizkpWzhdyYrhlO2qsl2 oFM6xG+PJQzD8kLcMJJZlCj/ePFx1esmnmRPFcrADA5lmrux3F8AOD8nHI9AQAA X-Change-ID: 20260801-blkdev-fixes-771b1c314ebb To: Jens Axboe , Christoph Hellwig , Johannes Thumshirn , Luis Chamberlain , Hannes Reinecke , "Matthew Wilcox (Oracle)" , John Garry , Christian Brauner , "Darrick J. Wong" , Keith Busch , "Martin K. Petersen" Cc: Shin'ichiro Kawasaki , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Sashiko , Tal Zussman X-Mailer: b4 0.17-dev-db0b7 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790045650; l=3573; i=tz2294@columbia.edu; s=20250528; h=from:subject:message-id; bh=+NX+E9VVrg+IkpOn4F94en4KlIqUN7N51FNbjgbNX0I=; b=D7esfcR0mS5/bQIvufVYDU1AjZfnvVgPBUvy3n92NfMdUOAHeFGbAmZgcxaoo9epoBr1msk+n 1VK2NxVOWTvAcF0ND3eGLv5Vy9qagdU8VDGJCru7Sbm8+AusI3cvZ7J X-Developer-Key: i=tz2294@columbia.edu; a=ed25519; pk=BIj5KdACscEOyAC0o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KEDeNGhZcLl/drotGKDBa1Kc +TGORSsR2vF/6BI3a+cBSBJZDW4f8YkBJ5OVvCJqVoe3aSdg1PBt X-Proofpoint-ORIG-GUID: UqvviprXZwY-xTQHXmbiP_Vfij-WTxyR X-Proofpoint-GUID: UqvviprXZwY-xTQHXmbiP_Vfij-WTxyR X-Proofpoint-Virus-Version: vendor=nai engine=6900 definitions=11912 signatures=596817 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 spamscore=0 impostorscore=10 adultscore=0 phishscore=0 lowpriorityscore=10 malwarescore=0 clxscore=1015 bulkscore=10 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609220037 A set of independent fixes for the block device file operations. The first two were found by Sashiko while reviewing the RWF_DONTCACHE series [1]. The fourth and fifth were found by Sashiko's review of v1 of this series, and the rest came from asking an LLM to find any similar or related issues. Each issue has been reproduced, with the fixes resolving the issues. Patch 1 fixes silently lost mmap writes with CONFIG_BUFFER_HEAD=n. Patches 2 and 3 take i_rwsem around the direct I/O write fallback and the splice read path, which race set_blocksize() changing the mapping's minimum folio order. Patch 4 makes the buffered read path honor IOCB_NOWAIT instead of blocking on i_rwsem. Patch 5 makes IOCB_ATOMIC writes fail instead of tearing, and patch 6 stops the buffered fallback from retrying an atomic write. Block devices can reject both paths into the fallback before submitting any I/O, so we fail rather than issue a WARN() like ext4 does. Patch 7 fixes leaked page pins in bio_iov_iter_align_down(), and patch 8 removes dead metadata handling in the async direct I/O path. These issues are currently unlikely to be hit in practice due to the specific configurations required to trigger them. The reproducer for patch 1 is in blktests as block/048, and tests for patches 2, 3 and 7 are posted at [2]. [1] https://lore.kernel.org/all/20260730-blk-dontcache-v7-0-3e8e6850068d@columbia.edu/ [2] https://lore.kernel.org/linux-block/20260909-blkdev-fixes-tests-v1-0-1f8af8665d16@columbia.edu/ --- Changes in v4: - Rebase onto block-7.3. - Add tags from v3 (thanks Hannes, Shin'ichiro!). - Split patch 5 into two patches, per John. - Patch 5: Rename len variable to size, per John. - Patch 5: Move the IOCB_NOWAIT check up too, per John. - Patch 7: Expand the comment on counting the trimmed pages. - Link to v3: https://patch.msgid.link/20260909-blkdev-fixes-v3-0-1a5222c6e8ad@columbia.edu Changes in v3: - Add tags from v2 (thanks Hannes, Christoph!). - 5/7: Check for a short atomic pin in bio_iov_iter_get_pages() and return -EINVAL, per John. Dropped the tags. - 6/7: Use bvec_unpin() for dropped bvecs. - Link to v2: https://lore.kernel.org/r/20260828-blkdev-fixes-v2-0-32f3f40cebed@columbia.edu Changes in v2: - Rebase on current master. - 1/7: Add Christoph's Reviewed-by and submit the reproducer to blktests. - 2/7: Skip the buffered fallback for IOCB_NOWAIT direct writes, per Sashiko. - 2/7: Change the Fixes: commit from c0e473a0d226 to 3c20917120ce - 3/7 to 7/7: New patches. - Link to v1: https://lore.kernel.org/r/20260802-blkdev-fixes-v1-0-a82fc549fd74@columbia.edu --- Tal Zussman (8): block: use iomap_dirty_folio for block devices block: take i_rwsem for the direct I/O write fallback block: take i_rwsem for the splice read path block: honor IOCB_NOWAIT in the block device buffered read path block: fail a short atomic pin in bio_iov_iter_get_pages() block: don't fall back to buffered I/O for atomic writes block: unpin all pages of a bvec in bio_iov_iter_align_down() block: remove dead metadata handling from the async direct I/O path block/bio.c | 68 ++++++++++++++++++++++++++++++++++++++--------------- block/fops.c | 76 ++++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 103 insertions(+), 41 deletions(-) --- base-commit: 687cb38c4330d52d58dbf426a3eb523850052d10 change-id: 20260801-blkdev-fixes-771b1c314ebb Best regards, -- Tal Zussman