]> git.itanic.dy.fi Git - linux-stable/commit
ceph: stop copying to iter at EOF on sync reads
authorXiubo Li <xiubli@redhat.com>
Wed, 21 Feb 2024 01:16:12 +0000 (09:16 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 19 Mar 2024 13:35:55 +0000 (14:35 +0100)
commit1065da21e5df9d843d2c5165d5d576be000142a6
tree6891fa7179b89666368157e45e9d3a9ea2385852
parenta8922f79671f0e81c6e4fe8d2fc6cae0cd32cd7a
ceph: stop copying to iter at EOF on sync reads

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: c3d8e0b5de48 ("ceph: return the real size read when it hits EOF")
Reported-by: Frank Hsiao <frankhsiao@qnap.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Tested-by: Frank Hsiao <frankhsiao@qnap.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/file.c