From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90E7B2E8B98 for ; Mon, 27 Oct 2025 08:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761554552; cv=none; b=U0gVPpE9aJzfZGNTol/MePUfKrEwUQdPfWrBxcxKvdOqtZrYt4gB3ZA6cagyoBjf3D84izDeuCA8zKZjO9+gOLtHD7zouCRkD4dWrNuUAjwrbQgTD0K2XzXcpDGBHEDwuyBVyRO6ZcBqq/QgjSl7ZtPLSeWCj1HFRbHjfoCXuxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761554552; c=relaxed/simple; bh=UG8pE67BLGZgv3QifxWbYYEqvT3PKB5usDKrFSSOST8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P4BJfC8oQM2DxJRbqPYLBPZ8C1OfGLrGR8xEW4FPqGvjGCsaL4N/YSnH9V4Cix2JHfkMRZL7/Z23YD83SxhMF5EiVUJGiutHWNXJglf2EP8g1feYvSV2j+x1EtuEuTp1MPLn47bkNXWzK/wSt7qVO9aJUvtS3B6y95HikaC50IU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XqjB7C5L; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XqjB7C5L" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b50206773adso719723466b.0 for ; Mon, 27 Oct 2025 01:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761554549; x=1762159349; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iFlBtrits7DNlZ6h+mgbiMIVvWdiVqZSUXzsme0rVO8=; b=XqjB7C5LPWP8v1O/LtOb5hVcvm2qj2SwzTlChqtPtUMgZnlgH7ucavK5B+v298j23q P5ylsNi50aUBQYmuNKKY6wZ4u9kIX0bcAACuu0uTZP5gNgrmWeHF9RS3SYUNiYrsV9hi jw68LB5qBHL1oLTJmdGeTXAsGqQwaIu723ASZZ5/Y+ef7M0N8iGUmntdnlMsdoN3UyX+ v9CaEMsZkGhGjg2W1LDb5WvG5jG7tPpnO9bNs0m7vQ5pCkLT++JcW27nKLMOOcIovJ0C axu2Wh/gaNpRO8t8ialftmU/opYgETRhk+vGssGoXw/vpDJiQj2phGwTey//KCNSKnFo 1sVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761554549; x=1762159349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iFlBtrits7DNlZ6h+mgbiMIVvWdiVqZSUXzsme0rVO8=; b=Troz2pmps38j9l2G1A+0Y9YCoJNvQr+FVZea/64l0XZCg4gKWzuQjFs9y//+6cbENh crSOgLioQ9yjADn+8/tvueEqfvPWyXaufI03PC/kFPQXpovjqLuBGAjqWuowo5/HJ+Y3 NNz4MPyI8vmiViZ9030M520sc4a6TmAUEzv1UDlYr4cIM+8uvBh/6Zc9sd+i0zcq3kWM 8CKOEvQvbDSD9/IKVcZaKTzH6YF3OgOqxsHhIllKaBhvgXfV8m87uSg7WMKVTGyIcofU oBB9lGJ8t5ni6rS16VM7bsNc5ah6CxsSEL7mmZzXfh6K3cUO1AzWBT1c9r8yuR1GIyLq 6rmg== X-Forwarded-Encrypted: i=1; AJvYcCWTNV5cks0+EcquIrIeM+nhGZqJ2P3F/o1Vdfq7zJuu1KSWe6JZIp2l0+4SbV6nEJX11JBT8ANMQZo=@lists.linux.dev X-Gm-Message-State: AOJu0YyfzY/wUrIAwx0GXWSPultGnrKdfFXLPKEPuoySkeE4gKgGGzae uiQiaCFyZ6X9HyIWYol3Cem3hfa1nTy/nqAKDD8CY7b3wHVVTbdBxC4S X-Gm-Gg: ASbGnctFfpRSz5T/8aL+ivFkm0WoNqtDy4EESNHhgQkOHBWDFqxEtCrcJslEMpo7nO+ dZBLFoDyR77dJPR+N0eSHHhRy95Kc9U0jItFPRjYBMD307QLZkR+SQ8DOIeSIqkbUJ4GpPirYiQ zz0p0a7TnYPQpmCfIujRDJSap1zDs9OgwTYKAX1x4iThpnNhk+w0Fb3wqFV+yPUYMHuC8hadIqS X4eQbUumfUjfQYVJF9Ytt5nuD4wKHtfUN9r5+B76rlWYa7O7Ys4PvekKU2v/pT6RKLblX2drGJJ XjwmWEXyiEEfOWD+F4XC+GglPaW96DWqAwfhSiMOnfyeDPoBbUb4GAT/YOcB7WVII0sbABa6dnt dYOZhP1WP/t0iU8eRokjOjIYs9ZRuO8RF+PectC6TezXkyo8pBw5N0YYSLcSt5j4yL1ete6oGIz AE X-Google-Smtp-Source: AGHT+IHNDWdV6nOLEUPb8BsKdy1fTa79zHhvllKqWIEzW+JrO9Bj5NMu8vYte0D/T+VD4YYNH0vo+A== X-Received: by 2002:a17:907:1c85:b0:b64:6cc7:6ac7 with SMTP id a640c23a62f3a-b6d6bb9083emr1215693866b.22.1761554548711; Mon, 27 Oct 2025 01:42:28 -0700 (PDT) Received: from localhost ([212.73.77.104]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-b6d853696aesm704277666b.30.2025.10.27.01.42.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Oct 2025 01:42:28 -0700 (PDT) From: Askar Safin To: mpatocka@redhat.com Cc: Dell.Client.Kernel@dell.com, brauner@kernel.org, dm-devel@lists.linux.dev, ebiggers@kernel.org, kix@kix.es, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-crypto@vger.kernel.org, linux-lvm@lists.linux.dev, linux-mm@kvack.org, linux-pm@vger.kernel.org, linux-raid@vger.kernel.org, lvm-devel@lists.linux.dev, milan@mazyland.cz, mzxreary@0pointer.de, nphamcs@gmail.com, pavel@ucw.cz, rafael@kernel.org, ryncsn@gmail.com, safinaskar@gmail.com, torvalds@linux-foundation.org Subject: Re: [PATCH] pm-hibernate: flush block device cache when hibernating Date: Mon, 27 Oct 2025 11:42:20 +0300 Message-ID: <20251027084220.2064289-1-safinaskar@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <03e58462-5045-e12f-9af6-be2aaf19f32c@redhat.com> References: <03e58462-5045-e12f-9af6-be2aaf19f32c@redhat.com> Precedence: bulk X-Mailing-List: linux-lvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Mikulas Patocka : > Hi > > Does this patch fix it? > > Mikulas > > > From: Mikulas Patocka > > There was reported failure that hibernation doesn't work with > dm-integrity. The reason for the failure is that the hibernation code > doesn't issue the FLUSH bio - the data still sits in the dm-integrity > cache and they are lost when poweroff happens. I tested this patch in Qemu on current master (43e9ad0c55a3). Also I applied Mario's patch https://lore.kernel.org/linux-pm/20251026033115.436448-1-superm1@kernel.org/ . It is needed, otherwise you get WARNING when you try to hibernate. The patch doesn't work. Here is script I used for reproduction: https://zerobin.net/?66669be7d2404586#xWufhCq7zCoOk3LJcJCj7W4k3vYT3U4vhGutTN3p8m0= . It is the same script as in previous letter. I just added some "integritysetup status /dev/mapper/..." calls. Here are results: https://zerobin.net/?2331637d633d20c5#EmyhxiHLDmoZT1jBVbe/q9iJKhDEw4n+Bwr5mAcaOpM= . File names mean the same as in previous letter, i. e.: > "log-def-1" is output of first Qemu invocation (i. e. first boot) with > default integritysetup options. "log-def-2" is second Qemu invocation > (i. e. when we try to resume). > > log-bit-{1,2} is same thing, but with "--integrity-bitmap-mode" added to > "integritysetup format" and "integritysetup open". > > log-no-{1,2} is same, but with "--integrity-no-journal". > > log-nodm-{1,2} is same, but without dm-integrity at all, i. e. we create > swap directly on partition. Results are somewhat better than without the patch. Without the patch we don't even try to resume in default mode. "blkid" simply reports "swap" instead of "swsuspend". With patch "blkid" reports "swsuspend", and so we try to resume. But then in the middle of resuming we get this: [ 1.008223] PM: Image loading progress: 70% [ 1.017478] PM: Image loading progress: 80% [ 1.027069] PM: Image loading progress: 90% [ 1.029653] PM: hibernation: Read 36196 kbytes in 0.49 seconds (73.86 MB/s) [ 1.030146] PM: Error -1 resuming [ 1.030322] PM: hibernation: Failed to load image, recovering. (See link above for full logs.) Very similar thing happens in "--integrity-no-journal" mode in the middle of resuming: [ 0.531245] device-mapper: integrity: dm-0: Checksum failed at sector 0x6e70 [ 0.531600] PM: Error -84 resuming [ 0.531799] PM: hibernation: Failed to load image, recovering. The patch doesn't change anything in "--integrity-bitmap-mode" mode: we still are able to resume, but then get integrity errors when we do "cat /dev/mapper/swap > /dev/null". -- Askar Safin