Skip to content

Commit e485d02

Browse files
jtlaytonidryomov
authored andcommitted
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: c3d8e0b ("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>
1 parent 973e524 commit e485d02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ceph/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to,
847847
ssize_t ret;
848848
u64 off = iocb->ki_pos;
849849
u64 len = iov_iter_count(to);
850-
u64 i_size;
850+
u64 i_size = i_size_read(inode);
851851

852852
dout("sync_read on file %p %llu~%u %s\n", file, off, (unsigned)len,
853853
(file->f_flags & O_DIRECT) ? "O_DIRECT" : "");

0 commit comments

Comments
 (0)