Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-18 Thread Stefan Behrens
On Sat, 16 Feb 2013 14:47:45 +0800, Liu Bo wrote: What about this patch(UNTESTED)? thanks, liubo diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca7ace7..dac9d4b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4142,9 +4142,14 @@ static void inode_tree_del(struct inode

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-18 Thread Liu Bo
On Mon, Feb 18, 2013 at 05:53:50PM +0100, Stefan Behrens wrote: On Sat, 16 Feb 2013 14:47:45 +0800, Liu Bo wrote: What about this patch(UNTESTED)? thanks, liubo diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca7ace7..dac9d4b 100644 --- a/fs/btrfs/inode.c +++

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-02-15 Thread Liu Bo
On Mon, Jan 28, 2013 at 05:55:57PM +0100, Stefan Behrens wrote: [CC list reduced (my initial statement was that such dead_list corruptions happen without the snapshot-aware defrag patch, by now the contents is not related to the snapshot-aware defrag patch anymore)] [...] No, this did not

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-28 Thread Stefan Behrens
[CC list reduced (my initial statement was that such dead_list corruptions happen without the snapshot-aware defrag patch, by now the contents is not related to the snapshot-aware defrag patch anymore)] On Sun, 27 Jan 2013 21:19:53 +0800, Liu Bo wrote: On Fri, Jan 25, 2013 at 04:40:28PM +0100,

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-27 Thread Liu Bo
On Fri, Jan 25, 2013 at 12:16:29PM -0600, Mitch Harder wrote: [...] I've changed up my reproducer to try some things that may hit the issue quicker and more reliably. It gave me a slightly different set of warnings in dmesg, which seem to suggest issues in the dead_root list.

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-27 Thread Mitch Harder
On Sun, Jan 27, 2013 at 6:41 AM, Liu Bo bo.li@oracle.com wrote: Hi Mitch, Many thanks for testing it! Well, after some debugging, I finally figure out the whys: (1) btrfs_ioctl_snap_destroy() will free the inode of snapshot and set root's refs to zero(btrfs_set_root_refs()), if this

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-27 Thread Liu Bo
On Sun, Jan 27, 2013 at 11:20:41PM -0600, Mitch Harder wrote: On Sun, Jan 27, 2013 at 6:41 AM, Liu Bo bo.li@oracle.com wrote: Hi Mitch, Many thanks for testing it! Well, after some debugging, I finally figure out the whys: (1) btrfs_ioctl_snap_destroy() will free the inode of

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-25 Thread Mitch Harder
On Wed, Jan 23, 2013 at 6:52 PM, Liu Bo bo.li@oracle.com wrote: On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at 11:41:19AM -0600, Mitch Harder wrote: On Thu, Jan 17, 2013 at 8:42 AM,

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-25 Thread Stefan Behrens
On Fri, 25 Jan 2013 08:55:58 -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 6:52 PM, Liu Bo bo.li@oracle.com wrote: On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at 11:41:19AM

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-25 Thread Liu Bo
On Fri, Jan 25, 2013 at 08:55:58AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 6:52 PM, Liu Bo bo.li@oracle.com wrote: On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-25 Thread Mitch Harder
On Fri, Jan 25, 2013 at 9:42 AM, Liu Bo bo.li@oracle.com wrote: On Fri, Jan 25, 2013 at 08:55:58AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 6:52 PM, Liu Bo bo.li@oracle.com wrote: On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 1:51 AM,

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-23 Thread Mitch Harder
On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at 11:41:19AM -0600, Mitch Harder wrote: On Thu, Jan 17, 2013 at 8:42 AM, Mitch Harder mitch.har...@sabayonlinux.org wrote: On Wed, Jan 16, 2013 at 6:36 AM, Liu Bo bo.li@oracle.com wrote: This comes

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-23 Thread Liu Bo
On Wed, Jan 23, 2013 at 10:05:04AM -0600, Mitch Harder wrote: On Wed, Jan 23, 2013 at 1:51 AM, Liu Bo bo.li@oracle.com wrote: On Tue, Jan 22, 2013 at 11:41:19AM -0600, Mitch Harder wrote: On Thu, Jan 17, 2013 at 8:42 AM, Mitch Harder mitch.har...@sabayonlinux.org wrote: On Wed, Jan

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-22 Thread Mitch Harder
On Thu, Jan 17, 2013 at 8:42 AM, Mitch Harder mitch.har...@sabayonlinux.org wrote: On Wed, Jan 16, 2013 at 6:36 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-22 Thread Liu Bo
On Tue, Jan 22, 2013 at 11:41:19AM -0600, Mitch Harder wrote: On Thu, Jan 17, 2013 at 8:42 AM, Mitch Harder mitch.har...@sabayonlinux.org wrote: On Wed, Jan 16, 2013 at 6:36 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-18 Thread David Sterba
On Thu, Jan 17, 2013 at 08:42:46AM -0600, Mitch Harder wrote: [16028.160002] RAX: dead00200200 RBX: 8800 RCX: 00018e20 [16028.160002] RDX: dead00100100 RSI: 001b RDI: 001b RAX: dead00200200 RDX: dead00100100 list_head poisons to

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-17 Thread Liu Bo
On Thu, Jan 17, 2013 at 08:42:46AM -0600, Mitch Harder wrote: On Wed, Jan 16, 2013 at 6:36 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will preserve the sharing,

Re: [PATCH V5] Btrfs: snapshot-aware defrag

2013-01-17 Thread Mitch Harder
On Thu, Jan 17, 2013 at 6:53 PM, Liu Bo bo.li@oracle.com wrote: On Thu, Jan 17, 2013 at 08:42:46AM -0600, Mitch Harder wrote: On Wed, Jan 16, 2013 at 6:36 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing

[PATCH V5] Btrfs: snapshot-aware defrag

2013-01-16 Thread Liu Bo
This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will preserve the sharing, and defrag needs to grow this as well. Now we're able to fill the blank with this patch, in which we make full use of backref walking