[PATCH 1/3] Btrfs: add sanity checks regarding to parsing mount options

2013-07-22 Thread Wang Shilong
I just notice the following commands succeed: mount -o thread_pool=-1 This is ridiculous, only positive thread_pool makes sense,this patch adds sanity checks for them, and also catches the error of ENOMEM if allocating memory fails. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie ---

[PATCH 2/3] Btrfs: use u64 for subvolid when parsing mount options

2013-07-22 Thread Wang Shilong
Although for most time, int is enough for subvolid, we should ensure safety in theory. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/super.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index cc00295..d8

[PATCH 3/3] Btrfs: add missing mounting options in btrfs_show_options()

2013-07-22 Thread Wang Shilong
Some options are missing in btrfs_show_options(), this patch adds them. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/super.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index d82391d..fa57418 100644 --- a/fs/btrfs/supe

[PATCH 1/2] btrfs-progs: Update the usage strings of some cmds

2013-07-22 Thread Qu Wenruo
Update the usage strings of some cmds to keep the them consistent with the source. Also some minor changes are done to fit the man page syntax. Signed-off-by: Qu Wenruo --- btrfs.c | 2 +- cmds-chunk.c | 2 +- cmds-filesystem.c | 2 +- cmds-inspect.c| 2 ++ cmds-replace.c

[PATCH 2/2] btrfs-progs: Update the man page of btrfs

2013-07-22 Thread Qu Wenruo
Update the man page of "btrfs" command to keep up with new commands. Now the updated btrfs man page should have all the commands, and better description sequence, which is the same with "btrfs --help". Also the paragraph and italic style is unified to improve the readability. Signed-off-by: Qu We

Re: [PATCH] Btrfs: release both paths before logging dir/changed extents

2013-07-22 Thread Miao Xie
On mon, 22 Jul 2013 12:56:00 -0400, Josef Bacik wrote: > The ceph guys tripped over this bug where we were still holding onto the > original path that we used to copy the inode with when logging. This is based > on Chris's fix which was reported to fix the problem. We need to drop the > paths >

Re: [PATCH] Btrfs: reset ret in record_one_backref

2013-07-22 Thread Miao Xie
On mon, 22 Jul 2013 12:52:35 -0400, Josef Bacik wrote: > I was getting warnings when running find ./ -type f -exec btrfs fi defrag -f > {} > \; from record_one_backref because ret was set. Turns out it was because it > was > set to 1 because the search slot didn't come out exact and we never res

[PATCH] vfs: allow /proc/PID/maps to get device from stat

2013-07-22 Thread Mark Fasheh
stat(2) on btrfs returns a custom device, but proc uses s_dev from the super block. This causes problems (abi breakage) because software (and users) are not expecting the kernel to return different devices from these calls. This patch fixes the problem by adding a new superblock flag, MS_STAT_FOR_

[PATCH] Btrfs: reset ret in record_one_backref

2013-07-22 Thread Josef Bacik
I was getting warnings when running find ./ -type f -exec btrfs fi defrag -f {} \; from record_one_backref because ret was set. Turns out it was because it was set to 1 because the search slot didn't come out exact and we never reset it. So reset it to 0 right after the search so we don't leak thi

[PATCH] Btrfs: release both paths before logging dir/changed extents

2013-07-22 Thread Josef Bacik
The ceph guys tripped over this bug where we were still holding onto the original path that we used to copy the inode with when logging. This is based on Chris's fix which was reported to fix the problem. We need to drop the paths in two cases anyway so just move the drop up so that we don't have

Re: [patch] btrfs/raid56: fix and cleanup some error paths

2013-07-22 Thread Dan Carpenter
On Mon, Jul 22, 2013 at 04:47:00PM +0800, Miao Xie wrote: > On mon, 22 Jul 2013 09:55:15 +0300, Dan Carpenter wrote: > > The alloc_rbio() frees "raid_map" and "bbio" on error, so there is a > > potential double free bug in raid56_parity_write(). The > > raid56_parity_write() and raid56_parity_reco

Re: autodefrag by default, was: Lots of harddrive chatter

2013-07-22 Thread Duncan
George Mitchell posted on Sun, 21 Jul 2013 16:44:09 -0700 as excerpted: > But I think the only unanswered question for me at this point is whether > complete defragmentation is even possible using auto-defrag. Unless > auto-defrag can work around the in-use file issue, that could be a > problem s

Re: abysmal rm performance?

2013-07-22 Thread Duncan
Tomasz Chmielewski posted on Mon, 22 Jul 2013 12:22:11 +0700 as excerpted: >> You /really/ need to read up on the btrfs wiki. >> >> The short answer is yes, btrfs does a LOT more metadata processing due >> to the checksumming it does by default. > > According to the wiki, checksumming has barely

Re: [patch] btrfs/raid56: fix and cleanup some error paths

2013-07-22 Thread Miao Xie
On mon, 22 Jul 2013 09:55:15 +0300, Dan Carpenter wrote: > The alloc_rbio() frees "raid_map" and "bbio" on error, so there is a > potential double free bug in raid56_parity_write(). The > raid56_parity_write() and raid56_parity_recover() functions should still > free "raid_map" and "bbio" on error

[PATCH] Btrfs,raid56: fix memory leak when allocating pages for p/q stripes failed

2013-07-22 Thread Miao Xie
Signed-off-by: Miao Xie --- fs/btrfs/raid56.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 0db856c..d0ecfbd 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1540,8 +1540,10 @@ static int full_stripe_write(struct btrfs