Skip to content

Commit 9c56542

Browse files
author
Mikulas Patocka
committed
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]
1 parent 2de510f commit 9c56542

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/md/dm-ebs-target.c

+7
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)