From patchwork Sun Dec 9 14:04:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 1853791 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A237ADF215 for ; Sun, 9 Dec 2012 14:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758581Ab2LIOGg (ORCPT ); Sun, 9 Dec 2012 09:06:36 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:44294 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758575Ab2LIOGe (ORCPT ); Sun, 9 Dec 2012 09:06:34 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qB9E6V7E031841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 9 Dec 2012 14:06:31 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qB9E6U1j023628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Dec 2012 14:06:30 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qB9E6U5G015658; Sun, 9 Dec 2012 08:06:30 -0600 Received: from liubo.jp.oracle.com (/10.191.9.199) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 09 Dec 2012 06:06:28 -0800 Date: Sun, 9 Dec 2012 22:04:44 +0800 From: Liu Bo To: Jim Schutt Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, "ceph-devel@vger.kernel.org" Subject: Re: 3.7.0-rc8 btrfs locking issue Message-ID: <20121209140442.GA14309@liubo.jp.oracle.com> Reply-To: bo.li.liu@oracle.com References: <50BF7129.90602@sandia.gov> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50BF7129.90602@sandia.gov> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, Dec 05, 2012 at 09:07:05AM -0700, Jim Schutt wrote: > Hi, > > I'm hitting a btrfs locking issue with 3.7.0-rc8. > > The btrfs filesystem in question is backing a Ceph OSD > under a heavy write load from many cephfs clients. > > I reported this issue a while ago: > http://www.spinics.net/lists/linux-btrfs/msg19370.html > when I was testing what I thought might be part of the > 3.7 btrfs patch queue, using Josef Bacik's btrfs-next tree. > > I spent some time attempting to bisect the btrfs patch queue > just before it was merged for 3.7, but got nowhere due to > false negatives. > > I've just been able to get back to testing 3.7-rc, and found > that I can still trigger the issue. Hi Jim, Could you please apply the following patch to test if it works? (It's against 3.7-rc8.) flags = BTRFS_BLOCK_GROUP_METADATA; @@ -3535,6 +3536,7 @@ static u64 get_system_chunk_thresh(struct btrfs_root *root, u64 type) num_dev = 1; /* DUP or single */ /* metadata for updaing devices and chunk tree */ + num_dev = num_dev << 1 return btrfs_calc_trans_metadata_size(root, num_dev + 1); } @@ -4351,7 +4353,7 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info) fs_info->extent_root->block_rsv = &fs_info->global_block_rsv; fs_info->csum_root->block_rsv = &fs_info->global_block_rsv; - fs_info->dev_root->block_rsv = &fs_info->global_block_rsv; + fs_info->dev_root->block_rsv = &fs_info->chunk_block_rsv; fs_info->tree_root->block_rsv = &fs_info->global_block_rsv; fs_info->chunk_root->block_rsv = &fs_info->chunk_block_rsv; thanks, liubo > > First I get this lockdep splat: > > [ 1184.201331] ============================================= > [ 1184.206716] [ INFO: possible recursive locking detected ] > [ 1184.212111] 3.7.0-rc8-00013-gdf2fc24 #438 Not tainted > [ 1184.217156] --------------------------------------------- > [ 1184.222544] ceph-osd/42177 is trying to acquire lock: > [ 1184.227589] (&fs_info->chunk_mutex){+.+...}, at: [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.237270] > [ 1184.237270] but task is already holding lock: > [ 1184.243114] (&fs_info->chunk_mutex){+.+...}, at: [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.252786] > [ 1184.252786] other info that might help us debug this: > [ 1184.259303] Possible unsafe locking scenario: > [ 1184.259303] > [ 1184.265220] CPU0 > [ 1184.267680] ---- > [ 1184.270133] lock(&fs_info->chunk_mutex); > [ 1184.274276] lock(&fs_info->chunk_mutex); > [ 1184.278417] > [ 1184.278417] *** DEADLOCK *** > [ 1184.278417] > [ 1184.284325] May be due to missing lock nesting notation > [ 1184.284325] > [ 1184.291099] 4 locks held by ceph-osd/42177: > [ 1184.295277] #0: (sb_writers#7){.+.+.+}, at: [] btrfs_file_aio_write+0x64/0x320 [btrfs] > [ 1184.305103] #1: (&sb->s_type->i_mutex_key#9){+.+.+.}, at: [] btrfs_file_aio_write+0x6e/0x320 [btrfs] > [ 1184.316108] #2: (sb_internal){.+.+..}, at: [] start_transaction+0x1c4/0x450 [btrfs] > [ 1184.325632] #3: (&fs_info->chunk_mutex){+.+...}, at: [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.335761] > [ 1184.335761] stack backtrace: > [ 1184.340126] Pid: 42177, comm: ceph-osd Not tainted 3.7.0-rc8-00013-gdf2fc24 #438 > [ 1184.347508] Call Trace: > [ 1184.349962] [] ? vprintk_emit+0x42a/0x4c0 > [ 1184.355619] [] print_deadlock_bug+0xe9/0x100 > [ 1184.361556] [] validate_chain+0x596/0x750 > [ 1184.367222] [] __lock_acquire+0x449/0x510 > [ 1184.372894] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.379417] [] lock_acquire+0xc9/0x120 > [ 1184.384855] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.391377] [] ? __lock_acquire+0x449/0x510 > [ 1184.397204] [] __mutex_lock_common+0x5d/0x3a0 > [ 1184.403221] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.409762] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.416323] [] ? do_chunk_alloc+0x179/0x340 [btrfs] > [ 1184.422849] [] mutex_lock_nested+0x4a/0x60 > [ 1184.428640] [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1184.435018] [] find_free_extent+0xa3c/0xb70 [btrfs] > [ 1184.441555] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1184.449051] [] btrfs_reserve_extent+0x82/0x190 [btrfs] > [ 1184.455843] [] btrfs_alloc_free_block+0x85/0x230 [btrfs] > [ 1184.462828] [] __btrfs_cow_block+0x14a/0x4b0 [btrfs] > [ 1184.469471] [] ? btrfs_set_lock_blocking_rw+0xe3/0x160 [btrfs] > [ 1184.476962] [] btrfs_cow_block+0x18d/0x230 [btrfs] > [ 1184.483426] [] btrfs_search_slot+0x360/0x730 [btrfs] > [ 1184.490067] [] btrfs_insert_empty_items+0x8d/0x100 [btrfs] > [ 1184.497199] [] ? kmem_cache_alloc+0xd3/0x170 > [ 1184.503151] [] btrfs_alloc_dev_extent+0xb5/0x190 [btrfs] > [ 1184.510125] [] __btrfs_alloc_chunk+0x6a7/0x750 [btrfs] > [ 1184.516928] [] btrfs_alloc_chunk+0x5e/0x90 [btrfs] > [ 1184.523374] [] ? check_system_chunk+0x71/0x130 [btrfs] > [ 1184.530179] [] do_chunk_alloc+0x2ce/0x340 [btrfs] > [ 1184.536555] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1184.544070] [] btrfs_check_data_free_space+0x13c/0x2b0 [btrfs] > [ 1184.551574] [] btrfs_delalloc_reserve_space+0x20/0x60 [btrfs] > [ 1184.558987] [] __btrfs_buffered_write+0x15e/0x350 [btrfs] > [ 1184.566042] [] btrfs_file_aio_write+0x209/0x320 [btrfs] > [ 1184.572944] [] ? __btrfs_direct_write+0x130/0x130 [btrfs] > [ 1184.579984] [] do_sync_readv_writev+0x94/0xe0 > [ 1184.585985] [] do_readv_writev+0xe3/0x1e0 > [ 1184.591645] [] ? fget_light+0x122/0x170 > [ 1184.597131] [] vfs_writev+0x46/0x60 > [ 1184.602266] [] sys_writev+0x5f/0xc0 > [ 1184.607398] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 1184.613832] [] system_call_fastpath+0x16/0x1b > > and then a little later: > > [ 1319.463719] INFO: task ceph-osd:42177 blocked for more than 120 seconds. > [ 1319.470409] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1319.478227] ceph-osd D 0000000000000246 0 42177 1 0x00000000 > [ 1319.485330] ffff880402c4d358 0000000000000046 00007fffeccc49d0 ffff880402c4dfd8 > [ 1319.492852] ffff880402c4c010 ffff880402c4c000 ffff880402c4c000 ffff880402c4c000 > [ 1319.500449] ffff880402c4dfd8 ffff880402c4c000 ffff880c2151bec0 ffff8804e9403ec0 > [ 1319.508012] Call Trace: > [ 1319.510495] [] schedule+0x5d/0x60 > [ 1319.515478] [] schedule_preempt_disabled+0x27/0x40 > [ 1319.521967] [] __mutex_lock_common+0x255/0x3a0 > [ 1319.528090] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1319.534659] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1319.541264] [] mutex_lock_nested+0x4a/0x60 > [ 1319.547118] [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1319.553532] [] find_free_extent+0xa3c/0xb70 [btrfs] > [ 1319.560122] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1319.567620] [] btrfs_reserve_extent+0x82/0x190 [btrfs] > [ 1319.574460] [] btrfs_alloc_free_block+0x85/0x230 [btrfs] > [ 1319.581464] [] __btrfs_cow_block+0x14a/0x4b0 [btrfs] > [ 1319.588117] [] ? btrfs_set_lock_blocking_rw+0xe3/0x160 [btrfs] > [ 1319.595644] [] btrfs_cow_block+0x18d/0x230 [btrfs] > [ 1319.602110] [] btrfs_search_slot+0x360/0x730 [btrfs] > [ 1319.608767] [] btrfs_insert_empty_items+0x8d/0x100 [btrfs] > [ 1319.615897] [] ? kmem_cache_alloc+0xd3/0x170 > [ 1319.621910] [] btrfs_alloc_dev_extent+0xb5/0x190 [btrfs] > [ 1319.628893] [] __btrfs_alloc_chunk+0x6a7/0x750 [btrfs] > [ 1319.635736] [] btrfs_alloc_chunk+0x5e/0x90 [btrfs] > [ 1319.642184] [] ? check_system_chunk+0x71/0x130 [btrfs] > [ 1319.649009] [] do_chunk_alloc+0x2ce/0x340 [btrfs] > [ 1319.655366] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1319.662935] [] btrfs_check_data_free_space+0x13c/0x2b0 [btrfs] > [ 1319.670465] [] btrfs_delalloc_reserve_space+0x20/0x60 [btrfs] > [ 1319.677891] [] __btrfs_buffered_write+0x15e/0x350 [btrfs] > [ 1319.685000] [] btrfs_file_aio_write+0x209/0x320 [btrfs] > [ 1319.691952] [] ? __btrfs_direct_write+0x130/0x130 [btrfs] > [ 1319.699054] [] do_sync_readv_writev+0x94/0xe0 > [ 1319.705118] [] do_readv_writev+0xe3/0x1e0 > [ 1319.710828] [] ? fget_light+0x122/0x170 > [ 1319.716324] [] vfs_writev+0x46/0x60 > [ 1319.721466] [] sys_writev+0x5f/0xc0 > [ 1319.726674] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 1319.733198] [] system_call_fastpath+0x16/0x1b > [ 1319.739274] INFO: lockdep is turned off. > [ 1319.743261] INFO: task ceph-osd:42236 blocked for more than 120 seconds. > [ 1319.749953] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1319.757812] ceph-osd D 0000000000000246 0 42236 1 0x00000000 > [ 1319.765056] ffff88052e7bdcc8 0000000000000046 ffff880624666120 ffff88052e7bdfd8 > [ 1319.772785] ffff88052e7bc010 ffff88052e7bc000 ffff88052e7bc000 ffff88052e7bc000 > [ 1319.780332] ffff88052e7bdfd8 ffff88052e7bc000 ffff88062453bec0 ffff88052e7b5e20 > [ 1319.787905] Call Trace: > [ 1319.790368] [] schedule+0x5d/0x60 > [ 1319.795335] [] schedule_preempt_disabled+0x27/0x40 > [ 1319.801762] [] __mutex_lock_common+0x255/0x3a0 > [ 1319.807861] [] ? btrfs_statfs+0x5f/0x240 [btrfs] > [ 1319.814143] [] ? final_putname+0x3f/0x50 > [ 1319.819724] [] ? btrfs_statfs+0x5f/0x240 [btrfs] > [ 1319.825982] [] mutex_lock_nested+0x4a/0x60 > [ 1319.831731] [] btrfs_statfs+0x5f/0x240 [btrfs] > [ 1319.837846] [] statfs_by_dentry+0x60/0x90 > [ 1319.843508] [] vfs_statfs+0x1b/0xb0 > [ 1319.848659] [] user_statfs+0x40/0x60 > [ 1319.853887] [] sys_statfs+0x2a/0x50 > [ 1319.859036] [] system_call_fastpath+0x16/0x1b > [ 1319.865035] INFO: lockdep is turned off. > > and then later still: > > [ 1439.546768] INFO: task btrfs-transacti:27591 blocked for more than 120 seconds. > [ 1439.554139] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1439.561949] btrfs-transacti D ffff880993231810 0 27591 2 0x00000000 > [ 1439.569205] ffff8808e79d3c58 0000000000000046 0000000000000000 ffff8808e79d3fd8 > [ 1439.576820] ffff8808e79d2010 ffff8808e79d2000 ffff8808e79d2000 ffff8808e79d2000 > [ 1439.584384] ffff8808e79d3fd8 ffff8808e79d2000 ffff880b3f165e20 ffff8808d8cdbec0 > [ 1439.592040] Call Trace: > [ 1439.594573] [] schedule+0x5d/0x60 > [ 1439.599646] [] schedule_timeout+0x3d/0x260 > [ 1439.605402] [] ? trace_hardirqs_on_caller+0x20/0x1d0 > [ 1439.612023] [] ? trace_hardirqs_on+0xd/0x10 > [ 1439.617939] [] ? prepare_to_wait+0x7a/0x90 > [ 1439.623788] [] btrfs_commit_transaction+0x336/0xa10 [btrfs] > [ 1439.631128] [] ? start_transaction+0x3cb/0x450 [btrfs] > [ 1439.637943] [] ? wake_up_bit+0x40/0x40 > [ 1439.643380] [] transaction_kthread+0x123/0x210 [btrfs] > [ 1439.650259] [] ? btrfs_bio_wq_end_io+0x90/0x90 [btrfs] > [ 1439.657134] [] kthread+0xe1/0xf0 > [ 1439.662109] [] ? __init_kthread_worker+0x70/0x70 > [ 1439.668398] [] ret_from_fork+0x7c/0xb0 > [ 1439.673858] [] ? __init_kthread_worker+0x70/0x70 > [ 1439.680181] INFO: lockdep is turned off. > [ 1439.685095] INFO: task ceph-osd:42177 blocked for more than 120 seconds. > [ 1439.691847] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1439.699743] ceph-osd D 0000000000000246 0 42177 1 0x00000000 > [ 1439.706941] ffff880402c4d358 0000000000000046 00007fffeccc49d0 ffff880402c4dfd8 > [ 1439.714494] ffff880402c4c010 ffff880402c4c000 ffff880402c4c000 ffff880402c4c000 > [ 1439.722039] ffff880402c4dfd8 ffff880402c4c000 ffff880c2151bec0 ffff8804e9403ec0 > [ 1439.729688] Call Trace: > [ 1439.732217] [] schedule+0x5d/0x60 > [ 1439.737179] [] schedule_preempt_disabled+0x27/0x40 > [ 1439.743705] [] __mutex_lock_common+0x255/0x3a0 > [ 1439.749843] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1439.756481] [] ? do_chunk_alloc+0x183/0x340 [btrfs] > [ 1439.763037] [] mutex_lock_nested+0x4a/0x60 > [ 1439.768854] [] do_chunk_alloc+0x183/0x340 [btrfs] > [ 1439.775290] [] find_free_extent+0xa3c/0xb70 [btrfs] > [ 1439.781932] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1439.789534] [] btrfs_reserve_extent+0x82/0x190 [btrfs] > [ 1439.796474] [] btrfs_alloc_free_block+0x85/0x230 [btrfs] > [ 1439.803499] [] __btrfs_cow_block+0x14a/0x4b0 [btrfs] > [ 1439.810253] [] ? btrfs_set_lock_blocking_rw+0xe3/0x160 [btrfs] > [ 1439.817877] [] btrfs_cow_block+0x18d/0x230 [btrfs] > [ 1439.824427] [] btrfs_search_slot+0x360/0x730 [btrfs] > [ 1439.831162] [] btrfs_insert_empty_items+0x8d/0x100 [btrfs] > [ 1439.838423] [] ? kmem_cache_alloc+0xd3/0x170 > [ 1439.844514] [] btrfs_alloc_dev_extent+0xb5/0x190 [btrfs] > [ 1439.851619] [] __btrfs_alloc_chunk+0x6a7/0x750 [btrfs] > [ 1439.858535] [] btrfs_alloc_chunk+0x5e/0x90 [btrfs] > [ 1439.865079] [] ? check_system_chunk+0x71/0x130 [btrfs] > [ 1439.871939] [] do_chunk_alloc+0x2ce/0x340 [btrfs] > [ 1439.878375] [] ? btrfs_reduce_alloc_profile+0xa9/0x120 [btrfs] > [ 1439.885933] [] btrfs_check_data_free_space+0x13c/0x2b0 [btrfs] > [ 1439.893514] [] btrfs_delalloc_reserve_space+0x20/0x60 [btrfs] > [ 1439.901018] [] __btrfs_buffered_write+0x15e/0x350 [btrfs] > [ 1439.908226] [] btrfs_file_aio_write+0x209/0x320 [btrfs] > [ 1439.915235] [] ? __btrfs_direct_write+0x130/0x130 [btrfs] > [ 1439.922375] [] do_sync_readv_writev+0x94/0xe0 > [ 1439.928475] [] do_readv_writev+0xe3/0x1e0 > [ 1439.934197] [] ? fget_light+0x122/0x170 > [ 1439.939738] [] vfs_writev+0x46/0x60 > [ 1439.944948] [] sys_writev+0x5f/0xc0 > [ 1439.950139] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 1439.956621] [] system_call_fastpath+0x16/0x1b > [ 1439.962742] INFO: lockdep is turned off. > [ 1439.966769] INFO: task ceph-osd:42236 blocked for more than 120 seconds. > [ 1439.973558] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > [ 1439.981513] ceph-osd D 0000000000000246 0 42236 1 0x00000000 > [ 1439.988788] ffff88052e7bdcc8 0000000000000046 ffff880624666120 ffff88052e7bdfd8 > [ 1439.996611] ffff88052e7bc010 ffff88052e7bc000 ffff88052e7bc000 ffff88052e7bc000 > [ 1440.004237] ffff88052e7bdfd8 ffff88052e7bc000 ffff88062453bec0 ffff88052e7b5e20 > [ 1440.011956] Call Trace: > [ 1440.014516] [] schedule+0x5d/0x60 > [ 1440.019578] [] schedule_preempt_disabled+0x27/0x40 > [ 1440.026054] [] __mutex_lock_common+0x255/0x3a0 > [ 1440.032245] [] ? btrfs_statfs+0x5f/0x240 [btrfs] > [ 1440.038624] [] ? final_putname+0x3f/0x50 > [ 1440.044323] [] ? btrfs_statfs+0x5f/0x240 [btrfs] > [ 1440.050952] [] mutex_lock_nested+0x4a/0x60 > [ 1440.056805] [] btrfs_statfs+0x5f/0x240 [btrfs] > [ 1440.063029] [] statfs_by_dentry+0x60/0x90 > [ 1440.068739] [] vfs_statfs+0x1b/0xb0 > [ 1440.073962] [] user_statfs+0x40/0x60 > [ 1440.079203] [] sys_statfs+0x2a/0x50 > [ 1440.084401] [] system_call_fastpath+0x16/0x1b > [ 1440.090816] INFO: lockdep is turned off. > > > Please let me know what I can do to help resolve this issue. > > Thanks -- Jim > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3d3e2c1..100289b 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3346,7 +3346,8 @@ u64 btrfs_get_alloc_profile(struct btrfs_root *root, int data) if (data) flags = BTRFS_BLOCK_GROUP_DATA; - else if (root == root->fs_info->chunk_root) + else if (root == root->fs_info->chunk_root || + root == root->fs_info->dev_root) flags = BTRFS_BLOCK_GROUP_SYSTEM; else