Re: [PATCH v3] btrfs-progs: Add minimum device size check.

2014-07-04 Thread Qu Wenruo
I'm very sorry that even v3 version patch screws up the mkfs.btrfs. The problem is that the variant 'file' is reused later in add device. I'll send the v4 verion of the patch. I'm very sorry for the problem and extra effort to merge it. Qu. Original Message Subject: [PATCH v3]

[PATCH v4] btrfs-progs: Add minimum device size check

2014-07-04 Thread Qu Wenruo
Btrfs has global block reservation, so even mkfs.btrfs can execute without problem, there is still a possibility that the filesystem can't be mounted. For example when mkfs.btrfs on a 8M file on x86_64 platform, kernel will refuse to mount due to ENOSPC, since system block group takes 4M and mixed

Re: [PATCH V4 1/9] Btrfs: device_list_add() should not update list when mounted

2014-07-04 Thread Satoru Takeuchi
Hi Miao, Anand, (2014/07/03 19:22), Miao Xie wrote: > From: Anand Jain > > device_list_add() is called when user runs btrfs dev scan, which would add > any btrfs device into the btrfs_fs_devices list. Reviewed-by: Satoru Takeuchi Thanks, Satoru > > Now think of a mounted btrfs. And a new de

[PATCH 2/2] btrfs-progs: Add mount point check for 'btrfs fi df' command

2014-07-04 Thread Qu Wenruo
'btrfs fi df' command is currently able to be executed on any file/dir inside btrfs since it uses btrfs ioctl to get disk usage info. However it is somewhat confusing for some end users since normally such command should only be executed on a mount point. This patch add mount point check in 'btrf

[PATCH 1/2] btrfs-progs: Check fstype in find_mount_root()

2014-07-04 Thread Qu Wenruo
When calling find_mount_root(), caller in fact wants to find the mount point of *BTRFS*. So also check ent->fstype in find_mount_root() and output proper error messages if needed. This will suppress a lot of "Inapproiate ioctl for device" error message. Signed-off-by: Qu Wenruo --- utils.c | 11

[PATCH] Btrfs: print btrfs specific info for some fatal error cases

2014-07-04 Thread Wang Shilong
Marc argued that if there are several btrfs filesystems mounted, while users even don't know which filesystem hit the corrupted errors something like generation verification failure. Since @extent_buffer structure has a member @fs_info, let's output btrfs device info. Reported-by: Marc MERLIN Si

Re: [PATCH 1/2] btrfs: fix null pointer dereference in clone_fs_devices when name is null

2014-07-04 Thread Anand Jain
Miao, Chris, I appreciate your review comments, Miao. I am sorry for the delay, was stuck on this issue for a long time. more below. On 02/07/2014 10:38, Miao Xie wrote: On Mon, 30 Jun 2014 23:06:54 +0800, Anand Jain wrote: The primary reason of this problem is that we didn't scan the syste

Re: [PATCH 1/2] btrfs: fix null pointer dereference in clone_fs_devices when name is null

2014-07-04 Thread Anand Jain
(now used correct email id for Chris) On 04/07/2014 19:21, Anand Jain wrote: Miao, Chris, I appreciate your review comments, Miao. I am sorry for the delay, was stuck on this issue for a long time. more below. On 02/07/2014 10:38, Miao Xie wrote: On Mon, 30 Jun 2014 23:06:54 +0800, Anand Jai

Re: [PATCH 1/2] btrfs-progs: add ask_user confirmation for btrfstune clear seeding flag

2014-07-04 Thread David Sterba
On Fri, Jul 04, 2014 at 09:59:13AM +0800, Gui Hecheng wrote: > > > --- a/btrfstune.c > > > +++ b/btrfstune.c > > > @@ -103,6 +104,7 @@ static void print_usage(void) > > > fprintf(stderr, "\t-S value\tpositive value will enable seeding, zero > > > to disable, negative is not allowed\n"); > > >

More candidates for 3.14 longterm fixes?

2014-07-04 Thread Holger Hoffstätte
Hi, As Greg announced that 3.14 will be longterm I was wondering if we can find a few more candidates for backported fixes. So far I've had a couple handpicked and in (admittedly light) use without problems, which apply cleanly to 3.14.10. Can we/should we find more? My candidates so far: Fi

Re: [PATCH 2/2] btrfs-progs: Add mount point check for 'btrfs fi df' command

2014-07-04 Thread David Sterba
On Fri, Jul 04, 2014 at 04:38:49PM +0800, Qu Wenruo wrote: > 'btrfs fi df' command is currently able to be executed on any file/dir > inside btrfs since it uses btrfs ioctl to get disk usage info. > > However it is somewhat confusing for some end users since normally such > command should only be

Re: 3.15.1: kernel BUG at fs/btrfs/locking.c:269

2014-07-04 Thread Marc MERLIN
On Fri, Jul 04, 2014 at 02:12:36PM +0800, Wang Shilong wrote: > OK, i found there is a mirror num recorded in struct > @extent_buffer, so it is not diffcult > to locate the real physical address that this corrupt metadata block > locates. > > But another question is that if such problems happen,

Re: [PATCH v4] btrfs-progs: Add minimum device size check

2014-07-04 Thread David Sterba
On Fri, Jul 04, 2014 at 03:29:17PM +0800, Qu Wenruo wrote: > v4: Fix a variant reuse bug which causes mkfs.btrfs use wrong first device. Can you please send this incremental change only? The v3 patch is deep in the v3.15.x branch that's supposed to comprise patches for the 3.15 release. The diff b

Re: Is btrfs related to OOM death problems on my 8GB server with both 3.15.1 and 3.14?

2014-07-04 Thread Marc MERLIN
Thank you for your answer. I'll put the conclusion and question at the top for easier reading: So, should I understand that 1) I have enough RAM in my system but all of it disappears, apparently claimed by the kernel and not released 2) this could be a kernel memory leak in btrfs or somewhere

[GIT PULL] Btrfs

2014-07-04 Thread Chris Mason
Hi Linus, We've queued up a few fixes in my for-linus branch, please pull: git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus Anand Jain (7) commits (+68/-10): btrfs: fix null pointer dereference in btrfs_show_devname when name is null (+2/-0) btrfs: fix null

Re: Is btrfs related to OOM death problems on my 8GB server with both 3.15.1 and 3.14?

2014-07-04 Thread Russell Coker
On Fri, 4 Jul 2014 07:24:16 Marc MERLIN wrote: > On Fri, Jul 04, 2014 at 03:23:41PM +0900, Satoru Takeuchi wrote: > > >Is there any correlation between such problems and BTRFS operations such > > >as > > >creating snapshots or running a scrub/balance? > > > > Were you running scrub, Marc? > > Yes

A question about subvolumes

2014-07-04 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a disc formatted as btrfs, on which is mounted /home. /home/bob is a regular directory. /home/bob/Documents is a btrfs subvolume /home is btrfs root If I do # mv /home/bob /home/bob_original # btrfs subvolume create /home/bob # mv /home/bob

Re: Is btrfs related to OOM death problems on my 8GB server with both 3.15.1 and 3.14?

2014-07-04 Thread Marc MERLIN
On Sat, Jul 05, 2014 at 12:45:55AM +1000, Russell Coker wrote: > > But the last times I had this OOM problem with 3.15.1 it was happening > > within 6 hours sometimes, and I was not starting scrub every time the > > system booted, so scrub may be partially responsible but it's not the > > core prob

Re: [PATCH v4] btrfs-progs: Add minimum device size check

2014-07-04 Thread David Sterba
On Fri, Jul 04, 2014 at 04:17:46PM +0200, David Sterba wrote: > On Fri, Jul 04, 2014 at 03:29:17PM +0800, Qu Wenruo wrote: > > v4: Fix a variant reuse bug which causes mkfs.btrfs use wrong first device. > > Can you please send this incremental change only? The v3 patch is deep > in the v3.15.x bra

btrfs partition remounted read-only

2014-07-04 Thread Konstantin Svist
I have an overnight cron job with /sbin/fstrim -v / /bin/bedup dedup --defrag Every once in a while, it causes the FS to be remounted read-only. Problem is pretty intermittent so far (aside from a few kernel revisions a while ago). Please advise. Corresponding bugs: https://bugzilla.kernel.org

Re: [RFC PATCH] Revert "btrfs: allow mounting btrfs subvolumes with different ro/rw options"

2014-07-04 Thread Goffredo Baroncelli
Hi Qu On 07/04/2014 03:28 AM, Qu Wenruo wrote: > > Original Message Subject: Re: [RFC PATCH] Revert > "btrfs: allow mounting btrfs subvolumes with different ro/rw > options" From: Goffredo Baroncelli To: Qu Wenruo > , linux-btrfs@vger.kernel.org Date: 2014年07月 > 04日 01:37 >> On

[PATCH 1/1] btrfs: use PTR_ERR_OR_ZERO

2014-07-04 Thread Fabian Frederick
replace IS_ERR/PTR_ERR Cc: Chris Mason Cc: Josef Bacik Cc: linux-btrfs@vger.kernel.org Signed-off-by: Fabian Frederick --- fs/btrfs/hash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c index 85889aa..64f15bb 100644 --- a/fs/btrfs/hash.

btrfs_qgroup_create unused parameter

2014-07-04 Thread Kevin Brandstatter
|The code is pasted below for convenience of reference, but in the function to create a qgruop, it taks a 4th parameter (char * name). I assume this is the name of the path to limit, however, i don't see where its used anywhere in the function. -Kevin Brandstatter int btrfs_create_qgroup(struc

Re: A question about subvolumes

2014-07-04 Thread Goffredo Baroncelli
On 07/04/2014 04:38 PM, Bob Williams wrote: > I have a disc formatted as btrfs, on which is mounted /home. > > /home/bob is a regular directory. > > /home/bob/Documents is a btrfs subvolume > > /home is btrfs root > > If I do > > # mv /home/bob /home/bob_original > # btrfs subvolume create /ho

Re: A question about subvolumes

2014-07-04 Thread Bob Williams
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/07/14 21:38, Goffredo Baroncelli wrote: > On 07/04/2014 04:38 PM, Bob Williams wrote: >> I have a disc formatted as btrfs, on which is mounted /home. >> >> /home/bob is a regular directory. >> >> /home/bob/Documents is a btrfs subvolume >> >>

qgroup destroy / assign

2014-07-04 Thread Kevin Brandstatter
how are qgroups accounted for? Are they specifially tied to one subvolume on creation? If so, is it possible to auto delete relavant qgroups on deletion of the subvolume? also, how exactly does qgroup assign work? I havent been able to get it to work at all. in btrfsprogs cmds-cgroup.c if ((args.s

Re: [PATCH 2/2] btrfs-progs: Add mount point check for 'btrfs fi df' command

2014-07-04 Thread Duncan
David Sterba posted on Fri, 04 Jul 2014 15:52:26 +0200 as excerpted: > I disagree here, it's much more convenient to run 'fi df' anywhere and > get the output. The system 'df' command works the same way. Agreed. I believe the proposed patch (at least based on its commit comment), however, simpl

Re: Is btrfs related to OOM death problems on my 8GB server with both 3.15.1 and 3.14?

2014-07-04 Thread Duncan
Marc MERLIN posted on Fri, 04 Jul 2014 07:24:16 -0700 as excerpted: > So, should I understand that 1) I have enough RAM in my system but all > of it disappears, apparently >claimed by the kernel and not released > > 2) this could be a kernel memory leak in btrfs or somewhere else, there >

Re: btrfs_qgroup_create unused parameter

2014-07-04 Thread Wang Shilong
Hi I think you are right, @name here is unneeded.. You can give a patch for that.^_^ Wang > |The code is pasted below for convenience of reference, but in the function > to > create a qgruop, it taks a 4th parameter (char * name). I assume this is the > name > of the path to limit, however,

[PATCH] btrfs: Remove unused parameter "name" from btrfs_qgroup_create

2014-07-04 Thread Kevin Brandstatter
in btrfs_qgruop_create a fourth parameter "name" exists. however this parameter is not used anywhere in the function the only other place this function is called is ioctl and the call passes NULL as the name paremeter which would seem to indicate its lack of necessity. Signed-off-by: Kevin Brandst

Re: A question about subvolumes

2014-07-04 Thread Goffredo Baroncelli
On 07/04/2014 11:06 PM, Bob Williams wrote: > On 04/07/14 21:38, Goffredo Baroncelli wrote: > > Thank you, Goffredo. As the current /home/bob is not a subvolume, but > a regular linux directory/folder, will the "cp --reflink" still carry > the same speed advantage? > > In other words, using your