| Message ID | 20260511072344.191271-12-yi.zhang@huaweicloud.com |
|---|---|
| State | New |
| Headers | show
Return-Path: <SRS0=lPfg=DI=vger.kernel.org=linux-ext4+bounces-16407-patchwork-incoming=ozlabs.org@ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org; envelope-from=srs0=lpfg=di=vger.kernel.org=linux-ext4+bounces-16407-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4gDWqh2kfWz1yDx for <incoming@patchwork.ozlabs.org>; Mon, 11 May 2026 17:41:04 +1000 (AEST) Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4gDWqh2F51z4wJ6 for <incoming@patchwork.ozlabs.org>; Mon, 11 May 2026 17:41:04 +1000 (AEST) Received: by gandalf.ozlabs.org (Postfix) id 4gDWqh26rFz4wJR; Mon, 11 May 2026 17:41:04 +1000 (AEST) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org ARC-Seal: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778485264; cv=pass; b=A68overR7pH/ComZJ8UpH72vLxIkoDw6G+iSxJjRGF87DDQ+hyUGbN/ZEn99OQeEtlQ5x/UyLWkfosywmNRTB4WZcKUXsaIne0e8B9DBMzXULu9oW4VoXZJw0wEvzbeEDhboO3IYu47WjwippPbXgQBDLLsWOTSK0VyfoTsYUa22aFktTwuFR8xo4gKAPc6GPC01rre4cP6kPPwbgRSH/CX2sgoFEZA+USp3URyMpc6lstaLGCMg9m51NW7QrVJPsi6zSSucdZk1rHcz/PhB65UXzpV+4XJeOnJ2233+PTg+BYdGyzu6nhtB7HF1gbi+2y/rjYhR9aDA9AcBYdw9rA== ARC-Message-Signature: i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778485264; c=relaxed/relaxed; bh=hzVOsYcOckapauAO65Yxwq09mTnpb8jS6pIW32G9kkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lxiN/zbU1ftRBqyPhSDvM3cGLQVybcjG0Vv8YV/8qp4oJMEB9UGmxh6guVu0mMFkFvxpcesd/H1RyxaDPnNtBe1ABF3BtE/y9YUN3vEs7ns7782oSP/tZhUdp/mwkMn/SW/kDUOOwoz1O+2RCGrdcWuWeBRO9mZmck8Eb14vNZf7DpbZn8Y4HwJm65U7Ul3BC4MWgjc0kFNlkfE4fV6yStAflc9BcFoWSIJ29VkTV9vTA1vKnPcoQZaOEXKP5HUd44WdY+gdE1BGE7cNjPT0QfYx5b0sQc/HphkXAAGb1GJE7zlYJ08Lusyyhyzon1dJlMVy8jXe9L9V43ZpG+ZHqw== ARC-Authentication-Results: i=2; gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=linux-ext4+bounces-16407-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=linux-ext4+bounces-16407-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4gDWqc4chcz4wJ6 for <patchwork-incoming@ozlabs.org>; Mon, 11 May 2026 17:41:00 +1000 (AEST) Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id D1B6E303D2C1 for <patchwork-incoming@ozlabs.org>; Mon, 11 May 2026 07:31:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0A9F39A04B; Mon, 11 May 2026 07:28:43 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (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 7E1C73939C0; Mon, 11 May 2026 07:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778484523; cv=none; b=QFW5/GVhoTVJyxE6SEiaVQiZqIz03XIBI6IBnP1O225qNOfEtWfnH73GvqxvEJlAKpST2sM0nGj/QIsSC3RxH6/hhxzf2adWtG5+n9hcXj0cKq/Sq7UupjwJWrqLRr14TYDJ3y5StjVeJ1Wl4lyIfZAPCIpWQ8Siake6qhha1iA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778484523; c=relaxed/simple; bh=2wZ4jznOhPUYM8F9x4n6kgyHx1pEIWJdJlky+NdfO6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hNHCQfWPdJJtdDMb68jRGAurJuZh8IwBnnSLYq4LnIXYZe13niN/qr/+GmghnTGq1ebv8NtFFh223a+7EfEThWtuFxRDOfqCMqqV4UP56ZKTieYtOyWQki+36v6tQdPk8psG1x0AnHdE/WTrry58ENcgZd9YhwlFZFOMdh122wQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.170]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4gDWXV5F4JzYQv34; Mon, 11 May 2026 15:27:54 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 64F954056E; Mon, 11 May 2026 15:28:23 +0800 (CST) Received: from huaweicloud.com (unknown [10.50.85.155]) by APP4 (Coremail) with SMTP id gCh0CgD3v1sKhQFqAy6MBw--.28537S15; Mon, 11 May 2026 15:28:23 +0800 (CST) From: Zhang Yi <yi.zhang@huaweicloud.com> To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, libaokun@linux.alibaba.com, jack@suse.cz, ojaswin@linux.ibm.com, ritesh.list@gmail.com, djwong@kernel.org, hch@infradead.org, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, yizhang089@gmail.com, yangerkun@huawei.com, yukuai@fnnas.com Subject: [PATCH v4 11/23] iomap: correct the range of a partial dirty clear Date: Mon, 11 May 2026 15:23:31 +0800 Message-ID: <20260511072344.191271-12-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260511072344.191271-1-yi.zhang@huaweicloud.com> References: <20260511072344.191271-1-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: <linux-ext4.vger.kernel.org> List-Subscribe: <mailto:linux-ext4+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-ext4+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3v1sKhQFqAy6MBw--.28537S15 X-Coremail-Antispam: 1UD129KBjvJXoW7ury5ArW5Wr4DKF1xuryDJrb_yoW8Zr4DpF s3KFs8KrWDX348ua4kZFW8XFnYya9rXF48JrW3Wwn3Wa15AF1FgF1v93y5uF97Kr47AF10 vF13trWxCr4DArJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUmS14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2 kIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkE bVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67 AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI 42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF 4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBI daVFxhVjvjDU0xZFpf9x0JUQFxUUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-Spam-Status: No, score=-0.7 required=5.0 tests=DMARC_MISSING, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org |
| Series |
ext4: use iomap for regular file's buffered I/O path
|
expand
|
Plase send the iomap patches out separate, including to all the relevant lists from the iomap MAINTAINERS entry.
On 5/11/2026 3:46 PM, Christoph Hellwig wrote: > Plase send the iomap patches out separate, including to all the > relevant lists from the iomap MAINTAINERS entry. > OK, sure, will do. Best Regards, Yi
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index d7b648421a70..64351a448a8b 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -176,13 +176,17 @@ static void ifs_clear_range_dirty(struct folio *folio, { struct inode *inode = folio->mapping->host; unsigned int blks_per_folio = i_blocks_per_folio(inode, folio); - unsigned int first_blk = (off >> inode->i_blkbits); - unsigned int last_blk = (off + len - 1) >> inode->i_blkbits; - unsigned int nr_blks = last_blk - first_blk + 1; + unsigned int first_blk = round_up(off, i_blocksize(inode)) >> + inode->i_blkbits; + unsigned int last_blk = (off + len) >> inode->i_blkbits; unsigned long flags; + if (first_blk >= last_blk) + return; + spin_lock_irqsave(&ifs->state_lock, flags); - bitmap_clear(ifs->state, first_blk + blks_per_folio, nr_blks); + bitmap_clear(ifs->state, first_blk + blks_per_folio, + last_blk - first_blk); spin_unlock_irqrestore(&ifs->state_lock, flags); }