]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_io: fix random pread/pwrite to honor offset
authorEric Sandeen <sandeen@sandeen.net>
Mon, 14 Apr 2014 06:13:54 +0000 (16:13 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 14 Apr 2014 06:13:54 +0000 (16:13 +1000)
commit033777858aa2f24750d23ab80b9e5e6e080d0fb5
treeeb0a075c04b7d7aab8deabe872af98118b9b8ddf
parentd0bbcbcb43fd9fadca3986c74ab129f5ee24a704
xfs_io: fix random pread/pwrite to honor offset

xfs_io's pread & pwrite claim to support a random IO mode
where it will do random IOs between offset & offset+len.

However, offset was ignored, and we did the IOs between 0
and len instead.

Clang caught this by pointing out that the calculated/normalized
"offset" variable was never read.

(NB: If the range is larger than RAND_MAX, these functions don't
work, but that's always been true, so I'll leave it for another
day...)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
io/pread.c
io/pwrite.c