Re: [PATCH] ceph: zero the dir_entries memory when allocating it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 17, 2022 at 1:45 PM <xiubli@xxxxxxxxxx> wrote:
>
> From: Xiubo Li <xiubli@xxxxxxxxxx>
>
> This potentially will cause bug in future if using the old ceph
> version and some members may skipped initialized in handle_reply.
>
> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
> ---
>  fs/ceph/mds_client.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 93e5e3c4ba64..c3b1e73c5fbf 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -2286,7 +2286,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;
> --
> 2.27.0
>

Looks good.

Acked-by: Venky Shankar <vshankar@xxxxxxxxxx>

-- 
Cheers,
Venky




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux