[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] xen-blkfront: fix double completion of split requests on resume
- To: Doruk Tan Ozturk <doruk@xxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 9 Jul 2026 12:27:14 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XYmO5w03PfYnidaz0vUbo/qTsL63MCnQT79W8R9KlPU=; b=Wu34pl2pkLayXOWbu/haaSZc0bFUDNzzTzdVyA6XFodIMsi10wgvpzYTtYDqFoD167QDPKT2WMxQ3W5zan5+papOC0zFWrM9apj8byrY7FTXj6qejmqxDv2+2c+Z6yrGrBe8msywqy4f1suYO+xG4MjZO9kgd8KXR/CBwoDvbbGN8n36W1NLhAYhxrqt5DxoNpODbhJMm+P78EdBJCyVAqzi5mf07ossArG/7mmrs/iKnuIt3zvfCR+x+XkO6FSpVJudDvZSHRrptwCmBGPWJFdpY5qYT8SEzuWS1LBHkJPLTj5axrS65IJKSmT1AHVR5tE6kgrnnEDqjwhpARyT7Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SJbyOTEHap5J9dhCdB0lp3HGJCHxPjbw0qDpSnTFUveZAIm1ENVXWxScUeaZsZnyZ8vcFljbh2RfgifHDKXd8fBkxoEB+H555hBLB701nMi/5hPt8mwM9MKeXQW7GEJsINqC/PX/fAuZBwTvZ6Q0lDfskK+9/11BluKvmEH7c4jZYk1Rg7S2vFophDsZIqw/WiCZmKAmIdnHEHe5exvY5SUSTJ4tb1Xhd285TvFRpzE45w7arziJj5CN7sUqfAnc2EmtKF+A8kA1WWpQV0Q9wcKO/m+2q23iLu+kW4wtrrrAD8nwVL4goNLPR7DJvZ1TM8p4kcaVzEli3tJtMrkBhQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- Delivery-date: Thu, 09 Jul 2026 10:27:31 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Jul 09, 2026 at 12:08:53PM +0200, Doruk Tan Ozturk wrote:
> 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 != NO_ASSOCIATED_ID) that carries no
> scatter-gather list (num_sg == 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
> pages")
> Assisted-by: 0sec:claude-opus-4-8
> Signed-off-by: Doruk Tan Ozturk <doruk@xxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Thanks, Roger.
|