Skip to content

Commit f151ba9

Browse files
Boris Ostrovskyaxboe
authored andcommitted
xen/blkfront: When purging persistent grants, keep them in the buffer
Commit a46b536 ("xen/blkfront: cleanup stale persistent grants") added support for purging persistent grants when they are not in use. As part of the purge, the grants were removed from the grant buffer, This eventually causes the buffer to become empty, with BUG_ON triggered in get_free_grant(). This can be observed even on an idle system, within 20-30 minutes. We should keep the grants in the buffer when purging, and only free the grant ref. Fixes: a46b536 ("xen/blkfront: cleanup stale persistent grants") Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 854f31c commit f151ba9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/block/xen-blkfront.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,11 +2667,9 @@ static void purge_persistent_grants(struct blkfront_info *info)
26672667
gnttab_query_foreign_access(gnt_list_entry->gref))
26682668
continue;
26692669

2670-
list_del(&gnt_list_entry->node);
26712670
gnttab_end_foreign_access(gnt_list_entry->gref, 0, 0UL);
2671+
gnt_list_entry->gref = GRANT_INVALID_REF;
26722672
rinfo->persistent_gnts_c--;
2673-
__free_page(gnt_list_entry->page);
2674-
kfree(gnt_list_entry);
26752673
}
26762674

26772675
spin_unlock_irqrestore(&rinfo->ring_lock, flags);

0 commit comments

Comments
 (0)