[report] NULL dereference in __update_reloc_root()

2012-06-22 Thread Dan Carpenter
Hello Btrfs devs, The patch 5d4f98a28c7d: Btrfs: Mixed back reference (FORWARD ROLLING FORMAT CHANGE) from Jun 10, 2009, leads to the following warning: fs/btrfs/relocation.c:1270 __update_reloc_root() error: potential NULL dereference 'node'. fs/btrfs/relocation.c 1255 static int

[patch] Btrfs: dereferencing free'd memory in panic message

2012-06-22 Thread Dan Carpenter
We free node and then dereference it in the panic message on the next line. I considered moving the kfree() after the panic given that panic can return under certain configurations, but in the end I decided it doesn't matter if we leak a bit after a panic. Signed-off-by: Dan Carpenter

System Policy for Filenames

2012-06-22 Thread Aaron Peterson
Hello btrfs group: I would like to make a system policy that restricts the characters used in a filename, tests filenames by regular expression, and enforces case-insensitive-compatible exclusivity. Where should I start? I am trying to solve a few problems for my catproof Linux project. *

Re: [RFC] A way to tell if all the devices in a file system are available

2012-06-22 Thread Harald Hoyer
On 06/21/2012 10:10 PM, Josef Bacik wrote: Harald Hoyer has had this as a feature request for ages and I've finally gotten around to hacking something up. This is probably going to get bikeshedded to death, bring it on, I'm not married to any of the behaviors in these patches, I just want

Debian RT kernel

2012-06-22 Thread Alex
Note to self: if wanting to test btrfsck and give self a scare don't introduce the RT version of the same kernel into a (working perfectly) but not backed-up-to-the-minute btrfs install. Thanks. That is all. In other news, KVM on btrfs: I'm finding the guests a little slow now I have two guests

Deadlock in ctree.c?

2012-06-22 Thread Jan Schmidt
While debugging my tree mod log, after several hours of successful iteration I finally reached a dead lock. I got stacks with btrfs_next_leaf and push_leaf_left and looked into those. If I'm not mistaken, there is at least one deadlock situation between those two (I'm currently thinking about a

[PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread David Sterba
Hi Chris, please consider this patch for 3.5-rc before it goes final. Thanks. From: David Sterba dste...@suse.cz Commit c11d2c236cc260b36 (Btrfs: add ioctl to get and reset the device stats) introduced two ioctls doing almost the same thing distinguished by just the ioctl number which encodes

Re: [patch] Btrfs: dereferencing free'd memory in panic message

2012-06-22 Thread Josef Bacik
On 06/22/2012 03:14 AM, Dan Carpenter wrote: We free node and then dereference it in the panic message on the next line. I considered moving the kfree() after the panic given that panic can return under certain configurations, but in the end I decided it doesn't matter if we leak a bit after a

Re: Deadlock in ctree.c?

2012-06-22 Thread Josef Bacik
On 06/22/2012 07:00 AM, Jan Schmidt wrote: While debugging my tree mod log, after several hours of successful iteration I finally reached a dead lock. I got stacks with btrfs_next_leaf and push_leaf_left and looked into those. If I'm not mistaken, there is at least one deadlock situation

Re: [patch] Btrfs: dereferencing free'd memory in panic message

2012-06-22 Thread Dan Carpenter
On Fri, Jun 22, 2012 at 09:09:04AM -0400, Josef Bacik wrote: On 06/22/2012 03:14 AM, Dan Carpenter wrote: We free node and then dereference it in the panic message on the next line. I considered moving the kfree() after the panic given that panic can return under certain configurations, but

Re: [patch] Btrfs: dereferencing free'd memory in panic message

2012-06-22 Thread Josef Bacik
On 06/22/2012 09:30 AM, Dan Carpenter wrote: On Fri, Jun 22, 2012 at 09:09:04AM -0400, Josef Bacik wrote: On 06/22/2012 03:14 AM, Dan Carpenter wrote: We free node and then dereference it in the panic message on the next line. I considered moving the kfree() after the panic given that panic

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Josef Bacik
On 06/22/2012 08:30 AM, David Sterba wrote: Hi Chris, please consider this patch for 3.5-rc before it goes final. Thanks. From: David Sterba dste...@suse.cz Commit c11d2c236cc260b36 (Btrfs: add ioctl to get and reset the device stats) introduced two ioctls doing almost the same thing

Re: Deadlock in ctree.c?

2012-06-22 Thread Jan Schmidt
On Fri, June 22, 2012 at 15:30 (+0200), Josef Bacik wrote: On 06/22/2012 07:00 AM, Jan Schmidt wrote: While debugging my tree mod log, after several hours of successful iteration I finally reached a dead lock. I got stacks with btrfs_next_leaf and push_leaf_left and looked into those. If

Re: Deadlock in ctree.c?

2012-06-22 Thread Josef Bacik
On 06/22/2012 09:38 AM, Jan Schmidt wrote: On Fri, June 22, 2012 at 15:30 (+0200), Josef Bacik wrote: On 06/22/2012 07:00 AM, Jan Schmidt wrote: While debugging my tree mod log, after several hours of successful iteration I finally reached a dead lock. I got stacks with btrfs_next_leaf and

Re: Deadlock in ctree.c?

2012-06-22 Thread Jan Schmidt
On Fri, June 22, 2012 at 16:23 (+0200), Josef Bacik wrote: On 06/22/2012 09:38 AM, Jan Schmidt wrote: On Fri, June 22, 2012 at 15:30 (+0200), Josef Bacik wrote: l2 shouldn't be locked anymore, if we're in push_leaf_left it's because we cow'ed l2 and are holding a lock on it, so really it has a

[PATCH] Btrfs: flush delayed inodes if we're short on space V2

2012-06-22 Thread Josef Bacik
Those crazy gentoo guys have been complaining about ENOSPC errors on their portage volumes. This is because doing things like untar tends to create lots of new files which will soak up all the reservation space in the delayed inodes. Usually this gets papered over by the fact that we will try

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Stefan Behrens
On Fri, 22 Jun 2012 14:30:39 +0200, David Sterba wrote: Hi Chris, please consider this patch for 3.5-rc before it goes final. Thanks. From: David Sterba dste...@suse.cz Commit c11d2c236cc260b36 (Btrfs: add ioctl to get and reset the device stats) introduced two ioctls doing almost the

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread David Sterba
On Fri, Jun 22, 2012 at 06:26:44PM +0200, Stefan Behrens wrote: I still do not understand your reason and the benefit of your change. The reset command and the read command are two completely different operations. Therefore I assigned two different ioctl commands. Then you can use strace to

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Josef Bacik
On 06/22/2012 12:26 PM, Stefan Behrens wrote: On Fri, 22 Jun 2012 14:30:39 +0200, David Sterba wrote: Hi Chris, please consider this patch for 3.5-rc before it goes final. Thanks. From: David Sterba dste...@suse.cz Commit c11d2c236cc260b36 (Btrfs: add ioctl to get and reset the device stats)

Re: [PATCH] Btrfs-progs: add btrfs device ready command

2012-06-22 Thread Goffredo Baroncelli
On 06/21/2012 10:10 PM, Josef Bacik wrote: This command will be used by things like dracut that wish to know very simply if all of the devices have been added to the kernel cache yet for the device to be fully mounted. This keeps initrd's from constantly having to try to mount the file system

Re: [PATCH] btrfs: join DEV_STATS ioctls to one

2012-06-22 Thread Stefan Behrens
On 06/22/2012 19:02 +0200, David Sterba wrote: On Fri, Jun 22, 2012 at 06:26:44PM +0200, Stefan Behrens wrote: I still do not understand your reason and the benefit of your change. The reset command and the read command are two completely different operations. Therefore I assigned two different

Re: [PATCH] Btrfs: add DEVICE_READY ioctl

2012-06-22 Thread Goffredo Baroncelli
On 06/21/2012 10:10 PM, Josef Bacik wrote: This will be used in conjunction with btrfs device ready dev. This is needed for initrd's to have a nice and lightweight way to tell if all of the devices needed for a file system are in the cache currently. This keeps them from having to do

[PATCH] Btrfs: do not return EINVAL instead of ENOMEM from open_ctree()

2012-06-22 Thread Ilya Dryomov
When bailing from open_ctree() err is returned, not ret. Signed-off-by: Ilya Dryomov idryo...@gmail.com --- fs/btrfs/disk-io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index e1890b1..f06db81 100644 --- a/fs/btrfs/disk-io.c

[PATCH] Btrfs: do not ignore errors from btrfs_cleanup_fs_roots() when mounting

2012-06-22 Thread Ilya Dryomov
There used to be a BUG_ON(ret) there before EH patch (79787eaa) went in. Bail out with EINVAL. Cc: David Sterba dste...@suse.cz Signed-off-by: Ilya Dryomov idryo...@gmail.com --- fs/btrfs/disk-io.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c

[PATCH 2/2] Btrfs: resume balance on rw (re)mounts properly

2012-06-22 Thread Ilya Dryomov
This introduces btrfs_resume_balance_async(), which, given that restriper state was recovered earlier by btrfs_recover_balance(), resumes balance in btrfs-balance kthread. Signed-off-by: Ilya Dryomov idryo...@gmail.com --- fs/btrfs/disk-io.c | 24 +++- fs/btrfs/super.c |

[PATCH 1/2] Btrfs: restore restriper state on all mounts

2012-06-22 Thread Ilya Dryomov
Fix a bug that triggered asserts in btrfs_balance() in both normal and resume modes -- restriper state was not properly restored on read-only mounts. This factors out resuming code from btrfs_restore_balance(), which is now also called earlier in the mount sequence to avoid the problem of some

[PATCH 0/2] Restriper restore bugfix

2012-06-22 Thread Ilya Dryomov
This fixes restriper restore bug which triggered asserts for users with interrupted balances on rootfs btrfs. Thanks, Ilya Ilya Dryomov (2): Btrfs: restore restriper state on all mounts Btrfs: resume balance on rw (re)mounts properly fs/btrfs/disk-io.c | 39

Re: [PATCH] Btrfs: flush delayed inodes if we're short on space V2

2012-06-22 Thread Miao Xie
On fri, 22 Jun 2012 11:26:01 -0400, Josef Bacik wrote: diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4b5a1e1..4053e3e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3727,6 +3727,62 @@ commit: return btrfs_commit_transaction(trans, root); }