]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix type promotion bug on 32bit systems
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 7 Oct 2023 08:52:39 +0000 (11:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:08:57 +0000 (23:08 +0200)
commit4d6c1845cba2a008f7ca3d5105f2025461547b71
tree8884176126cede9975a5f20201e6c1c1842b8ff4
parent9f43481c0d85c96ad2dc33aecf66fa9253a06706
ceph: fix type promotion bug on 32bit systems

commit 07bb00ef00ace88dd6f695fadbba76565756e55c upstream.

In this code "ret" is type long and "src_objlen" is unsigned int.  The
problem is that on 32bit systems, when we do the comparison signed longs
are type promoted to unsigned int.  So negative error codes from
do_splice_direct() are treated as success instead of failure.

Cc: stable@vger.kernel.org
Fixes: 1b0c3b9f91f0 ("ceph: re-org copy_file_range and fix some error paths")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/file.c