Skip to content

Commit 7db6e66

Browse files
sbashiroTrond Myklebust
authored andcommitted
pNFS: Fix disk addr range check in block/scsi layout
At the end of the isect translation, disc_addr represents the physical disk offset. Thus, end calculated from disk_addr is also a physical disk offset. Therefore, range checking should be done using map->disk_offset, not map->start. Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250702133226.212537-1-sergeybashirov@gmail.com Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 8143849 commit 7db6e66

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/nfs/blocklayout/blocklayout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ do_add_page_to_bio(struct bio *bio, int npg, enum req_op op, sector_t isect,
149149

150150
/* limit length to what the device mapping allows */
151151
end = disk_addr + *len;
152-
if (end >= map->start + map->len)
153-
*len = map->start + map->len - disk_addr;
152+
if (end >= map->disk_offset + map->len)
153+
*len = map->disk_offset + map->len - disk_addr;
154154

155155
retry:
156156
if (!bio) {

0 commit comments

Comments
 (0)