The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RESEND PATCH] Fix ps3disk: use memcpy_{from,to}_bvec index
@ 2025-11-14 14:30 Rene Rebe
  2025-11-14 15:25 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Rene Rebe @ 2025-11-14 14:30 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Martin K. Petersen, Geoff Levand, linux-kernel,
	Greg Kroah-Hartman

With 6e0a48552b8c (ps3disk: use memcpy_{from,to}_bvec) converting
ps3disk to new bvec helpers, incrementing the offset was accidently
lost, corrupting consecutive buffers. Restore index for non-corrupted
data transfers.

Fixes: 6e0a48552b8c (ps3disk: use memcpy_{from,to}_bvec)

Signed-off-by: René Rebe <rene@exactco.de>

--- a/drivers/block/ps3disk.c	2023-08-07 17:40:55.200957746 +0200
+++ b/drivers/block/ps3disk.c	2023-08-07 17:46:39.702964129 +0200
@@ -85,10 +93,14 @@
 	struct bio_vec bvec;
 
 	rq_for_each_segment(bvec, req, iter) {
+		dev_dbg(&dev->sbd.core, "%s:%u: %u sectors from %llu\n",
+			__func__, __LINE__, bio_sectors(iter.bio),
+			iter.bio->bi_iter.bi_sector);
 		if (gather)
 			memcpy_from_bvec(dev->bounce_buf + offset, &bvec);
 		else
 			memcpy_to_bvec(&bvec, dev->bounce_buf + offset);
+		offset += bvec.bv_len;
 	}
 }
 

-- 
  René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
  https://exactcode.com | https://t2linux.com | https://rene.rebe.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-11-18  7:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 14:30 [RESEND PATCH] Fix ps3disk: use memcpy_{from,to}_bvec index Rene Rebe
2025-11-14 15:25 ` Christoph Hellwig
2025-11-14 16:11 ` Jens Axboe
2025-11-16 12:13 ` Greg Kroah-Hartman
2025-11-17  9:47   ` Geert Uytterhoeven
2025-11-17 10:16     ` René Rebe
2025-11-17 12:39     ` Greg Kroah-Hartman
2025-11-17 13:05       ` Geert Uytterhoeven
2025-11-17 13:13         ` Greg Kroah-Hartman
2025-11-17 13:31           ` Geert Uytterhoeven
2025-11-18  2:36             ` Greg Kroah-Hartman
2025-11-18  7:46               ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox