From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 590C08045D for ; Tue, 27 Oct 2026 16:56:59 +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 69RGtm2e031075; Tue, 27 Oct 2026 19:55:49 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RGtm2e031075 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1793120150; bh=3LMm7ZMCg71yLfLRzKdMovD8HgwJNU1YjxN2SBnQ+Qs=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe; b=EtNnodxSAn6mAoIAZiKo2D/HjWxMsqwdjJ+OIroBpXYLkJ59FeRCjgGk0qm/zTu+p ESXoy+6H3p4VJhApSfuIEJHaPYV77W8OzPRvFP1HZyc3cstWmWIDZb4Dq6fkpOvf0Q O86tWXASsYo3dcndZc+SFBxMunA8MsEmi5y/io79SLG+bDlAfIjF6DWNBiH/AvCaPQ xSn6GhyJqfSCIAN0ndTlx3E/tE8Y1nE8+kQekPm7EzMUVwSkMi5d/glht9lrcRkO+g HZK0j9UEGFTQd04hfIGsAQE2PWGWB5w2T+wtP72gcOqUpSYdR7rDBGHbahgR1xM91b K0/tJLRRNN2VA== Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69RGtlDr031071 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 27 Oct 2026 19:55:48 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69RGtlDr031071 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="fY15zgmg" Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-c429d9d05f0so2230666b.1 for ; Tue, 27 Oct 2026 09:55:48 -0700 (PDT) X-Gm-Message-State: AFq9FYKne2OecG0L6gc8mCv+JOpCNMIKM4as0fKLV03eVlXaWTpC/WPK 9Q3Z2U/FMwv0wzMwTHT75kwR9QUADqYRZZo6r03rI2KnNbPYd+DMkJOV4JuZNq1G8AWQQChM29a mPZ3n4t4MAhMd3VWZ8jctp6kvlf34xaI3CHMhN2gW2Q6JmrQRu9HsDQ== X-Gm-Gg: AYBFou0OKciOhvCVBRfEOJZ2to3EoyAnlY60SUq6WmH2XEcGpXzQ9kFQxoCrpNV6LuX deJm+1ZFTMsLU3CNoaHx1fsN1LJFyWgbhozlSX7rMeUoXWamxcDkLhXFO6wyXMAn0StpagRdReN UXZ/Jrnwqr9oEwAL1xZ8BzJ51VfKWpb/by5xX/wK7SjKGeZafszC/D6688SulZ927f2pl473Zwj lsXRmvOhxN1QKyay3x5a1xI6SWlKmYR5u0BWUjEGW1hsV1XySTLSX23hxTXDNA5kDNmr9nva35i eA7szP60rQ== X-Received: by 2002:a05:600c:870f:b0:4a2:150f:1613 with SMTP id 5b1f17b1804b1-4a35ac9983emr196559075e9.7.1793118784109; Tue, 27 Oct 2026 09:33:04 -0700 (PDT) X-Received: by 2002:a05:600c:870f:b0:4a2:150f:1613 with SMTP id 5b1f17b1804b1-4a35ac9983emr196558555e9.7.1793118783578; Tue, 27 Oct 2026 09:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793118783; cv=none; d=google.com; s=arc-20260327; b=BvI2k994cud/TimzXq9Z2fYyxyVfrxSbbgtMjgP4AupTyNkeKMzRQOoY+dZvuEYATQ 8G77fORyENqN3b27dSNtWJbfpSMAf6wPC8ghnEYCtWAkyTjREr892kOUPDYAAOARdMoT C9LqRCytDuqJee/LNjmV1u8Va2mcTh4b3w7V0kukbqM6XzBHI5uTFe3IEHFhlSA1yVoi ZOktByLthOp35ef9CFGnpk6XBHo7rvuEdOTZ/4eOOLLjwKvAFuufouHaTJqw1+lHytXn 1XqZVBaT8M7XyzMeCGB7BJnScBUt5kRpPB/qVKyDtmndU2qzwnwC1hGKiG38AAspngAC SCfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ky2bjxvPaI1DODKqxDcateGu/X5xJ1OQtisS195gZew=; fh=Kr/R+ZQiC/tid3qUs5C3px+AHPSuipOrrdrDcZfSlMY=; b=nsRurbAeuwLZLAo/KIKyZDM0CdjqOl5dJYBSlpR6hgp7LTVqFHg3fCmbVO3sz28hqv RWPJ4LxiiOuL/6mlbsHOTWT2wsbm9k89K+ZgQzR4hS3UQTcGXme7l5BFaOR07n7yELD8 fxbJpOpFCsN7uq8MKOczugtMj6v9AXstm4MyOwT+UWXs5jThwy/wO8Ukvr2NE19FEBlL lTid8KVbBW8eh/g50/FMVZiJYKOMIGy5V3iNHi+E3zkt/2eiGWB18SC0/d6Ppw7Sac4C xWfxOYvTvCk98BEvxJgPefpiuF7GIj6eMzq/M+3C/Dl7kzKMc4185ky5P5xIr1Oy4iDT KWUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=fY15zgmg; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:a5e9:5d2:969c:16de as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4a35a2c5288sor16659435e9.13.2026.10.27.09.33.03 for (Google Transport Security); Tue, 27 Oct 2026 09:33:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:a5e9:5d2:969c:16de as permitted sender) client-ip=2a06:5b06:b600:300:a5e9:5d2:969c:16de; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=fY15zgmg; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:a5e9:5d2:969c:16de as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793118783; x=1793723583; darn=openvz.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ky2bjxvPaI1DODKqxDcateGu/X5xJ1OQtisS195gZew=; b=fY15zgmgeOgU4DjBlaPVsDsB2+2omFC4HBYqhsGXDygshKkNNcFr1vpwfJmoI5RiPG D7aWYF4uj5FkhXvMKzWCIWyIpViwdx75Zcb616xFRuRU70Icamix06371WxrSd1E/npq 1td2EKKhBNSf4QmCci6Gf/7K1KW1Yg46pI9TMnhHYuqaSoBmUOMVtsp184TvjhGVLZth fWc8Gp5IxoomG13h1IIiQo0WBjKBWF+6YVXhAe2RS5RPm5xndlzQrKDRCTiFNwwCJmKL U3KTpFj3J//ZIG9zAP8JXccTJKFQGS+caAaTBRatwmcJVt0g67cBBGU/rGl7d8wbf8DA KaQQ== X-Received: by 2002:a05:600c:3e1a:b0:4a1:e250:b191 with SMTP id 5b1f17b1804b1-4a35aca6ae2mr204348315e9.17.1793118783028; Tue, 27 Oct 2026 09:33:03 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:a5e9:5d2:969c:16de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a9301b689asm870315e9.7.2026.10.27.09.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2026 09:33:02 -0700 (PDT) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com Date: Tue, 27 Oct 2026 17:32:56 +0100 Message-ID: <20261027163300.2166639-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 0/3] dm-ploop: fix acknowledged writes lost when discard and allocation share a BAT writeback 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 The hci-ploop fstrim test caught dm-ploop losing an acknowledged write (VSTOR-151979). Since "dm-ploop: fix and rework md updates", an allocation and a discard on the same BAT page can share one pending index writeback, and its completion applies the written page by the writeback's type only. A first write that rides in a DISCARD writeback is on disk but never reaches the local BAT: it reads back as zeroes, the next write allocates the cluster again and the data is gone. A discard that rides in an ALLOC writeback leaves the local BAT mapped while disk has zero, so writes after it are lost on the next open. fstrim or guest TRIM racing ordinary writes is enough. Patch 3 is the fix: the completion applies the changes of the pios attached to the writeback, and of the relocation done on grow, instead of filtering the page by type. Patches 1 and 2 fix older bugs on the same path that the old completion partly hid: a failed BAT writeback freed the wrong clusters, and the online merge of the latest snapshot left BAT levels above the top one. Tested on dev-cl04, 6.12.0-211.52.1.22.9.vz10 with the module built out of tree: - a reproducer racing cluster discards with first writes on one BAT page, 512 clusters a round: without the series 3 of 15360 first writes read back as zeroes right after the write returned and stayed lost after remount; with a 200 us sleep before bat_lock in the allocation path 1801 of 2560; the reverse order, a sleep in the discard path, left data written after a discard unmapped on disk. With the series nothing is lost in either order; - the ploop pytest suite, ploop and qcow2 formats, passes; - nothing exercises a failing BAT writeback, that path is checked by reading only. Denis V. Lunev (3): dm-ploop: fix freeing the wrong clusters when a BAT writeback fails dm-ploop: renumber BAT levels when the latest snapshot is merged dm-ploop: fix lost BAT updates when alloc and discard share a writeback drivers/md/dm-ploop-cmd.c | 22 ++++++ drivers/md/dm-ploop-map.c | 139 +++++++++++++++++++------------------- drivers/md/dm-ploop.h | 1 + 3 files changed, 93 insertions(+), 69 deletions(-) base-commit: 02401c5e378f282fbf11bdc65996253ff65dad9b -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel