We can''t defrag the extent root without deadlock. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> --- fs/btrfs/ioctl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9d46f60..12d8570 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2322,9 +2322,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) goto out; } ret = btrfs_defrag_root(root); - if (ret) - goto out; - ret = btrfs_defrag_root(root->fs_info->extent_root); break; case S_IFREG: if (!(file->f_mode & FMODE_WRITE)) { -- 1.8.1.4 -- 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
On Tue, Oct 08, 2013 at 06:19:30PM +0800, Liu Bo wrote:> We can''t defrag the extent root without deadlock.Deadlock under what circumstance? Eg. with snapshot aware defag turned on or extent tree cannot be safely defragmented at all? david -- 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
On Tue, Oct 08, 2013 at 04:16:23PM +0200, David Sterba wrote:> On Tue, Oct 08, 2013 at 06:19:30PM +0800, Liu Bo wrote: > > We can''t defrag the extent root without deadlock. > > Deadlock under what circumstance? Eg. with snapshot aware defag turned > on or extent tree cannot be safely defragmented at all?Hmm, my assumption is based on the comments in btrfs_defrag_leaves(), Quoting, "there''s recursion here right now in the tree locking, we can''t defrag the extent root without deadlock." But I just made a quick test, defragment on extent root seems to be good. I need to dig this more, thanks for pointing out that, Dave. -liubo -- 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