diff mbox series

btrfs: output the reason for open_ctree() failure

Message ID 037d2532a0f9ef545cf20fee903fc22936ad1bdc.1733806379.git.wqu@suse.com (mailing list archive)
State New
Headers show
Series btrfs: output the reason for open_ctree() failure | expand

Commit Message

Qu Wenruo Dec. 10, 2024, 4:53 a.m. UTC
There is a recent ML report that mounting a large fs backed by hardware
RAID56 controller (with one device missing) took too much time, and
systemd seems to kill the mount attempt.

In that case, the only error message is:

  BTRFS error (device sdj): open_ctree failed

There is no reason on why the failure happened, making it very hard to
understand the reason.

At least output the error number (in the particular case it should be
-EINTR) to provide some clue.

Link: https://lore.kernel.org/linux-btrfs/9b9c4d2810abcca2f9f76e32220ed9a90febb235.camel@scientia.org/
Reported-by: Christoph Anton Mitterer <calestyo@scientia.org>
Cc: stable@vger.kernel.org
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Filipe Manana Dec. 10, 2024, 11:12 a.m. UTC | #1
On Tue, Dec 10, 2024 at 4:53 AM Qu Wenruo <wqu@suse.com> wrote:
>
> There is a recent ML report that mounting a large fs backed by hardware
> RAID56 controller (with one device missing) took too much time, and
> systemd seems to kill the mount attempt.
>
> In that case, the only error message is:
>
>   BTRFS error (device sdj): open_ctree failed
>
> There is no reason on why the failure happened, making it very hard to
> understand the reason.
>
> At least output the error number (in the particular case it should be
> -EINTR) to provide some clue.
>
> Link: https://lore.kernel.org/linux-btrfs/9b9c4d2810abcca2f9f76e32220ed9a90febb235.camel@scientia.org/
> Reported-by: Christoph Anton Mitterer <calestyo@scientia.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good, thanks.

> ---
>  fs/btrfs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 7dfe5005129a..f6eaaf20229d 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -971,7 +971,7 @@ static int btrfs_fill_super(struct super_block *sb,
>
>         err = open_ctree(sb, fs_devices);
>         if (err) {
> -               btrfs_err(fs_info, "open_ctree failed");
> +               btrfs_err(fs_info, "open_ctree failed: %d", err);
>                 return err;
>         }
>
> --
> 2.47.1
>
>
diff mbox series

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7dfe5005129a..f6eaaf20229d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -971,7 +971,7 @@  static int btrfs_fill_super(struct super_block *sb,
 
 	err = open_ctree(sb, fs_devices);
 	if (err) {
-		btrfs_err(fs_info, "open_ctree failed");
+		btrfs_err(fs_info, "open_ctree failed: %d", err);
 		return err;
 	}