Skip to content
Commit 3006137e authored by Xiubo Li's avatar Xiubo Li Committed by Sasha Levin
Browse files

ceph: stop copying to iter at EOF on sync reads



[ Upstream commit 1065da21 ]

If EOF is encountered, ceph_sync_read() return value is adjusted down
according to i_size, but the "to" iter is advanced by the actual number
of bytes read.  Then, when retrying, the remainder of the range may be
skipped incorrectly.

Ensure that the "to" iter is advanced only until EOF.

[ idryomov: changelog ]

Fixes: c3d8e0b5 ("ceph: return the real size read when it hits EOF")
Reported-by: default avatarFrank Hsiao <frankhsiao@qnap.com>
Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Tested-by: default avatarFrank Hsiao <frankhsiao@qnap.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a4cbcc4c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment