Commit eca1e8a6 authored by Qu Wenruo's avatar Qu Wenruo Committed by Wentao Guan
Browse files

btrfs: output the reason for open_ctree() failure

stable inclusion
from stable-v6.6.76
commit 49b8241c5aaf9226a8e194e81e0fbf6c2bf5d7b0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBW08Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=49b8241c5aaf9226a8e194e81e0fbf6c2bf5d7b0

--------------------------------

commit d0f038104fa37380e2a725e669508e43d0c503e9 upstream.

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: default avatarChristoph Anton Mitterer <calestyo@scientia.org>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 49b8241c5aaf9226a8e194e81e0fbf6c2bf5d7b0)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent d47c9644
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1162,7 +1162,7 @@ static int btrfs_fill_super(struct super_block *sb,

	err = open_ctree(sb, fs_devices, (char *)data);
	if (err) {
		btrfs_err(fs_info, "open_ctree failed");
		btrfs_err(fs_info, "open_ctree failed: %d", err);
		return err;
	}