[Devel] [PATCH hci-8.2 3/3] dm/push_backup: remove the push_backup_read and push_backup_write messages

Vasileios Almpanis vasileios.almpanis at virtuozzo.com
Wed Nov 25 14:29:53 MSK 2026


The current ploop-backup gets the ranges to back up and reports the
backed up ranges through the event fd, see commit d723a1617e61
("dm/push_backup: add event file descriptor interface"). It does not
send the push_backup_read and push_backup_write messages anymore.

push_backup_read is also the message that sleeps inside
target_message() with md->io_barrier SRCU read locked, which is the
reason the fd interface was added. Remove both messages, so that this
path cannot be used again.

push_backup_write() stays, because pb_fd_write() uses it. Also drop the
reference to the removed message from the comment of the fd write() in
the uapi header.

https://virtuozzo.atlassian.net/browse/VSTOR-155816

Feature: dm-backup: push backup target driver
Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
---
 drivers/md/dm-push-backup.c         | 26 --------------------------
 include/uapi/linux/dm-push-backup.h |  5 ++---
 2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
index 433c61b63802..e01e6c464089 100644
--- a/drivers/md/dm-push-backup.c
+++ b/drivers/md/dm-push-backup.c
@@ -550,24 +550,6 @@ static int pb_wait_range(struct push_backup *pb, u64 *clu, u64 *nr)
 	}
 }
 
-static int push_backup_read(struct push_backup *pb,
-			    char *result, unsigned int maxlen)
-{
-	unsigned int sz = 0;
-	u64 clu, nr;
-	int ret;
-
-	if (!pb)
-		return -EBADF;
-
-	ret = pb_wait_range(pb, &clu, &nr);
-	if (ret == -ERESTARTSYS)
-		ret = -EINTR;
-	if (ret == 1)
-		DMEMIT("%llu:%llu", clu, nr);
-	return ret;
-}
-
 static int push_backup_write(struct push_backup *pb, u64 clu, u64 nr)
 {
 	u64 i, key, nr_clus = pb->nr_clus;
@@ -790,14 +772,6 @@ static int pb_message(struct dm_target *ti, unsigned int argc, char **argv,
 			pb_watch_pid(pb);
 	} else if (!strcmp(argv[0], "push_backup_stop")) {
 		ret = push_backup_stop(pb, result, maxlen);
-	} else if (!strcmp(argv[0], "push_backup_read")) {
-		if (argc != 1)
-			goto unlock;
-		ret = push_backup_read(pb, result, maxlen);
-	} else if (!strcmp(argv[0], "push_backup_write")) {
-		if (argc != 2 || sscanf(argv[1], "%llu:%llu", &val, &val2) != 2)
-			goto unlock;
-		ret = push_backup_write(pb, val, val2);
 	} else if (!strcmp(argv[0], "push_backup_statistics")) {
 		ret = push_backup_statistics(pb, result, maxlen);
 	} else if (!strcmp(argv[0], "push_backup_get_fd")) {
diff --git a/include/uapi/linux/dm-push-backup.h b/include/uapi/linux/dm-push-backup.h
index b43e2e55dc69..b8d336f9fcc2 100644
--- a/include/uapi/linux/dm-push-backup.h
+++ b/include/uapi/linux/dm-push-backup.h
@@ -30,9 +30,8 @@
  *   EBADMSG       - internal inconsistency of the pending state.
  *
  * write(fd, &range, sizeof(range)):
- *   acknowledge that @range has been backed up; equivalent to the
- *   "push_backup_write clu:nr" message. Fails with E2BIG if @range is out
- *   of the device, ESTALE and ENODEV as read(), and EFAULT.
+ *   acknowledge that @range has been backed up. Fails with E2BIG if @range
+ *   is out of the device, ESTALE and ENODEV as read(), and EFAULT.
  */
 #ifndef _UAPI_LINUX_DM_PUSH_BACKUP_H
 #define _UAPI_LINUX_DM_PUSH_BACKUP_H

-- 
2.43.0



More information about the Devel mailing list