linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: Show detail information when mount failed on missing devices
@ 2015-07-16  8:44 Zhaolei
  2015-07-17 10:32 ` Anand Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Zhaolei @ 2015-07-16  8:44 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Zhao Lei

From: Zhao Lei <zhaolei@cn.fujitsu.com>

When mount failed because missing device, we can see following
dmesg:
 [ 1060.267743] BTRFS: too many missing devices, writeable mount is not allowed
 [ 1060.273158] BTRFS: open_ctree failed

This patch add missing_device_number and tolerated_missing_device_number
to above output, to let user know what really happened, and helps
bug-report and debug.

dmesg after patch:
 [  127.912406] BTRFS: too many missing devices(1 > 0), writeable mount is not allowed
 [  127.918128] BTRFS: open_ctree failed

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 fs/btrfs/disk-io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2eda03b..b6600c7 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2950,8 +2950,9 @@ retry_root_backup:
 	if (fs_info->fs_devices->missing_devices >
 	     fs_info->num_tolerated_disk_barrier_failures &&
 	    !(sb->s_flags & MS_RDONLY)) {
-		printk(KERN_WARNING "BTRFS: "
-			"too many missing devices, writeable mount is not allowed\n");
+		pr_warn("BTRFS: too many missing devices(%llu > %d), writeable mount is not allowed\n",
+			fs_info->fs_devices->missing_devices,
+			fs_info->num_tolerated_disk_barrier_failures);
 		goto fail_sysfs;
 	}
 
-- 
1.8.5.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: Show detail information when mount failed on missing devices
  2015-07-16  8:44 [PATCH] btrfs: Show detail information when mount failed on missing devices Zhaolei
@ 2015-07-17 10:32 ` Anand Jain
  0 siblings, 0 replies; 3+ messages in thread
From: Anand Jain @ 2015-07-17 10:32 UTC (permalink / raw)
  To: Zhaolei, linux-btrfs



On 07/16/2015 04:44 PM, Zhaolei wrote:
> From: Zhao Lei <zhaolei@cn.fujitsu.com>
>
> When mount failed because missing device, we can see following
> dmesg:
>   [ 1060.267743] BTRFS: too many missing devices, writeable mount is not allowed
>   [ 1060.273158] BTRFS: open_ctree failed
>
> This patch add missing_device_number and tolerated_missing_device_number
> to above output, to let user know what really happened, and helps
> bug-report and debug.

  yes.

> dmesg after patch:
>   [  127.912406] BTRFS: too many missing devices(1 > 0), writeable mount is not allowed
>   [  127.918128] BTRFS: open_ctree failed

  it better to change the whole message just (1 > 0) is not more
  informative unless src code is looked into.

  something like

  missing devices 1 max missing 0, writable mount is not allowed.

Thanks, Anand


> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> ---
>   fs/btrfs/disk-io.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 2eda03b..b6600c7 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2950,8 +2950,9 @@ retry_root_backup:
>   	if (fs_info->fs_devices->missing_devices >
>   	     fs_info->num_tolerated_disk_barrier_failures &&
>   	    !(sb->s_flags & MS_RDONLY)) {
> -		printk(KERN_WARNING "BTRFS: "
> -			"too many missing devices, writeable mount is not allowed\n");
> +		pr_warn("BTRFS: too many missing devices(%llu > %d), writeable mount is not allowed\n",
> +			fs_info->fs_devices->missing_devices,
> +			fs_info->num_tolerated_disk_barrier_failures);
>   		goto fail_sysfs;
>   	}
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] btrfs: Show detail information when mount failed on missing devices
@ 2015-07-20  9:54 Zhaolei
  0 siblings, 0 replies; 3+ messages in thread
From: Zhaolei @ 2015-07-20  9:54 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Zhao Lei

From: Zhao Lei <zhaolei@cn.fujitsu.com>

When mount failed because missing device, we can see following
dmesg:
 [ 1060.267743] BTRFS: too many missing devices, writeable mount is not allowed
 [ 1060.273158] BTRFS: open_ctree failed

This patch add missing_device_number and tolerated_missing_device_number
to above output, to let user know what really happened, and helps
bug-report and debug.

dmesg after patch:
 [  127.050367] BTRFS: missing devices(1) exceeds the limit(0), writeable mount is not allowed
 [  127.056099] BTRFS: open_ctree failed

Changelog v1->v2:
1: Changed to more clear description, suggested-by:
   Anand Jain <anand.jain@oracle.com>

Suggested-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 fs/btrfs/disk-io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2eda03b..5b44e02 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2950,8 +2950,9 @@ retry_root_backup:
 	if (fs_info->fs_devices->missing_devices >
 	     fs_info->num_tolerated_disk_barrier_failures &&
 	    !(sb->s_flags & MS_RDONLY)) {
-		printk(KERN_WARNING "BTRFS: "
-			"too many missing devices, writeable mount is not allowed\n");
+		pr_warn("BTRFS: missing devices(%llu) exceeds the limit(%d), writeable mount is not allowed\n",
+			fs_info->fs_devices->missing_devices,
+			fs_info->num_tolerated_disk_barrier_failures);
 		goto fail_sysfs;
 	}
 
-- 
1.8.5.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-20  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  8:44 [PATCH] btrfs: Show detail information when mount failed on missing devices Zhaolei
2015-07-17 10:32 ` Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2015-07-20  9:54 Zhaolei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).