From 33b97e43279a60729eee502809cf5269b3a64cf3 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Fri, 8 May 2015 04:34:35 +0800 Subject: [PATCH] Btrfs: check error before reporting missing device and add uuid Report missing device when add is successful, otherwise it would exit as ENOMEM. And add uuid to the report. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: Chris Mason --- fs/btrfs/volumes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 38d3a0f3bcdd..403ed1fdd901 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6230,10 +6230,11 @@ static int read_one_dev(struct btrfs_root *root, if (!btrfs_test_opt(root, DEGRADED)) return -EIO; - btrfs_warn(root->fs_info, "devid %llu missing", devid); device = add_missing_dev(root, fs_devices, devid, dev_uuid); if (!device) return -ENOMEM; + btrfs_warn(root->fs_info, "devid %llu uuid %pU missing", + devid, dev_uuid); } else { if (!device->bdev && !btrfs_test_opt(root, DEGRADED)) return -EIO; -- 2.30.2