diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index a89f41f00757cb0cb420e251fd273bba07fc262b..3a2e6a2f8bdd336f863807108c9ca3ebbfbba917 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -364,6 +364,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
 		return -EIO;
 	}
 
+retry:
 	io.error_bits = 0;
 	io.eopnotsupp_bits = 0;
 	atomic_set(&io.count, 1); /* see dispatch_io() */
@@ -382,6 +383,11 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
 	}
 	set_current_state(TASK_RUNNING);
 
+	if (io.eopnotsupp_bits && (rw & (1 << BIO_RW_BARRIER))) {
+		rw &= ~(1 << BIO_RW_BARRIER);
+		goto retry;
+	}
+
 	if (error_bits)
 		*error_bits = io.error_bits;