diff mbox series

[04/11] btrfs: Suppress the message about missing filesystem

Message ID 20210818214022.4.I3eb71025472bbb050bcf9a0a192dde1b6c07fa7f@changeid (mailing list archive)
State New, archived
Headers show
Series sandbox: Minor fixes and improvements | expand

Commit Message

Simon Glass Aug. 19, 2021, 3:40 a.m. UTC
This message comes up a lot when scanning filesystems. It suggests to the
user that there is some sort of error, but in fact there is no reason to
expect that a particular partition has a btrfs filesystem. Other
filesystems don't print this error.

Turn it into a debug message.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 fs/btrfs/disk-io.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Marek Behún Aug. 19, 2021, 10:31 a.m. UTC | #1
On Wed, 18 Aug 2021 21:40:26 -0600
Simon Glass <sjg@chromium.org> wrote:

> This message comes up a lot when scanning filesystems. It suggests to the
> user that there is some sort of error, but in fact there is no reason to
> expect that a particular partition has a btrfs filesystem. Other
> filesystems don't print this error.
> 
> Turn it into a debug message.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Marek Behún <marek.behun@nic.cz>

This must have been introduced after btrfs was reimplemented from the
btrfs-progs sources. I remember that I sent a patch fixing this same
issue for the previous implementation (or was it another filesystem?).

Marek
Qu Wenruo Aug. 19, 2021, 10:48 a.m. UTC | #2
On 2021/8/19 上午11:40, Simon Glass wrote:
> This message comes up a lot when scanning filesystems. It suggests to the
> user that there is some sort of error, but in fact there is no reason to
> expect that a particular partition has a btrfs filesystem. Other
> filesystems don't print this error.
>
> Turn it into a debug message.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>
>   fs/btrfs/disk-io.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 349411c3ccd..1b69346e231 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -886,7 +886,11 @@ static int btrfs_scan_fs_devices(struct blk_desc *desc,
>
>   	ret = btrfs_scan_one_device(desc, part, fs_devices, &total_devs);
>   	if (ret) {
> -		fprintf(stderr, "No valid Btrfs found\n");
> +		/*
> +		 * Avoid showing this when probing for a possible Btrfs
> +		 *
> +		 * fprintf(stderr, "No valid Btrfs found\n");
> +		 */
>   		return ret;
>   	}
>   	return 0;
> @@ -975,7 +979,7 @@ struct btrfs_fs_info *open_ctree_fs_info(struct blk_desc *desc,
>   	disk_super = fs_info->super_copy;
>   	ret = btrfs_read_dev_super(desc, part, disk_super);
>   	if (ret) {
> -		printk("No valid btrfs found\n");
> +		debug("No valid btrfs found\n");
>   		goto out_devices;
>   	}
>
>
Tom Rini Sept. 23, 2021, 2:08 a.m. UTC | #3
On Wed, Aug 18, 2021 at 09:40:26PM -0600, Simon Glass wrote:

> This message comes up a lot when scanning filesystems. It suggests to the
> user that there is some sort of error, but in fact there is no reason to
> expect that a particular partition has a btrfs filesystem. Other
> filesystems don't print this error.
> 
> Turn it into a debug message.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Marek Behún <marek.behun@nic.cz>
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 349411c3ccd..1b69346e231 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -886,7 +886,11 @@  static int btrfs_scan_fs_devices(struct blk_desc *desc,
 
 	ret = btrfs_scan_one_device(desc, part, fs_devices, &total_devs);
 	if (ret) {
-		fprintf(stderr, "No valid Btrfs found\n");
+		/*
+		 * Avoid showing this when probing for a possible Btrfs
+		 *
+		 * fprintf(stderr, "No valid Btrfs found\n");
+		 */
 		return ret;
 	}
 	return 0;
@@ -975,7 +979,7 @@  struct btrfs_fs_info *open_ctree_fs_info(struct blk_desc *desc,
 	disk_super = fs_info->super_copy;
 	ret = btrfs_read_dev_super(desc, part, disk_super);
 	if (ret) {
-		printk("No valid btrfs found\n");
+		debug("No valid btrfs found\n");
 		goto out_devices;
 	}