Btrfs: ignore orphan qgroup relations
authorArne Jansen <sensille@gmx.net>
Thu, 17 Jan 2013 08:22:08 +0000 (01:22 -0700)
committerChris Mason <chris.mason@fusionio.com>
Tue, 22 Jan 2013 01:18:11 +0000 (20:18 -0500)
If a qgroup that has still assignments is deleted by the user, the corresponding
relations are left in the tree. This leads to an unmountable filesystem.
With this patch, those relations are simple ignored.

Reported-by: Eric Hopper <hopper@omnifarious.org>
Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/qgroup.c

index fe9d02c45f8e521f87b44d6deff3e5f8d99aa3a9..28f2b39f6a25d338565fa00b526c667d3542e0a0 100644 (file)
@@ -379,6 +379,13 @@ next1:
 
                ret = add_relation_rb(fs_info, found_key.objectid,
                                      found_key.offset);
+               if (ret == -ENOENT) {
+                       printk(KERN_WARNING
+                               "btrfs: orphan qgroup relation 0x%llx->0x%llx\n",
+                               (unsigned long long)found_key.objectid,
+                               (unsigned long long)found_key.offset);
+                       ret = 0;        /* ignore the error */
+               }
                if (ret)
                        goto out;
 next2: