From 4ad22f2cc2a45b877e5d4e8381ac83be8d4fc147 Mon Sep 17 00:00:00 2001 From: quwenruo Date: Sun, 20 Sep 2015 09:16:52 +0800 Subject: [PATCH] btrfs: qgroup: Add extra check for quota_root Some strange bug implies even for qgroup rescan, it's still possible quota_root is not initialized. Root reason is still not sure, so this is just a temporary hotfix. Signed-off-by: quwenruo --- fs/btrfs/qgroup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 8a82029..a12ed9b 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -2312,6 +2312,13 @@ out: mutex_unlock(&fs_info->qgroup_rescan_lock); /* + * XXX: Unknown bug which may race with quota_root init, avoid to + * start transaction for NULL quota_root. + */ + if (!fs_info->quota_root) + goto done; + + /* * only update status, since the previous part has alreay updated the * qgroup info. */ -- 2.5.1