Re: [PATCH] Btrfs: merge inode_list in __merge_refs

2012-11-08 Thread Greg KH
On Thu, Nov 08, 2012 at 10:35:19PM +0100, Alexander Block wrote: > > Used wrong CC for stable list. Corrected now. This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly. -- To unsub

Re: How does btrfs handle sudden shutdowns?

2012-11-08 Thread Alex
Michael Kjörling kjorling.se> writes: > > Can btrfs deal reasonably gracefully with sudden shutdowns? (I'm > mainly thinking of power outages which lead to logical structure > damage but not physical media damage.) > Really rather well! We've had a sequence of power-cuts around here and I've s

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-08 Thread Liu Bo
On Thu, Nov 08, 2012 at 06:24:36PM +0100, Stefan Behrens wrote: > On Thu, 8 Nov 2012 22:50:47 +0800, Liu Bo wrote: > > On Tue, Nov 06, 2012 at 05:38:33PM +0100, Stefan Behrens wrote: [...] > >> + btrfs_dev_replace_unlock(dev_replace); > >> + > >> + btrfs_wait_ordered_extents(root, 0); > >> + > >>

Re: [RFC PATCH] Btrfs-progs: disable qgroupid 0 for quota_tree

2012-11-08 Thread Chris Samuel
On 08/11/12 20:55, Miao Xie wrote: > In kernel, qgroupid 0 is a special number when we run the quota group > limit command. > > So, we should not be able to create a quota group whose id is 0, > otherwise the kernel can't deal with it. Fix it. This is probably a stupid question - but if its not

Re: [PATCH] Btrfs: merge inode_list in __merge_refs

2012-11-08 Thread Alexander Block
On Thu, Nov 8, 2012 at 10:27 PM, Alexander Block wrote: > When __merge_refs merges two refs, it is also needed to merge the > inode_list of both refs. Otherwise we have missed backrefs and memory > leaks. This happens for example if two inodes share an extent and > both lie in the same leaf and th

[PATCH] Btrfs: merge inode_list in __merge_refs

2012-11-08 Thread Alexander Block
When __merge_refs merges two refs, it is also needed to merge the inode_list of both refs. Otherwise we have missed backrefs and memory leaks. This happens for example if two inodes share an extent and both lie in the same leaf and thus also have the same parent. Signed-off-by: Alexander Block Re

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-08 Thread Goffredo Baroncelli
On 11/08/2012 06:31 PM, Stefan Behrens wrote: > On Thu, 8 Nov 2012 13:50:19 +0100, Goffredo Baroncelli wrote: [...] >> I think that so "replace" would be the natural extension to the "add" >> and "delete" subcommands. > > "btrfs device replace " > was also my first idea. It used to be like this

Btrfs Slow Down (Metadata Starvation?)

2012-11-08 Thread Mitch Harder
One of my Btrfs partitions ran into a severe slowdown recently. Operations that would normally complete in 20-30 seconds were now requiring hours. There were no errors or warnings in dmesg (Alt-SysRq-W is below, but shows nothing out of the ordinary). And if I took the partition offline, it would

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-08 Thread Stefan Behrens
On Thu, 8 Nov 2012 13:50:19 +0100, Goffredo Baroncelli wrote: > great work. However I have a suggestion: what about putting all the > command under 'device' sub commands: something like: > > - btrfs device replace > > - btrfs device status > > Where "btrfs device status" would show only the

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-08 Thread Stefan Behrens
On Thu, 8 Nov 2012 22:50:47 +0800, Liu Bo wrote: > On Tue, Nov 06, 2012 at 05:38:33PM +0100, Stefan Behrens wrote: >> +out: >> +if (path) { >> +btrfs_release_path(path); >> +btrfs_free_path(path); > > btrfs_free_path(path) will do release for you :) > Right :) Thanks

question about btrfsck/mount behavior on corrupted fs

2012-11-08 Thread Ondrej Kozina
Hi all, I've been playing with btrfs resize recently and run into strange looking behavior to me. One of my simple test scenario was following: - partition some block device (lets say sda sectors 2-2000 are sda1) - try to create btrfs on top of it (just mkfs.btrfs /dev/sda1) - fill the fs with

Re: [PATCH 15/26] Btrfs: add a new source file with device replace code

2012-11-08 Thread Liu Bo
On Tue, Nov 06, 2012 at 05:38:33PM +0100, Stefan Behrens wrote: > This adds a new file to the sources together with the header file > and the changes to ioctl.h that are required by the new C source > file. > > Signed-off-by: Stefan Behrens > --- > fs/btrfs/dev-replace.c | 843 > +++

Re: [PATCH 07/26] Btrfs: add two more find_device() methods

2012-11-08 Thread Liu Bo
On Tue, Nov 06, 2012 at 05:38:25PM +0100, Stefan Behrens wrote: > The new function btrfs_find_device_missing_or_by_path() will be > used for the device replace procedure. This function itself calls > the second new function btrfs_find_device_by_path(). > Unfortunately, it is not possible to current

Re: [PATCH 00/26] Btrfs: Add device replace code

2012-11-08 Thread Goffredo Baroncelli
Hi Stefan, great work. However I have a suggestion: what about putting all the command under 'device' sub commands: something like: - btrfs device replace - btrfs device status Where "btrfs device status" would show only the status of the "replacing" operation; but in the future it could sh

Re: fs/btrfs/dev-replace.c:486:17: sparse: incompatible types in comparison expression (different address spaces)

2012-11-08 Thread Fengguang Wu
> Hi Fengguang, Hi Stefan! > Assuming that your script performs a periodic git fetch and git reset, > and then starts compile runs on different architectures, the only > explanation that I have is that something went wrong with the git > operation in your script. It looks like some C source file

Re: fs/btrfs/dev-replace.c:486:17: sparse: incompatible types in comparison expression (different address spaces)

2012-11-08 Thread Stefan Behrens
On Thu, 8 Nov 2012 15:35:41 +0800, Fengguang Wu wrote: > Hi Stefan, > > FYI, there are new sparse warnings show up in > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git > master > head: c1014be59ba93855c31fda9d9cf4319cc6f9eeb1 > commit: d8e784f51e2e1d1c57f091fdb4945

[RFC PATCH] Btrfs-progs: disable qgroupid 0 for quota_tree

2012-11-08 Thread Miao Xie
From: Wang Shilong In kernel, qgroupid 0 is a special number when we run the quota group limit command. So, we should not be able to create a quota group whose id is 0, otherwise the kernel can't deal with it. Fix it. Signed-off-by: Wang Shilong Signed-off-by: Miao Xie --- cmds-qgroup.c |

[PATCH 3/3] Btrfs-progs: check the relation of two group by real level numbers

2012-11-08 Thread Miao Xie
From: Wang Shilong Comparing qgroupid is not good way to check the relationship of two groups, the right way is to compare the real level numbers. Signed-off-by: Wang Shilong Signed-off-by: Miao Xie --- cmds-qgroup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cm

[PATCH 2/3] Btrfs-progs: clean up reduplicate parse_qgroupid() and replace atoi with strtoull

2012-11-08 Thread Miao Xie
From: Wang Shilong 1. parse_qgroupid() is implemented twice, clean up the reduplicate code. 2. atoi() can not detect errors, so use strtoull() instead of it. Signed-off-by: Wang Shilong Signed-off-by: Miao Xie --- cmds-qgroup.c | 15 +-- qgroup.c | 22 ++--

[PATCH 1/3] Btrfs-progs: fix arg parsing for btrfs qgroup limit commands

2012-11-08 Thread Miao Xie
From: Wang Shilong We can use this command in two ways. 1. btrfs qgroup limit size qgroupid path 2. btrfs qgroup limit size path Before applying this patch, we differentiate them by check the parsing result of the second argument. It is not so good because it may make some mistakes, For example: