[Devel] [PATCH rh7] ploop: push_backup: fix ploop_push_backup_io_read()

Maxim Patlasov mpatlasov at virtuozzo.com
Wed May 11 18:26:56 PDT 2016


ploop_push_backup_io_read() services ioctl(PLOOP_IOC_PUSH_BACKUP_IO)
for direction = PLOOP_READ.

If at least one extent is successfully filled, the -ENOENT error from
ploop_pb_get_pending() must be interpreted as "OK, no more data present".

https://jira.sw.ru/browse/PSBM-45000

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 drivers/block/ploop/dev.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 1e511d7..c103b79 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4585,7 +4585,9 @@ static int ploop_push_backup_io_read(struct ploop_device *plo, unsigned long arg
 	while (n_extents < ctl->n_extents) {
 		cluster_t clu, len;
 		rc = ploop_pb_get_pending(plo->pbd, &clu, &len, n_extents);
-		if (rc)
+		if (rc == -ENOENT && n_extents)
+			break;
+		else if (rc)
 			goto io_read_done;
 
 		e[n_extents].clu = clu;



More information about the Devel mailing list