Re: [PATCH] jffs2: Reduce the severity level of logging errors

From: Richard Weinberger
Date: Mon Nov 18 2019 - 03:37:38 EST


On Sun, Nov 17, 2019 at 6:44 PM Aditya Pakki <pakki001@xxxxxxx> wrote:
>
> Unlike other instances of critical errors that call BUG(), kmalloc
> failure in jffs2_wbuf_recover does not require pr_crit. Replace this
> error logging with pr_warn().

Well, JFFS2 warns that data will get lost. IMHO this deserves pr_crit().
Unless you have a strong reason to change this I'd leave it as is.

> Signed-off-by: Aditya Pakki <pakki001@xxxxxxx>
> ---
> fs/jffs2/wbuf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
> index c6821a509481..59e145220b51 100644
> --- a/fs/jffs2/wbuf.c
> +++ b/fs/jffs2/wbuf.c
> @@ -339,7 +339,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
>
> buf = kmalloc(end - start, GFP_KERNEL);
> if (!buf) {
> - pr_crit("Malloc failure in wbuf recovery. Data loss ensues.\n");
> + pr_warn("Malloc failure in wbuf recovery. Data loss ensues.\n");
>
> goto read_failed;
> }
> @@ -354,7 +354,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
> ret = 0;
>
> if (ret || retlen != c->wbuf_ofs - start) {
> - pr_crit("Old data are already lost in wbuf recovery. Data loss ensues.\n");
> + pr_warn("Old data are already lost in wbuf recovery. Data loss ensues.\n");
>
> kfree(buf);
> buf = NULL;
> --
> 2.17.1
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/



--
Thanks,
//richard