diff mbox series

jffs2: Reduce the severity level of logging errors

Message ID 20191117174413.2876-1-pakki001@umn.edu
State New, archived
Headers show
Series jffs2: Reduce the severity level of logging errors | expand

Commit Message

Aditya Pakki Nov. 17, 2019, 5:44 p.m. UTC
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().

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 fs/jffs2/wbuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Weinberger Nov. 18, 2019, 8:37 a.m. UTC | #1
On Sun, Nov 17, 2019 at 6:44 PM Aditya Pakki <pakki001@umn.edu> 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@umn.edu>
> ---
>  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/
diff mbox series

Patch

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;