linux-stable/fs/ceph
Xiubo Li 834c93dcef ceph: stop copying to iter at EOF on sync reads
[ Upstream commit 1065da21e5 ]

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: c3d8e0b5de ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:36 -04:00
..
Kconfig ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION 2024-01-15 15:40:50 +01:00
Makefile ceph: fscrypt_auth handling for ceph 2023-08-22 09:01:48 +02:00
acl.c ceph: allow idmapped set_acl inode op 2023-11-03 23:28:34 +01:00
addr.c Assorted CephFS fixes and cleanups with nothing standing out. 2024-01-19 09:58:55 -08:00
cache.c ceph: rename _to_client() to _to_fs_client() 2023-11-03 23:28:33 +01:00
cache.h netfs: Provide invalidate_folio and release_folio calls 2023-12-24 15:08:51 +00:00
caps.c ceph: add ceph_cap_unlink_work to fire check_caps() immediately 2024-02-13 11:22:54 +01:00
ceph_frag.c
crypto.c Two items: 2023-11-10 09:52:56 -08:00
crypto.h ceph: add support for encrypted snapshot names 2023-08-24 11:24:36 +02:00
debugfs.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
dir.c Assorted CephFS fixes and cleanups with nothing standing out. 2024-01-19 09:58:55 -08:00
export.c ceph: d_obtain_{alias,root}(ERR_PTR(...)) will do the right thing 2024-01-15 15:40:51 +01:00
file.c ceph: stop copying to iter at EOF on sync reads 2024-03-26 18:17:36 -04:00
inode.c ceph: always set initial i_blkbits to CEPH_FSCRYPT_BLOCK_SHIFT 2024-02-07 14:43:29 +01:00
io.c ceph: fix kerneldoc copypasta over ceph_start_io_direct 2021-04-27 23:52:23 +02:00
io.h
ioctl.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
ioctl.h
locks.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
mds_client.c ceph: add ceph_cap_unlink_work to fire check_caps() immediately 2024-02-13 11:22:54 +01:00
mds_client.h ceph: add ceph_cap_unlink_work to fire check_caps() immediately 2024-02-13 11:22:54 +01:00
mdsmap.c ceph: switch to corrected encoding of max_xattr_size in mdsmap 2024-02-26 19:20:30 +01:00
mdsmap.h ceph: switch to corrected encoding of max_xattr_size in mdsmap 2024-02-26 19:20:30 +01:00
metric.c ceph: print cluster fsid and client global_id in all debug logs 2023-11-03 23:28:33 +01:00
metric.h ceph: include average/stdev r/w/m latency in mds metrics 2022-03-21 13:35:16 +01:00
quota.c ceph: fix invalid pointer access if get_quota_realm return ERR_PTR 2024-01-15 15:40:51 +01:00
snap.c Two items: 2023-11-10 09:52:56 -08:00
strings.c ceph: add getvxattr op 2022-03-01 18:26:37 +01:00
super.c ceph: allow idmapped mounts 2023-11-03 23:28:34 +01:00
super.h ceph: always check dir caps asynchronously 2024-02-07 14:58:02 +01:00
util.c ceph: move net/ceph/ceph_fs.c to fs/ceph/util.c 2020-01-27 16:53:40 +01:00
xattr.c Two items: 2023-11-10 09:52:56 -08:00