diff options
author | Xiubo Li <xiubli@redhat.com> | 2022-02-17 11:15:42 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-03-01 20:26:37 +0300 |
commit | 2941bf53f59c5fb4def7e5883cb452ae7b2ee304 (patch) | |
tree | 288070c1d928498d71651ca3046d3e104f12ac84 /fs/ceph/mds_client.c | |
parent | ab58a5a1c0487b67f7409f39d3c8593d416d4e7f (diff) | |
download | linux-2941bf53f59c5fb4def7e5883cb452ae7b2ee304.tar.xz |
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 <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 0b7bde73bf03..ef9145477aae 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; |