From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 326678015A for ; Mon, 7 Sep 2026 15:30:44 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 687FTOwG029625; Mon, 7 Sep 2026 18:29:25 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 687FTOwG029625 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="lHenBIaC" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 687FTNIM029621 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 7 Sep 2026 18:29:23 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 687FTNIM029621 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-490a767b782so29199165e9.2 for ; Mon, 07 Sep 2026 08:29:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBx69NI4qqLsHCDTBGv+mJ//zGNbnG58voG8Mw9hkYb0YbcR6q9UuyrJ71wi/aiQMOwK9T6tXw==@openvz.org X-Gm-Message-State: AFuF++l4tvck/HRNEhoRSsXIX0MlemTQa++iT0509qbC+xhQQgYeSO/p LSW6BZ5tYNTcUNnjTOu7R/J/5LqvNBt7U3JYRaLbi3E4TSsvvB35+qOWH7OlJnEMLP6APezD0R3 jERIgxs49Iz7/ohLsbbYLZiCtro6y6jO40M9wuKIg9rMt4Ov8RCxvYA== X-Gm-Gg: AYBFou0U+0jQaaR4vNYGQL5q3WXlhP2m2xhoh6KRagevSwauDsEeYydhDjNkMu98SDE +Aq36ltF5BxZemiween3t3J43jXaHlm3WmJ54dMxDojPu3SOEJ8UisqL/Y+SmofILnAeZebHkYR 0+oFy1nt1hSRiMkj4RoUkNPRPczAFca960lfs6ZjAK2GH5Ru0o0B4eydXBxeMtnRzRHLeqRUIWg nK98Yq9muaga68/JqOMhija0cTaVEo/UwVav4n6tajKPH5S+3iEOoJO6WK3cL04vheSnJCkINuX DHDqwnJZN+WhcJTjPUy4OSItenP8wuEFnZe9sbfQgIw7H3aof7/g22St4aHBUFsMdnSDCp3PSYS TGKT1XpBHhWH+uND1nA== X-Received: by 2002:a05:600d:8497:10b0:49d:daa:af6e with SMTP id 5b1f17b1804b1-49d0daab034mr60567035e9.16.1788794963133; Mon, 07 Sep 2026 08:29:23 -0700 (PDT) X-Received: by 2002:a05:600d:8497:10b0:49d:daa:af6e with SMTP id 5b1f17b1804b1-49d0daab034mr60566625e9.16.1788794962481; Mon, 07 Sep 2026 08:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788794962; cv=none; d=google.com; s=arc-20260327; b=YvKfdOgjwkYWT5g/1bBJ2sNkgXT7AOTzzHBgjZ80P4oa1nLacphtZ+0EWgPLzF09zz Mf427EJEyfku/Zip7a/dPekrIPMFM+6vdFLeB/7E+GnakHvHv0AFxvU39D0VqCGhrnto LdtAkRTnJfRKlhrBmPpC64QMCa1MIZCybOYr/j3ykV0mO6jbyAi2ho0PVCp7G/U7tQJV qMztnMmffHutqy0VtCzuP5wqjGDk2VvBBaUybhB72cSezENp2zKTAB5V/oLaCtT2lgYp WYlauBgKNu+OxnbDb1SPvpFE7Z1EA/FXop57Wk+CfY+GOV+CGG6nD5DIFDzKZLuQk/w7 CpxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=BNS1X0s+GQxI/FDpuHuwY13ns8yXHTZjL6NiT9l5oG0=; fh=r6+Zmi6Zkuz6nf4HEU+p6yogDiAZ5sP8/OfvuPJDKeg=; b=e44iDhqxu36bKFgfFntN+pSbsNZAgMWc/GVx2umNkK0VgSsmqwRIavyW9g+I1gumIN 9VMwib2CeGB0RTZseghHA7wbgH6+wP38+NWB4wYd2M3k/hHdaILVPtrp9dCjTb23GNSf ZVhfleLfVk3+P4iUDhsBb+zjV193QQG8jYNohW6HEXRjdG34ZKAYxT+L4rSqGD1Sop6v y1bWjjaiQsFTPLulEQNXJ9fkJijIEQVSDy0rI6OtTwzx1DhSXin5jEwe0PKJNwkDNkLm GVUGcssHJftwqpqJQCwZdwLFIpeOlVvmtaPbPCQPIEbE/UOLVaQ8slA2o1bklVl9+2WO SzhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=lHenBIaC; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id 5b1f17b1804b1-49cee800abbsi265718335e9.18.2026.09.07.08.29.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2026 08:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=lHenBIaC; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=BNS1X0s+GQxI/FDpuHuwY13ns8yXHTZjL6NiT9l5oG0=; b=lHenBIaCXFTw d8wLD6YrQQx8WVM+VnOw1LpYEOuuuDS87GjJN+HM3uu7sQSMeB+K5tUesub7gH+bxTCp8MxqX2RmU M8lgaam1UqgqFLrF7sboDRcoP0Eu+VExJN8VWgPnSH9FpieyQBZLe+9+wqXcpE1nPSlyyjg2QGxMA 6PKehj8NjTfEldWJUl51on2nPBsyXqWDPCct4jVCzwqZhr8ylkXWmwyN2NG8c8AYvd4Xj6dC4tszQ ogFCxjmkc5gI0LXfhEWJHK+A3b9mHdAOxUI+eocj/I65Zs8f4zA1W+EFVvQtJE/H3wfdISaSDV+VR FY4ZOLsqhSW/XvkC1BBzkg==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x3bF6-002K6q-2o; Mon, 07 Sep 2026 17:29:13 +0200 MIME-Version: 1.0 From: Konstantin Khorenko To: Konstantin Khorenko In-Reply-To: <20260907141009.1728909-1-khorenko@virtuozzo.com> References: <20260907141009.1728909-1-khorenko@virtuozzo.com> Date: Mon, 07 Sep 2026 17:29:16 +0200 Message-Id: <178879495683.1734901.12684619982505300765.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3261; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=P1Y8pQWlhc+DlQWmGpBVYy3sFteo55ydjhe5vf8jc/w=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqnthRPi/UxlerNN3v4bKgEM/En1CAFlI9PUQOL tl4bunEqAaJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCap7YUQAKCRBRlgpH+WFc KqDiD/0dRh+W2/EdeP41l2wQz0l3PFNASdNZXPRSHpAHa6nsCd5NyGT27xuImHqYt2U1Lz2pWhz ETNhXQvwRPT/C71L+HbTLDbdwincah98Gr/pk9COLhaSsL4VLEgpl//Tu0SeTf8iMI4rnfO9riG fj7oRk3fJxZH8rVZBIfj+rs1X+kfxIIFi/Xo+/o8PwmTf49uI7rIEqQi+2J8R5i75E4zZVj9XHV zFLdaPGljAfgNM8LEUTPwfzplVDOPQM6PoDPxW2S/wdeMoFr6/cBPim4yTF2miGZVxZfU0bEBBs j137AIxF1kBkQZVGRGe60BqlZXwYx5y/ULlcN4AULWyKsSyXJ27nuauao7kczmGPh+vxmyCwVVs NFvqIbZQSjGlJn43m/dgK5GBa4TVqqapxxQEg9mUlPtm6Tv2LdDWbLbB8wUDB6bp3hW8EVVCOkF 10bCc8REAhLW1e7aAGFAycZ2HqoSkWd/drm9NN3VDaTMFoBhgcmQUJGixigED67u4dE85Kw+KQ3 Qkl6Jp6Uu2Eyu5uiarkwYQcOlGSr2kfYt5CHuY0yhPwtOQbHAWgSHOwJY3vr+H4UAOxWRf4CPIf atvF1OEdiZ3d5XbWIEf1YgS3zTS0fQOd0V9rQSh23uY7BjM9kzjO78d2QDl764o7Bdp5wRKAkMl 9gdLxIlVYpQclIg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: OpenVZ devel list , "Denis V. Lunev" Subject: Re: [Devel] [PATCH vz10 v3] fs/ext4: let FALLOC_FL_PREALLOCATE through the vfs_fallocate mode switch X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org 1. Append-only files, pre-existing. A few lines below the switch the patch touched, vfs_fallocate() still has: /* * On append-only files only space preallocation is supported. */ if ((mode & ~FALLOC_FL_KEEP_SIZE) && IS_APPEND(inode)) return -EPERM; so fallocate(0) works on an append-only file while fallocate(FALLOC_FL_PREALLOCATE) gets EPERM, even though the comment says space preallocation is the thing that is allowed and that is exactly what the new mode does. vz9 behaved the same way, so this is not a regression, but probably need to fix it? 2. One flag combination stopped working. fallocate(fd, FALLOC_FL_ZERO_RANGE | FALLOC_FL_PREALLOCATE, ...) worked in vz9 and returns EOPNOTSUPP now. That mode value is 0x90, and since both bits sit in FALLOC_FL_MODE_MASK the switch sees it as one unknown mode and takes the default label. vz9 had no such switch and ZERO_RANGE had no exclusivity check of its own, so the combination passed, and ext4_fallocate() carried the whole mode down through ext4_zero_range() into ext4_alloc_file_blocks(), where the flag is read. Nothing is broken today, csd passes the flag on its own: fallocate(req->inplace_wr_fd, j->use_swapext ? FALLOC_FL_PREALLOCATE : 0, ...) but zero range together with preallocation is no longer expressible. 3. Upstream has taken bit 0x80 in 6.17. Commit 7bd43cc79cab ("fs: introduce FALLOC_FL_WRITE_ZEROES"), released in v6.17, defines #define FALLOC_FL_WRITE_ZEROES 0x80 adds it to FALLOC_FL_MODE_MASK, and ext4 implements it. Upstream also puts it in the group of that same switch which refuses FALLOC_FL_KEEP_SIZE, next to collapse and insert range, while the mode added here sits in the group that allows KEEP_SIZE. On a rebase to v6.17 or later the two are one value in one switch. Keeping both case labels does not build, the switch then has a duplicate case value. Dropping either label silently changes the meaning of a mode: drop ours and the feature quietly disappears again, which is the very bug this patch is fixing; drop theirs and a FALLOC_FL_WRITE_ZEROES request gets unwritten extents instead of zeroed blocks, with KEEP_SIZE accepted where upstream refuses it. Adopting the upstream mode instead of ours does not get us out of it. It reaches ext4_alloc_file_blocks() through ext4_zero_range(), where if (len_lblk <= EXT_UNWRITTEN_MAX_LEN) flags |= EXT4_GET_BLOCKS_NO_NORMALIZE; is unchanged, so it loses mballoc preallocation exactly like plain fallocate and does nothing for us. It also does real zeroing plus conversion to written, requires the device to report unmap write zeroes, and refuses KEEP_SIZE. So the way out is moving our flag to a free high bit, and yes, that needs a coordinated userspace rebuild. csd_journal.c carries its own copy of the value: #ifndef FALLOC_FL_PREALLOCATE #define FALLOC_FL_PREALLOCATE 0x80 #endif A rebuild against a header without the name would keep sending 0x80, which on v6.17 is someone else's mode, so the renumbering has to remove that block too. -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel