Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 58bf21b

Browse files
committedMay 20, 2025
dm-ebs: fix prefetch-vs-suspend race
JIRA: https://issues.redhat.com/browse/RHEL-92762 Upstream Status: kernel/git/torvalds/linux.git commit 9c56542 Author: Mikulas Patocka <[email protected]> Date: Fri Mar 28 16:19:07 2025 +0100 dm-ebs: fix prefetch-vs-suspend race There's a possible race condition in dm-ebs - dm bufio prefetch may be in progress while the device is suspended. Fix this by calling dm_bufio_client_reset in the postsuspend hook. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Signed-off-by: Benjamin Marzinski <[email protected]>
1 parent cb66069 commit 58bf21b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎drivers/md/dm-ebs-target.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ static int ebs_map(struct dm_target *ti, struct bio *bio)
390390
return DM_MAPIO_REMAPPED;
391391
}
392392

393+
static void ebs_postsuspend(struct dm_target *ti)
394+
{
395+
struct ebs_c *ec = ti->private;
396+
dm_bufio_client_reset(ec->bufio);
397+
}
398+
393399
static void ebs_status(struct dm_target *ti, status_type_t type,
394400
unsigned int status_flags, char *result, unsigned int maxlen)
395401
{
@@ -447,6 +453,7 @@ static struct target_type ebs_target = {
447453
.ctr = ebs_ctr,
448454
.dtr = ebs_dtr,
449455
.map = ebs_map,
456+
.postsuspend = ebs_postsuspend,
450457
.status = ebs_status,
451458
.io_hints = ebs_io_hints,
452459
.prepare_ioctl = ebs_prepare_ioctl,

0 commit comments

Comments
 (0)
Please sign in to comment.