linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: do not defrag extent root in ioctl
@ 2013-10-08 10:19 Liu Bo
  2013-10-08 14:16 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Bo @ 2013-10-08 10:19 UTC (permalink / raw)
  To: linux-btrfs

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Btrfs: do not defrag extent root in ioctl
  2013-10-08 10:19 [PATCH] Btrfs: do not defrag extent root in ioctl Liu Bo
@ 2013-10-08 14:16 ` David Sterba
  2013-10-09  2:45   ` Liu Bo
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2013-10-08 14:16 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Btrfs: do not defrag extent root in ioctl
  2013-10-08 14:16 ` David Sterba
@ 2013-10-09  2:45   ` Liu Bo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Bo @ 2013-10-09  2:45 UTC (permalink / raw)
  To: dsterba, linux-btrfs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-09  2:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 10:19 [PATCH] Btrfs: do not defrag extent root in ioctl Liu Bo
2013-10-08 14:16 ` David Sterba
2013-10-09  2:45   ` Liu Bo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).