aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-11-23 07:30:38 -0500
committerIlya Dryomov <idryomov@gmail.com>2021-12-01 17:08:26 +0100
commite485d028bb1075d6167558b47f63e10713ad2034 (patch)
tree3bfbdc354c549b6ccdb60eab49ce3092481a063e /fs/ceph
parentceph: fix duplicate increment of opened_inodes metric (diff)
downloadlinux-dev-e485d028bb1075d6167558b47f63e10713ad2034.tar.xz
linux-dev-e485d028bb1075d6167558b47f63e10713ad2034.zip
ceph: initialize i_size variable in ceph_sync_read
Newer compilers seem to determine that this variable being uninitialized isn't a problem, but older compilers (from the RHEL8 era) seem to choke on it and complain that it could be used uninitialized. Go ahead and initialize the variable at declaration time to silence potential compiler warnings. Fixes: c3d8e0b5de48 ("ceph: return the real size read when it hits EOF") Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 02a0a0fd9ccd..b24442e27e4e 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -847,7 +847,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to,
ssize_t ret;
u64 off = iocb->ki_pos;
u64 len = iov_iter_count(to);
- u64 i_size;
+ u64 i_size = i_size_read(inode);
dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned)len,
(file->f_flags & O_DIRECT) ? "O_DIRECT" : "");