[PATCH] xfstests: fix 251's cp -axT problem

2012-01-10 Thread Liu Bo
When I ran xfstests, 251 got failed cause cp -axT did not work as wish: cp: cannot overwrite directory `/mnt/scratch/1' with non-directory With this patch, 251 has passed. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- 251 |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

Broken btrfs filesystem

2012-01-10 Thread Peter Hjalmarsson
Hi, I have problems with a btrfs filesystem, and am holding on to it for some more days before reformat. What I am interested about is two things: 1. Is there any way to restore more stuff from the filesystem then already fetched (it would help to get the system up faster, but nothing really of

Broken btrfs filesystem

2012-01-10 Thread Peter Hjalmarsson
Hi, I have problems with a btrfs filesystem, and am holding on to it for some more days before reformat. What I am interested about is two things: 1. Is there any way to restore more stuff from the filesystem then already fetched (it would help to get the system up faster, but nothing really of

[PATCH V2] Btrfs: cleanup: move node-,leaf-,sectorsize to fs_info

2012-01-10 Thread Peeters Simon
moved the node-,leaf-,sectorsize from btrfs_root to btrfs_fs_info since we don't intend to allow different sizes between trees also removed sectorsize from btrfs_block_group_cache because it now can use the one in fs_info updated all uses accordingly please note in disk-io.c: -static int

real free space on btrfs volume (performance impact)

2012-01-10 Thread Michal Suba
Hello we are currently investigating performance issue on system runing above btrs filesystem. Is it possible, that performance is impacted by lack of free space? Also, how to get info about real free space on btrfs volume? # btrfs-show /dev/sdb1 Label: opt uuid:

[v3.2-4874-ge4e1118 OOPS] btrfs-related kernel oops due to media error

2012-01-10 Thread Vincent Vanackere
[Note : this is a resent of a mail I send to linux-btrfs earlier, this time tested with the lastest git kernel] Hi, One of my disks, partitioned into a single btrfs partition, is showing media errors. The problem is that these errors lead to kernel panic from btrfs - that make the filesystem

Re: [PATCH 00/21] Btrfs: restriper

2012-01-10 Thread Ilya Dryomov
On Mon, Jan 09, 2012 at 03:44:18PM +0200, Ilya Dryomov wrote: On Mon, Jan 09, 2012 at 01:50:34AM -0500, Marios Titas wrote: I tried this for many different scenarios and it seems to work pretty well. I only ran into one problematic case: If you remove a device from a multidevice filesystem

Re: real free space on btrfs volume (performance impact)

2012-01-10 Thread Mitch Harder
2012/1/10 Michal Suba michal.s...@pantheon.sk: Hello  we are currently investigating performance issue on system runing above btrs filesystem. Is it possible, that performance is impacted by lack of free space? Also, how to get info about real free space on btrfs volume? # btrfs-show

Re: real free space on btrfs volume (performance impact)

2012-01-10 Thread cwillu
On Tue, Jan 10, 2012 at 12:40 PM, Mitch Harder mitch.har...@sabayonlinux.org wrote: 2012/1/10 Michal Suba michal.s...@pantheon.sk: Hello  we are currently investigating performance issue on system runing above btrs filesystem. Is it possible, that performance is impacted by lack of free

[PATCH] Btrfs: release space on error in page_mkwrite

2012-01-10 Thread Josef Bacik
If updating the inode gave us an ENOSPC we were just returning in page_mkwrite, which is a problem since we make our reservation right before trying to update the inode, so fix the out label so that we actually free our reservation. Thanks, Signed-off-by: Josef Bacik jo...@redhat.com ---

Re: revert to static snapshot on reboot

2012-01-10 Thread Kai Krakow
Hello! bt...@spiritvideo.com bt...@spiritvideo.com schrieb: The plan that occurs to me is to make a snapshot of the system in the state that I want to always boot. Then, I would rewrite the init script in the initrd to (a) delete any old tmp copy of the snapshot; (b) copy the static

Re: [RFC PATCH v2 1/3] Btrfs: add the Probabilistic Skiplist

2012-01-10 Thread David Sterba
On Tue, Jan 10, 2012 at 03:31:34PM +0800, Liu Bo wrote: +static inline int generate_node_level(u64 randseed) +{ + int level = 0; + + while (randseed !(randseed 3)) { + randseed = 2; + level++; + } + + return (level MAXLEVEL ? MAXLEVEL : level);

Re: [RFC PATCH v2 1/3] Btrfs: add the Probabilistic Skiplist

2012-01-10 Thread Liu Bo
On 01/11/2012 08:37 AM, David Sterba wrote: Hi, a few thoughts and comments below: On Tue, Jan 10, 2012 at 03:31:34PM +0800, Liu Bo wrote: c) The level limit may need to be adjusted. I know it is a magic number, but now for simplicity we just keep it at 16, and then each skiplist is

Re: revert to static snapshot on reboot

2012-01-10 Thread Anand Jain
Upcoming btrfs autosnap feature might help your problem-solution. But the main part in your case which is to replace the root with its snapshot is something beyond the scope of autosnap project. What is being developed is a set of btrfs-prog sub-command to create and manage snapshots

[PATCH 08/11] Btrfs: simplfy calculation of stripe length for discard operation

2012-01-10 Thread Li Zefan
For btrfs raid, while discarding a range of space, we'll need to know the start offset and length to discard for each device, and it's done in btrfs_map_block(). However the calculation is a bit complex for raid0 and raid10, so I reimplement it based on a fact that: dev1 dev2

[PATCH 09/11][RESEND] Btrfs: rewrite btrfs_trim_block_group()

2012-01-10 Thread Li Zefan
There are various bugs in block group trimming: - It may trim from offset smaller than user-specified offset. - It may trim beyond user-specified range. - It may leak free space for extents smaller than specified minlen. - It may truncate the last trimmed extent thus leak free space. - With mixed

[PATCH 10/11] Btrfs: update global block_rsv when creating a new block group

2012-01-10 Thread Li Zefan
A bug was triggered while using seed device: # mkfs.btrfs /dev/loop1 # btrfstune -S 1 /dev/loop1 # mount -o /dev/loop1 /mnt # btrfs dev add /dev/loop2 /mnt btrfs: block rsv returned -28 [ cut here ] WARNING: at fs/btrfs/extent-tree.c:5969

[PATCH 11/11] Btrfs: fix possible deadlock when opening a seed device

2012-01-10 Thread Li Zefan
The correct lock order is uuid_mutex - volume_mutex - chunk_mutex, but when we mount a filesystem which has backing seed devices, we have this lock chain: open_ctree() lock(chunk_mutex); read_chunk_tree(); read_one_dev(); open_seed_devices();

[PATCH 05/11] Btrfs: reserve metadata space in btrfs_ioctl_setflags()

2012-01-10 Thread Li Zefan
Check and reserve space for btrfs_update_inode(). Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9619fb0..fe8a60c 100644 --- a/fs/btrfs/ioctl.c +++

[PATCH 03/11] Btrfs: check the return value of io_ctl_init()

2012-01-10 Thread Li Zefan
It can return -ENOMEM. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/free-space-cache.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 4e55af3..e4eb222 100644 ---

[PATCH 00/11] Btrfs: some patches for 3.3

2012-01-10 Thread Li Zefan
The biggest one is a fix for fstrim, and there's a fix for on-disk free space cache. Others are small fixes and cleanups. The last three have been sent weeks ago. The patchset is also available in this repo: git://repo.or.cz/linux-btrfs-devel.git for-chris Note there's a small confict

[PATCH 02/11] Btrfs: avoid possible NULL deref in io_ctl_drop_pages()

2012-01-10 Thread Li Zefan
If we run into some failure path in io_ctl_prepare_pages(), io_ctl-pages[] array may have some NULL pointers. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/free-space-cache.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/free-space-cache.c

[PATCH 06/11] Btrfs: don't pass a trans handle unnecessarily in volumes.c

2012-01-10 Thread Li Zefan
Some functions never use the transaction handle passed to them. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/extent-tree.c |2 +- fs/btrfs/volumes.c | 18 +++--- fs/btrfs/volumes.h |3 +-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git

[PATCH 01/11] Btrfs: add pinned extents to on-disk free space cache correctly

2012-01-10 Thread Li Zefan
I got this while running xfstests: [24256.836098] block group 317849600 has an wrong amount of free space [24256.836100] btrfs: failed to load free space cache for block group 317849600 We should clamp the extent returned by find_first_extent_bit(), so the start of the extent won't smaller than

[PATCH 07/11] Btrfs: don't pre-allocate btrfs bio

2012-01-10 Thread Li Zefan
We pre-allocate a btrfs bio with fixed size, and then may re-allocate memory if we find stripes are bigger than the fixed size. But this pre-allocation is not necessary. Also we don't have to calcuate the stripe number twice. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/volumes.c |

[PATCH 04/11] Btrfs: remove BUG_ON()s in btrfs_ioctl_setflags()

2012-01-10 Thread Li Zefan
We can recover from errors and return -errno to user space. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/ioctl.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c04f02c..9619fb0 100644 ---