From nobody Thu Jul 23 21:53:27 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 37BAB3BE17E for ; Thu, 9 Jul 2026 10:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591739; cv=none; b=j9WQAtKvtpW6iOw+MTZXvXrJSFtWrtx5pUCfHACC5Hqi+wQLi4qeRr8ypWrfPhg2oZxCyyvqk8zshABQrd1imktzwe5R6pwYWokmBbmv5dEx8yB2KqQ8KCLv2jzKoEYWeKCQ6LNv+knthVTMvH1yGR8D2d5a9Ky1+7LRLlZ4F+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783591739; c=relaxed/simple; bh=7Qq5DbnLoYr/W1fIrmxtolNL3bgS+VtLSb8S0g3pu9c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aMvLr0c4zLTdkB3cZBXotfceX0sywrvVcm+TAAbUSe1wiQ1xxbNn5fh19I5NWbrAK9qYRbXjl+nyO2NoNCXpz+b+L6stpS98pLv3zhrd2q+gJTDU+7HNRbp1mulJfQ9O/PXiuoVkQJVmEJuExDrLRCvczA5VjFvyF2rnjOqrTF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0sec.ai; spf=pass smtp.mailfrom=0sec.ai; dkim=temperror (0-bit key) header.d=0sec.ai header.i=@0sec.ai header.b=0G2XNAv8; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0sec.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0sec.ai Authentication-Results: smtp.subspace.kernel.org; dkim=temperror (0-bit key) header.d=0sec.ai header.i=@0sec.ai header.b="0G2XNAv8" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-47defd0c1c5so864297f8f.3 for ; Thu, 09 Jul 2026 03:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0sec.ai; s=google; t=1783591737; x=1784196537; darn=vger.kernel.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=R38Rncr/E+UsAEWrPcumXybq6cXHOZxrmRPFJ81xA0g=; b=0G2XNAv8YUWZjRYWVQUAhDhyFhdWVA10nbf2zXbuBkTKPj72xwdpjWVGQLmK4EkL24 VmfypAEL3SR1/9j+UxLY0JAz5BhngsVbi2PAYe/foVaR5p9klYf8xp8wRf9lPS8Vfwqv ISjw1azVXbfVVPfVcYKgA/c0vzu/oirAMLFZA9ABvyu3EgTOCRX8+TFbmEYxCuh68g6v 7DeglNtnYOt/eNzCYJfq7oC8Npxf2qcbQRBz23dOCif1GH2D7lrTT0nQBHm6O8n3eUM8 +3oMTpIG6IGcfSFpL1Q/CZcZuDzxgqt99DTRGrKdD5oONjPNZugqoXNoby8Mlu4QqE5w 2aaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783591737; x=1784196537; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=R38Rncr/E+UsAEWrPcumXybq6cXHOZxrmRPFJ81xA0g=; b=FUFWOMuS1Z5FM6QYa7AKX2RrBMY2O7i+f+5+XYgPcLgEBf0wU/58gTy/C8jvO/G9pq cZUOz5OJALuxa/Cjdq5FyVd0H2gI/GwjzdKzfhOnZjLdXILcus5eO7bi/c9/mO2JZopW AdusBiOtWMCy+antGRxmxzUspywkNXzmxrtQNaqIP8RgW2h4VbC2VvGly1PaCpqRVCrq zCIY/dexZzxhtaEsI9kNXbhDczoqctaPT5lQp/FuyFuFsTABbcZWZSe7lAL1rsqdR8DD yWQ76PbM0rqJbbQ7eeT4MJ+ypvZ4nPc1WlkzEmyQXx/AWFYDw4+U4FpXozurDLB+eRlE RLEA== X-Forwarded-Encrypted: i=1; AHgh+RqimsO9TmRq5VpgjY0y1hCFGfOmUo8lN2tJmOyYQheqkFjQwSWEe5PFHqovYU6DilaE59k637ZF4MeTQLc=@vger.kernel.org X-Gm-Message-State: AOJu0YzxmjGqfR0HftkmDdIuImWApevrxphWWVC2Drf3GFgS8ypokZCC ABNfdh+U0liQGDSBrOcmaykJ4HtjSOcXVy71Utw0kNKijMNfjm+QaTjWQ5T8Q1HmXgzF X-Gm-Gg: AfdE7cm0HSPreU9Qdos5XRrok9LjDTj7bHCjU3yIsd6eCPCoLushYiJbSq2OgK1YACw mNV97BWbz/dZMHzvVhiQeHqgnZ9tST2mGb9dTR2FFLhI/zDSkxPOcA16Xb/LoPOOieq/yKKWm6W C6cuFsLw+gmVGXYMFrdEIF5L5NKHL64nNnPnGzv7wWzNQfO6AClj8/jdZmyPwyJkQ4ONjgvakbH AmpplPHawFAFleWmmaoaJIhh9vg1QcmPcCynCqhtg3hr9NXTl/DbLO+6bJ70Y1dMuih/TVI9Mrp nLpzfxLgD6vYZ5GBpgEGrWkdqIffL93fnpki0vxCNB+2CIQ50tjS1lUgwnhnjjqA9cCCltNdGkx OvNRYdLdNm7wd4ytUnlbAY7LehMD3segHPtYLDJahZjlyOFOBeX+KGG6z5WXrG1E7DXCL5kQ4DS UYbXzMxQPnrYWvl2ItOX7EckyyY/n+S7vk0ACJL3Ez1ZKlW733WvdBe6rl4p8bhyFSJsbiTywCi kABxG2sO0due6vMgXwEAEduRUvrsbOEiaQ= X-Received: by 2002:a5d:59c5:0:b0:475:f0f0:9ec8 with SMTP id ffacd0b85a97d-47df0813a82mr7441246f8f.51.1783591736321; Thu, 09 Jul 2026 03:08:56 -0700 (PDT) Received: from PeakBook-Mini.tail8e484.ts.net ([178.197.218.188]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa09608d4sm51513868f8f.25.2026.07.09.03.08.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 09 Jul 2026 03:08:55 -0700 (PDT) From: Doruk Tan Ozturk To: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Juergen Gross Cc: Stefano Stabellini , Oleksandr Tyshchenko , Jens Axboe , xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Doruk Tan Ozturk Subject: [PATCH v2] xen-blkfront: fix double completion of split requests on resume Date: Thu, 9 Jul 2026 12:08:53 +0200 Message-ID: <20260709100853.7489-1-doruk@0sec.ai> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a block request is too large for a single ring entry and the backend does not support indirect descriptors, blkfront splits it across two ring requests. This only happens when the frontend runs on a 64K-page kernel (e.g. arm64): there, even a single-page request may not fit in one ring slot and must be split. blkif_ring_get_request() is called twice and both shadow slots (shadow[id] and shadow[extra_id]) point at the *same* struct request, linked through associated_id. blkif_completion() collapses the pair on the normal completion path, recycling the second slot and completing the request once. The suspend/resume walk in blkfront_resume() does not: it visits every shadow slot with ->request set and calls blk_mq_end_request() or re-queues ->request. For an in-flight split request it therefore processes the shared struct request twice on resume/migration -- a double completion. Skip the secondary slot of a split request in the resume walk so each logical request is processed exactly once. The secondary slot is the linked one (associated_id !=3D NO_ASSOCIATED_ID) that carries no scatter-gather list (num_sg =3D=3D 0); the first slot always keeps the sg list. The bug is only reachable on suspend/resume or live migration of such a guest, so it has no local reproducer. Fixes: 6cc568339047 ("xen/blkfront: Handle non-indirect grant with 64KB pag= es") Assisted-by: 0sec:claude-opus-4-8 Signed-off-by: Doruk Tan Ozturk Acked-by: Roger Pau Monn=C3=A9 --- drivers/block/xen-blkfront.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index f765970578f9..8dad7bf5f664 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2079,6 +2079,15 @@ static int blkfront_resume(struct xenbus_device *dev) if (!shadow[j].request) continue; =20 + /* + * For requests split across multiple slots, process the + * underlying request only once: skip the linked, sg-less + * secondary slot. + */ + if (shadow[j].associated_id !=3D NO_ASSOCIATED_ID && + shadow[j].num_sg =3D=3D 0) + continue; + /* * Get the bios in the request so we can re-queue them. */ --=20 2.43.0