Re: [PATCH 2/2] Btrfs: fix memory leak of pending_snapshot-inherit

2013-02-07 Thread Arne Jansen
On 02/07/13 07:02, Miao Xie wrote: The argument inherit of btrfs_ioctl_snap_create_transid() was assigned to NULL during we created the snapshots, so we didn't free it though we called kfree() in the caller. But since we are sure the snapshot creation is done after the function -

Re: [PATCH 2/2] Btrfs: fix memory leak of pending_snapshot-inherit

2013-02-07 Thread Alex Lyakas
Arne, Miao, I also agree that it is better to move this responsibility to create_pending_snapshot(). Alex. On Thu, Feb 7, 2013 at 10:43 AM, Arne Jansen sensi...@gmx.net wrote: On 02/07/13 07:02, Miao Xie wrote: The argument inherit of btrfs_ioctl_snap_create_transid() was assigned to NULL

Re: [PATCH 2/2] Btrfs: fix memory leak of pending_snapshot-inherit

2013-02-07 Thread Miao Xie
On Thu, 07 Feb 2013 09:43:47 +0100, Arne Jansen wrote: On 02/07/13 07:02, Miao Xie wrote: The argument inherit of btrfs_ioctl_snap_create_transid() was assigned to NULL during we created the snapshots, so we didn't free it though we called kfree() in the caller. But since we are sure the

Re: [PATCH 2/2] Btrfs: fix memory leak of pending_snapshot-inherit

2013-02-07 Thread Arne Jansen
On 02/07/13 10:28, Miao Xie wrote: On Thu, 07 Feb 2013 09:43:47 +0100, Arne Jansen wrote: On 02/07/13 07:02, Miao Xie wrote: The argument inherit of btrfs_ioctl_snap_create_transid() was assigned to NULL during we created the snapshots, so we didn't free it though we called kfree() in the

[RFC][PATCH] Btrfs: fix deadlock due to unsubmitted

2013-02-07 Thread Miao Xie
The deadlock problem happened when running fsstress(a test program in LTP). Steps to reproduce: # mkfs.btrfs -b 100M partition # mount partition mnt # Path/fsstress -p 3 -n 1000 -d mnt The reason is: btrfs_direct_IO() |-do_direct_IO() |-get_page() |-get_blocks() |

Re: [RFC][PATCH] Btrfs: fix deadlock due to unsubmitted

2013-02-07 Thread Chris Mason
On Thu, Feb 07, 2013 at 03:12:07AM -0700, Miao Xie wrote: The deadlock problem happened when running fsstress(a test program in LTP). Steps to reproduce: # mkfs.btrfs -b 100M partition # mount partition mnt # Path/fsstress -p 3 -n 1000 -d mnt The reason is: btrfs_direct_IO()

Re: [RFC][PATCH] Btrfs: fix deadlock due to unsubmitted

2013-02-07 Thread Josef Bacik
On Thu, Feb 07, 2013 at 03:12:07AM -0700, Miao Xie wrote: The deadlock problem happened when running fsstress(a test program in LTP). Steps to reproduce: # mkfs.btrfs -b 100M partition # mount partition mnt # Path/fsstress -p 3 -n 1000 -d mnt The reason is: btrfs_direct_IO()

Re: [PATCH 2/2, RFC] btrfs-progs: overhaul mkfs.btrfs -r option

2013-02-07 Thread Eric Sandeen
On 2/6/13 6:08 PM, David Sterba wrote: On Tue, Jan 29, 2013 at 02:41:08PM -0600, Eric Sandeen wrote: The manpage for the -r option simply says that it will copy the path specified to -r into the newly made filesystem. There's not a lot of reason to treat that option as differently as it is

Re: [PATCH 2/2, RFC] btrfs-progs: overhaul mkfs.btrfs -r option

2013-02-07 Thread Chris Mason
On Thu, Feb 07, 2013 at 08:52:43AM -0700, Eric Sandeen wrote: On 2/6/13 6:08 PM, David Sterba wrote: On Tue, Jan 29, 2013 at 02:41:08PM -0600, Eric Sandeen wrote: The manpage for the -r option simply says that it will copy the path specified to -r into the newly made filesystem.

Re: btrfs balance - hang/crash

2013-02-07 Thread Michael Schneider
o.k., I've deleted some files from my btrfs filesystem rebooted the machine and was able to cancel the balance operation thereafter. So far, everything seems to be working again. -Mike On Wed, Feb 6, 2013 at 11:26 PM, Michael Schneider mike2.schnei...@googlemail.com wrote: # btrfs fi show

[PATCH] Btrfs: steal from global reserve if we are cleaning up orphans

2013-02-07 Thread Josef Bacik
Sometimes xfstest 83 will fail to remount the scratch device because we've gotten ourselves so full that we cannot cleanup the orphan items. In this case check to see if we're doing the orphan cleanup and if we are allow us to steal our reservation from the global block rsv. With this patch I've

[PATCH] Btrfs: steal from global reserve if we are cleaning up orphans V2

2013-02-07 Thread Josef Bacik
Sometimes xfstest 83 will fail to remount the scratch device because we've gotten ourselves so full that we cannot cleanup the orphan items. In this case check to see if we're doing the orphan cleanup and if we are allow us to steal our reservation from the global block rsv. With this patch I've

[PATCH] Btrfs: cleanup orphan reservation if truncate fails

2013-02-07 Thread Josef Bacik
I noticed we were getting lots of warnings with xfstest 83 because we have reservations outstanding. This is because we moved the orphan add outside of the truncate, but we don't actually cleanup our reservation if something fails. This fixes the problem and I no longer see warnings. Thanks,

[RFC] Btrfs: Allow the compressed extent size limit to be modified v2

2013-02-07 Thread Mitch Harder
Provide for modification of the limit of compressed extent size utilizing mount-time configuration settings. The size of compressed extents was limited to 128K, which leads to fragmentation of the extents (although the extents themselves may still be located contiguously). This limit is put in

Re: [RFC] Btrfs: Allow the compressed extent size limit to be modified v2

2013-02-07 Thread Zach Brown
On Thu, Feb 07, 2013 at 03:38:34PM -0600, Mitch Harder wrote: Provide for modification of the limit of compressed extent size utilizing mount-time configuration settings. The size of compressed extents was limited to 128K, which leads to fragmentation of the extents (although the extents

Re: [RFC] Btrfs: Allow the compressed extent size limit to be modified v2

2013-02-07 Thread David Sterba
On Thu, Feb 07, 2013 at 03:38:34PM -0600, Mitch Harder wrote: --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -144,7 +144,7 @@ struct tree_block { unsigned int key_ready:1; }; -#define MAX_EXTENTS 128 +#define MAX_EXTENTS 512 Is this really related to compression? IIRC

[PATCH 3/6] Btrfs-progs: move btrfs-select-super.c

2013-02-07 Thread Ian Kumlien
This patch moves btrfs-select-super.c - cmds-rescue-super-ops.c This is done in preparation to merge the select-super functionality to btrfs. The naming is because we will also merge btrfs-dump-super.c from Josef Bacik Signed-off-by: Ian Kumlien po...@demius.net ---

[PATCH 1/6] Btrfs-progs: Rename btrfsck.c - cmds-check.c

2013-02-07 Thread Ian Kumlien
In preparation for merging btrfsck functionality in to btrfs. Signed-off-by: Ian Kumlien po...@demius.net --- btrfsck.c = cmds-check.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename btrfsck.c = cmds-check.c (100%) diff --git a/btrfsck.c b/cmds-check.c similarity index 100% rename

Btrfs-progs: Merge btrfs-restore, btrfsck, btrfs-select-super, btrfs-dump-super and btrfs-debug-tree in to btrfs

2013-02-07 Thread Ian Kumlien
Hi, This patch series moves some of the commands around to reflect that they are now subcommands of btrfs. As a stage in this we also add support for btrfs being called as btrfsck which yeilds the, now(?), starnard btrfs check or fsck.btrfs which is a noop to avoid complications with

[PATCH 4/6] Btrfs-progs: move debug-tree.c - cmds-rescue-debug-tree.c

2013-02-07 Thread Ian Kumlien
The btrfs-debug-tree functionality will be integrated in to btrfs as btrfs rescue debug-tree Signed-off-by: Ian Kumlien po...@demius.net --- debug-tree.c = cmds-rescue-debug-tree.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename debug-tree.c = cmds-rescue-debug-tree.c (100%) diff

[PATCH 6/6] Btrfs-progs: add the rescue section to btrfs

2013-02-07 Thread Ian Kumlien
the btrfs command now lists: btrfs rescue select-super -s number device Select a superblock btrfs rescue dump-super device Dump a superblock to disk btrfs rescue debug-tree [options] device Debug the filesystem btrfs-dump-super.c was imported in to

[PATCH 5/6] Btrfs-progs: restore.c - cmds-restore.c

2013-02-07 Thread Ian Kumlien
The btrfs-restore functionality will be integrated in btrs as btrfs restore Signed-off-by: Ian Kumlien po...@demius.net --- restore.c = cmds-restore.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename restore.c = cmds-restore.c (100%) diff --git a/restore.c b/cmds-restore.c

[PATCH 2/6] Btrfs-progs: add btrfsck functionality to btrfs

2013-02-07 Thread Ian Kumlien
This patch includes the functionality of btrfs, it's found as btrfs check however it makes the binary behave differently depending on what it's run as. btrfsck - will act like normal btrfsck fsck.btrfs - noop Signed-off-by: Ian Kumlien po...@demius.net --- Makefile | 8

Re: [RFC] Btrfs: Allow the compressed extent size limit to be modified v2

2013-02-07 Thread Mitch Harder
On Thu, Feb 7, 2013 at 6:28 PM, David Sterba d...@jikos.cz wrote: On Thu, Feb 07, 2013 at 03:38:34PM -0600, Mitch Harder wrote: --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -144,7 +144,7 @@ struct tree_block { unsigned int key_ready:1; }; -#define MAX_EXTENTS 128

[PATCH] Btrfs: fix the deadlock between the transaction attach and commit

2013-02-07 Thread Miao Xie
Here is the whole story: Trans_Attach_Task Trans_Commit_Task btrfs_commit_transaction() |-wait writers to be 1 btrfs_attach_transaction() | btrfs_commit_transaction()

[PATCH V2 1/2] Btrfs: serialize unlocked dio reads with truncate

2013-02-07 Thread Miao Xie
Currently, we can do unlocked dio reads, but the following race is possible: dio_read_task truncate_task -btrfs_setattr() -btrfs_direct_IO -__blockdev_direct_IO -btrfs_get_block -btrfs_truncate()

[PATCH V2 2/2] Btrfs: implement unlocked dio write

2013-02-07 Thread Miao Xie
This idea is from ext4. By this patch, we can make the dio write parallel, and improve the performance. But because we can not update isize without i_mutex, the unlocked dio write just can be done in front of the EOF. We needn't worry about the race between dio write and truncate, because the