[PATCH V5 07/12] Btrfs: fix corrupted metadata in the snapshot

2012-09-07 Thread Miao Xie
When we delete a inode, we will remove all the delayed items including delayed inode update, and then truncate all the relative metadata. If there is lots of metadata, we will end the current transaction, and start a new transaction to truncate the left metadata. In this way, we will leave a inode

[PATCH] btrfs: polish names of kmem caches

2012-09-07 Thread David Sterba
Usecase: watch 'grep btrfs /proc/slabinfo' easy to watch all caches in one go. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/delayed-inode.c |2 +- fs/btrfs/extent_io.c |4 ++-- fs/btrfs/extent_map.c|2 +- fs/btrfs/inode.c | 10 +- 4 files

[RFC inside][PATCH] btrfs: allow setting NOCOW for a zero sized file via ioctl

2012-09-07 Thread David Sterba
Hi, the patch si simple, but it has user visible impact and I'm not quite sure how to resolve it. In short, $subj says it, chattr -C supports it and we want to use it. The conditions that acutally allow to change the NOCOW flag are clear. What if I try to set the flag on a file that is not

[PATCH] btrfs-progs: pretty print key in extent_item

2012-09-07 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- print-tree.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/print-tree.c b/print-tree.c index 89fc5b4..7c615dd 100644 --- a/print-tree.c +++ b/print-tree.c @@ -205,11 +205,9 @@ static void print_extent_item(struct

Cannot create subvolume with quota enabled

2012-09-07 Thread Andreas Philipp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git master. thor ~ # mkfs.btrfs -L test

[PATCH] Btrfs: btrfs_qgroup_inherit wrongly returns an error

2012-09-07 Thread Arne Jansen
When using the V1-version of the snap/subvol creation ioctl btrfs_qgroup_inherit wrongly returns an error because no inherit parameter is given. Fix the return value. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/qgroup.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)

Re: Cannot create subvolume with quota enabled

2012-09-07 Thread Arne Jansen
Hi Andreas, On 09/07/2012 09:36 PM, Andreas Philipp wrote: Hi, The following steps reproduce the error. My kernel is 3.6-rc4 and btrfs-progs are at commit 89fe5b5f666c247aa3173745fb87c710f3a71a4a from git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git master. thor

[PATCH v2 1/6] Btrfs: fix a bug of per-file nocow

2012-09-07 Thread Liu Bo
Users report a bug, the reproducer is: $ mkfs.btrfs /dev/loop0 $ mount /dev/loop0 /mnt/btrfs/ $ mkdir /mnt/btrfs/dir $ chattr +C /mnt/btrfs/dir/ $ dd if=/dev/zero of=/mnt/btrfs/dir/foo bs=4K count=10; $ lsattr /mnt/btrfs/dir/foo ---C- /mnt/btrfs/dir/foo $ filefrag /mnt/btrfs/dir/foo

[PATCH v2 2/6] Btrfs: cleanup for unused ref cache stuff

2012-09-07 Thread Liu Bo
From: liubo liubo2...@cn.fujitsu.com As ref cache has been removed from btrfs, there is no user on its lock and its check. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.h |3 --- fs/btrfs/disk-io.c |5 - 2 files

[PATCH v2 3/6] Btrfs: update delayed ref's tracepoints to show sequence

2012-09-07 Thread Liu Bo
We've added a new field 'sequence' to delayed ref node, so update related tracepoints. Signed-off-by: Liu Bo bo.li@oracle.com --- include/trace/events/btrfs.h | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/trace/events/btrfs.h

[PATCH v2 5/6] Btrfs: use helper for logical resolve

2012-09-07 Thread Liu Bo
We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index

[PATCH v2 6/6] Btrfs: use larger limit for translation of logical to inode

2012-09-07 Thread Liu Bo
This is the change of the kernel side. Translation of logical to inode used to have an upper limit 4k on inode container's size, but the limit is not large enough for a data with a great many of refs, so when resolving logical address, we can end up with ioctl ret=0, bytes_left=0,