lkml.org 
[lkml]   [2023]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: support pmsg record size larger than kmalloc limitation
On Tue, Jun 27, 2023 at 10:05:04AM -0700, Yuxiao Zhang wrote:
> kfree(record->priv);
> kfree(record);
> if (rc != -EEXIST || !quiet)
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index ade66dbe5f39..296465b14fa9 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -20,6 +20,7 @@
> #include <linux/compiler.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> +#include <linux/mm.h>
>
> #include "internal.h"
> #include "ram_internal.h"
> @@ -268,7 +269,7 @@ static ssize_t ramoops_pstore_read(struct
> pstore_record *record)
> /* ECC correction notice */
> record->ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);
>
> - record->buf = kmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL);
> + record->buf = kvmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL);
> if (record->buf == NULL) {
> size = -ENOMEM;
> goto out;

Please try emailing a patch to yourself and see if you can apply it
afterwards. The kernel documentation has a section for how to handle
email clients, perhaps you should read it?

thanks,

greg k-h

\
 
 \ /
  Last update: 2023-06-27 19:36    [W:0.127 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site