diff mbox series

staging: exfat: convert WARN to a pr_info

Message ID 20191113025035.186051-1-valdis.kletnieks@vt.edu (mailing list archive)
State New, archived
Headers show
Series staging: exfat: convert WARN to a pr_info | expand

Commit Message

Valdis Klētnieks Nov. 13, 2019, 2:50 a.m. UTC
syzbot took a nosedive because it runs with panic_on_warn set. And
it's quite correct, it shouldn't have been a WARN in the first place.
Other locations just use a pr_info(), so do that here too.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Reported-by: syzbot+787bcbef9b5fec61944b@syzkaller.appspotmail.com
Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging")
---
 drivers/staging/exfat/exfat_blkdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Greg Kroah-Hartman Nov. 13, 2019, 5:47 a.m. UTC | #1
On Tue, Nov 12, 2019 at 09:50:34PM -0500, Valdis Kletnieks wrote:
> syzbot took a nosedive because it runs with panic_on_warn set. And
> it's quite correct, it shouldn't have been a WARN in the first place.
> Other locations just use a pr_info(), so do that here too.
> 
> Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> Reported-by: syzbot+787bcbef9b5fec61944b@syzkaller.appspotmail.com
> Fixes: c48c9f7ff32b ("staging: exfat: add exfat filesystem code to staging")
> ---
>  drivers/staging/exfat/exfat_blkdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/exfat/exfat_blkdev.c b/drivers/staging/exfat/exfat_blkdev.c
> index 7bcd98b13109..8204720b2bf2 100644
> --- a/drivers/staging/exfat/exfat_blkdev.c
> +++ b/drivers/staging/exfat/exfat_blkdev.c
> @@ -59,8 +59,8 @@ int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head *
>  	if (*bh)
>  		return 0;
>  
> -	WARN(!p_fs->dev_ejected,
> -	     "[EXFAT] No bh, device seems wrong or to be ejected.\n");
> +	if (p_fs->dev_ejected)
> +		pr_info("[EXFAT] No bh, device seems wrong or to be ejected.\n");
>  
>  	return -EIO;
>  }
> @@ -112,8 +112,8 @@ int exfat_bdev_write(struct super_block *sb, sector_t secno, struct buffer_head
>  	return 0;
>  
>  no_bh:
> -	WARN(!p_fs->dev_ejected,
> -	     "[EXFAT] No bh, device seems wrong or to be ejected.\n");
> +	if (p_fs->dev_ejected)
> +		pr_info("[EXFAT] No bh, device seems wrong or to be ejected.\n");

Shouldn't these all be pr_err() calls as something did go wrong.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/staging/exfat/exfat_blkdev.c b/drivers/staging/exfat/exfat_blkdev.c
index 7bcd98b13109..8204720b2bf2 100644
--- a/drivers/staging/exfat/exfat_blkdev.c
+++ b/drivers/staging/exfat/exfat_blkdev.c
@@ -59,8 +59,8 @@  int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head *
 	if (*bh)
 		return 0;
 
-	WARN(!p_fs->dev_ejected,
-	     "[EXFAT] No bh, device seems wrong or to be ejected.\n");
+	if (p_fs->dev_ejected)
+		pr_info("[EXFAT] No bh, device seems wrong or to be ejected.\n");
 
 	return -EIO;
 }
@@ -112,8 +112,8 @@  int exfat_bdev_write(struct super_block *sb, sector_t secno, struct buffer_head
 	return 0;
 
 no_bh:
-	WARN(!p_fs->dev_ejected,
-	     "[EXFAT] No bh, device seems wrong or to be ejected.\n");
+	if (p_fs->dev_ejected)
+		pr_info("[EXFAT] No bh, device seems wrong or to be ejected.\n");
 
 	return -EIO;
 }