From: Xiubo Li Date: Thu, 17 Feb 2022 08:15:42 +0000 (+0800) Subject: ceph: zero the dir_entries memory when allocating it X-Git-Tag: v6.6.17~7835^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2941bf53f59c5fb4def7e5883cb452ae7b2ee304;p=platform%2Fkernel%2Flinux-rpi.git ceph: zero the dir_entries memory when allocating it This potentially will cause a bug in future if using an old ceph version that sends a smaller inode struct, which can cause some members to be skipped in handle_reply. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 0b7bde7..ef91454 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2202,7 +2202,8 @@ int ceph_alloc_readdir_reply_buffer(struct ceph_mds_request *req, order = get_order(size * num_entries); while (order >= 0) { rinfo->dir_entries = (void*)__get_free_pages(GFP_KERNEL | - __GFP_NOWARN, + __GFP_NOWARN | + __GFP_ZERO, order); if (rinfo->dir_entries) break;