| From 964bb0c61e463043925252be1976905eb9cbaae3 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Fri, 14 Nov 2025 15:30:33 +0100 |
| Subject: ps3disk: use memcpy_{from,to}_bvec index |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| From: Rene Rebe <rene@exactco.de> |
| |
| [ Upstream commit 79bd8c9814a273fa7ba43399e1c07adec3fc95db ] |
| |
| 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> |
| Reviewed-by: Christoph Hellwig <hch@lst.de> |
| Signed-off-by: Jens Axboe <axboe@kernel.dk> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/block/ps3disk.c | 4 ++++ |
| 1 file changed, 4 insertions(+) |
| |
| diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c |
| index 8d51efbe045dd..8628ee818da96 100644 |
| --- a/drivers/block/ps3disk.c |
| +++ b/drivers/block/ps3disk.c |
| @@ -85,10 +85,14 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, |
| 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; |
| } |
| } |
| |
| -- |
| 2.51.0 |
| |