[PATCH] Btrfs: pass the correct root to lookup_free_space_inode()

2011-10-02 Thread Ilya Dryomov
Free space items are located in tree of tree roots, not in the extent tree. It didn't pop up because lookup_free_space_inode() grabs the inode all the time instead of actually searching the tree. Signed-off-by: Ilya Dryomov --- fs/btrfs/extent-tree.c |2 +- 1 files changed, 1 inser

Re: [PATCH 07/21] Btrfs: add basic infrastructure for selective balancing

2011-09-27 Thread Ilya Dryomov
On Tue, Sep 27, 2011 at 03:02:41PM +0200, David Sterba wrote: > On Tue, Aug 23, 2011 at 11:01:48PM +0300, Ilya Dryomov wrote: > > This allows to have a separate set of filters for each chunk type > > (data,meta,sys). The code however is generic and switch on chunk type > &

Re: Problems with set-default, home subvolume and snapshot

2011-09-05 Thread Ilya Dryomov
On Mon, Sep 05, 2011 at 11:30:33AM +0100, Hugo Mills wrote: > On Mon, Sep 05, 2011 at 12:13:25PM +0200, Björn Kalkbrenner wrote: > > 2. why can't i do "mount -o subvolume=home /dev/mapper/root /home" > > anymore? To be more exact, i can, but why is it empty and why is it > > working when i enter th

Re: Snapshot of root makes an undeletable folder

2011-09-04 Thread Ilya Dryomov
On Sun, Sep 04, 2011 at 11:29:43AM -0400, Jérôme Poulin wrote: > I recently converted a long-used ext4 filesystem after e2fsck to btrfs > using btrfs-convert, everything went fine and all my files are there. > I then decided to make the filesystem more managable so I made a > snapshot of the root a

Re: [BUG] umount command doesn't end forever

2011-09-02 Thread Ilya Dryomov
On Fri, Sep 02, 2011 at 05:33:57PM +0900, Tsutomu Itoh wrote: > In current for-linus branch, I encountered the problem that the > umount command doesn't end forever. (snipped) > umount acquires down_write(&s->s_umount) by deactivate_super() and > waits for the end of btrfs-cleaner. > But, btrfs-c

[PATCH] Btrfs-progs: add restriper commands

2011-08-23 Thread Ilya Dryomov
Signed-off-by: Ilya Dryomov --- btrfs.c | 25 +++- btrfs_cmds.c | 508 +- btrfs_cmds.h |5 + ctree.h |9 + ioctl.h | 44 + print-tree.c |3 + volumes.h| 42 + 7 files changed, 632 insertions

[PATCH] [RFC] Btrfs-progs: restriper interface

2011-08-23 Thread Ilya Dryomov
pe resume Any suggestions on the interface are welcome. Patch is on top of tmp branch of cmason's repo, available at: git://github.com/idryomov/btrfs-progs.git restriper-rfc Thanks, Ilya Ilya Dryomov (1): Btrfs-progs: add restriper commands btrfs.c | 25 +++- btrfs_

[PATCH 21/21] Btrfs: add restripe progress reporting

2011-08-23 Thread Ilya Dryomov
Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c | 45 + fs/btrfs/ioctl.h |2 ++ fs/btrfs/volumes.c | 40 ++-- fs/btrfs/volumes.h |3 +++ 4 files changed, 84 insertions(+), 6 deletions(-) diff --git

[PATCH 20/21] Btrfs: get rid of btrfs_balance() function

2011-08-23 Thread Ilya Dryomov
Remove btrfs_balance(). The old balancing ioctl now uses restriper infrastructure, just w/o using any filters. Signed-off-by: Ilya Dryomov --- fs/btrfs/ioctl.c | 38 +- fs/btrfs/volumes.c | 115 --- fs/btrfs/volumes.h |1

[PATCH 19/21] Btrfs: add skip_restripe mount option

2011-08-23 Thread Ilya Dryomov
Since restriper kthread starts involuntarily on mount and can suck cpu and memory bandwidth add a mount option to forcefully skip it. The restriper in that case hangs around in paused state and can be resumed from userspace when it's convenient. Signed-off-by: Ilya Dryomov --- fs/btrfs/ct

[PATCH 18/21] Btrfs: allow for resuming restriper after it was paused

2011-08-23 Thread Ilya Dryomov
Implement an ioctl for resuming restriper. We use the same heuristics used when recovering restripe after a crash to try to start where we left off last time. If needed those parameters can be made configurable through the userspace "resume" command in future. Signed-off-by: Il

[PATCH 17/21] Btrfs: allow for pausing restriper

2011-08-23 Thread Ilya Dryomov
llocations with the target profile. Add a hook to close_ctree() to be able to pause restriper and free it's data structures on unmount. (It's safe to unmount when restriper is in 'paused' state, we will resume with the same parameters on the next mount) Signed-off-by: Ilya Dr

[PATCH 16/21] Btrfs: allow for cancelling restriper

2011-08-23 Thread Ilya Dryomov
Implement an ioctl for cancelling restriper. Currently we wait until relocation of the current block group is finished, in future this can be done by triggering a commit. Restripe item is deleted and no memory about the interrupted restripe is kept. Signed-off-by: Ilya Dryomov --- fs/btrfs

[PATCH 15/21] Btrfs: recover restripe on mount

2011-08-23 Thread Ilya Dryomov
usage filter and relocate only less-than-90%-full chunks of that type. These are just heuristics but they help quite a bit, and can be improved in future. Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c |3 + fs/btrfs/ioctl.c |2 +- fs/btrfs/volumes.c | 125

[PATCH 14/21] Btrfs: save restripe parameters to disk

2011-08-23 Thread Ilya Dryomov
] Older kernels simply ignore it so it's safe to mount with an older kernel and then go back to the newer one. Signed-off-by: Ilya Dryomov --- fs/btrfs/ctree.h | 127 +++- fs/btrfs/volumes.c | 105 +

[PATCH 13/21] Btrfs: virtual address space subset filter

2011-08-23 Thread Ilya Dryomov
Select chunks which have at least one byte located inside a given [vstart, vend) virtual address space range. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 20 fs/btrfs/volumes.h |3 ++- 2 files changed, 22 insertions(+), 1 deletions(-) diff --git a/fs/btrfs

[PATCH 12/21] Btrfs: devid subset filter

2011-08-23 Thread Ilya Dryomov
Select chunks which have at least one byte of at least one stripe located on a device with devid X in a given [pstart,pend) physical address range. This filter only works when devid filter is turned on. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 45

[PATCH 11/21] Btrfs: devid filter

2011-08-23 Thread Ilya Dryomov
Relocate chunks which have at least one stripe located on a device with devid X. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 23 +++ fs/btrfs/volumes.h |1 + 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs

[PATCH 10/21] Btrfs: usage filter

2011-08-23 Thread Ilya Dryomov
Select chunks that are less than X percent full. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 33 + fs/btrfs/volumes.h |1 + 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f045615

[PATCH 09/21] Btrfs: profiles filter

2011-08-23 Thread Ilya Dryomov
Select chunks based on a given profile mask. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 20 fs/btrfs/volumes.h |5 + 2 files changed, 25 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ff252ef..f045615 100644

[PATCH 08/21] Btrfs: soft profile changing mode (aka soft convert)

2011-08-23 Thread Ilya Dryomov
nvert for example meta chunks the "hard" way while converting data chunks selectively with soft switch. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 26 ++ fs/btrfs/volumes.h |5 - 2 files changed, 30 insertions(+), 1 deletions(-) diff -

[PATCH 07/21] Btrfs: add basic infrastructure for selective balancing

2011-08-23 Thread Ilya Dryomov
This allows to have a separate set of filters for each chunk type (data,meta,sys). The code however is generic and switch on chunk type is only done once. This commit also adds a type filter: it allows to balance for example meta and system chunks w/o touching data ones. Signed-off-by: Ilya

[PATCH 05/21] Btrfs: add basic restriper infrastructure

2011-08-23 Thread Ilya Dryomov
olume operations when restriper is running. (previously this restriction relied on volume_mutex being held during the execution of any volume operation) Signed-off-by: Ilya Dryomov --- fs/btrfs/ctree.h |5 + fs/btrfs/disk-io.c |4 + fs/btrfs/ioctl.c | 107 ++ fs/

[PATCH 06/21] Btrfs: implement online profile changing

2011-08-23 Thread Ilya Dryomov
k to plain reducing. Signed-off-by: Ilya Dryomov --- fs/btrfs/extent-tree.c | 54 +++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a04f99b..05e55d1 100644 --- a/fs/btrfs/extent-tree.

[PATCH 04/21] Btrfs: make avail_*_alloc_bits fields dynamic

2011-08-23 Thread Ilya Dryomov
chunk of that type goes away. Restriper needs this to properly operate when "downgrading". Signed-off-by: Ilya Dryomov --- fs/btrfs/extent-tree.c | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tr

[PATCH 03/21] Btrfs: add BTRFS_AVAIL_ALLOC_BIT_SINGLE bit

2011-08-23 Thread Ilya Dryomov
ge. However to avoid remappings in future, reserve corresponding on-disk bit. Signed-off-by: Ilya Dryomov --- fs/btrfs/ctree.h | 12 fs/btrfs/extent-tree.c | 22 ++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrf

[PATCH 02/21] Btrfs: introduce masks for chunk type and profile

2011-08-23 Thread Ilya Dryomov
Chunk's type and profile are encoded in u64 flags field. Introduce masks to easily access them. Signed-off-by: Ilya Dryomov --- fs/btrfs/ctree.h |8 fs/btrfs/extent-tree.c | 12 +++- fs/btrfs/volumes.c | 11 ++- 3 files changed, 13 insertions(+

[PATCH 01/21] Btrfs: get rid of *_alloc_profile fields

2011-08-23 Thread Ilya Dryomov
{data,metadata,system}_alloc_profile fields have been unused for a long time now. Get rid of them. Signed-off-by: Ilya Dryomov --- fs/btrfs/ctree.h |3 --- fs/btrfs/disk-io.c |3 --- fs/btrfs/extent-tree.c | 10 -- fs/btrfs/volumes.c |6 ++ 4 files

[PATCH 00/21] [RFC] Btrfs: restriper

2011-08-23 Thread Ilya Dryomov
of 3.1-rc3, available at: git://github.com/idryomov/btrfs-unstable.git restriper-rfc Thanks, Ilya Ilya Dryomov (21): Btrfs: get rid of *_alloc_profile fields Btrfs: introduce masks for chunk type and profile Btrfs: add BTRFS_AVAIL_ALLOC_BIT_SINGLE bit Btrfs: make avail_*_all

Re: after mounting with -o degraded: ioctl: LOOP_CLR_FD: Device or resource busy

2011-07-12 Thread Ilya Dryomov
On Tue, Jul 12, 2011 at 02:47:41AM +0200, krz...@gmail.com wrote: > dd if=/dev/null of=img5 bs=1 seek=2G > dd if=/dev/null of=img6 bs=1 seek=2G > mkfs.btrfs -d raid1 -m raid1 img5 img6 > losetup /dev/loop4 img5 > losetup /dev/loop5 img6 > btrfs device scan > mount -t btrfs /dev/loop4 dir > umount

Re: [PATCH v8 7/8] btrfs: Replication-type information

2011-06-28 Thread Ilya Dryomov
On Tue, Jun 28, 2011 at 08:26:43PM +0100, Hugo Mills wrote: > On Tue, Jun 28, 2011 at 06:32:43PM +0200, David Sterba wrote: > > On Sun, Jun 26, 2011 at 09:36:54PM +0100, Hugo Mills wrote: > > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > > > index 828aa34..fb11550 100644 > > > --- a/fs/b

[PATCH] Btrfs: fix type mismatch in find_free_extent()

2011-06-18 Thread Ilya Dryomov
data parameter should be u64 because a full-sized chunk flags field is passed instead of 0/1 for distinguishing data from metadata. All underlying functions expect u64. Signed-off-by: Ilya Dryomov --- fs/btrfs/extent-tree.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH] Btrfs - use %pU to print fsid

2011-06-09 Thread Ilya Dryomov
Hi Chris, Can you pull this into the next -rc ? It's minor, but people think it's useful. I just had another person asking about this patch. Thanks, Ilya -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.

[PATCH] btrfs scrub - restore bios properly after media errors

2011-04-09 Thread Ilya Dryomov
error happens, for example, at offset 512 or 1024 into the page. Also bi_flags field wasn't properly setup before reusing the bio. Signed-off-by: Ilya Dryomov --- fs/btrfs/scrub.c | 48 +--- 1 files changed, 13 insertions(+), 35 deletions(-) diff

[PATCH v2] btrfs scrub - make fixups sync, don't reuse fixup bios

2011-04-09 Thread Ilya Dryomov
needed, instead pass [sbio pointer, index]. Originally this was added to look at the possibility of sharing the code between drive swap and scrub, but it actually fixes a serious bug in scrub code where errors that could be corrected were ignored and reported as uncorrectable. Signed-off-by: Ilya

Re: [PATCH] Btrfs - use %pU to print fsid

2011-03-31 Thread Ilya Dryomov
On Thu, Mar 31, 2011 at 12:14:14PM -0500, Mitch Harder wrote: > On Wed, Feb 9, 2011 at 8:05 AM, Ilya Dryomov wrote: > > Get rid of FIXME comment.  Uuids from dmesg are now the same as uuids > > given by btrfs-progs. > > > > Signed-off-by: Ilya Dryomov > > -

Re: Calculating/estimating the process of an ongoing balance

2011-03-19 Thread Ilya Dryomov
On Sat, Mar 19, 2011 at 12:02:03PM +0100, Andreas Philipp wrote: > Hi all, > > During a btrfs filesystem balance there are lines like the following > one in dmesg > btrfs: relocating block group 2122280075264 flags 9 > Since the "big" number is strictly decreasing, I wonder whether this > can be u

[PATCH] btrfs scrub: make fixups sync, don't reuse fixup bios

2011-03-18 Thread Ilya Dryomov
[CC'ing the list to make development public, the patch is againt Arne's tree at kernel.org] Hello Arne, Below is a quite long diff the primary purpose of which is to make fixups totally sync. They are already sync for checksum failures, this patch makes them sync for EIO case as well. This is r

Re: [PATCH v3 3/6] btrfs: add scrub code and prototypes

2011-03-16 Thread Ilya Dryomov
Sorry, that was too fast. Here is the right patch. diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index ef59200..8926438 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -,7 +,7 @@ static noinline_for_stack int scrub_chunk(struct scrub_dev *sdev, struct map_lookup *map;

Re: [PATCH v3 3/6] btrfs: add scrub code and prototypes

2011-03-16 Thread Ilya Dryomov
On Sat, Mar 12, 2011 at 03:50:42PM +0100, Arne Jansen wrote: All extent maps are leaked after unmount. lookup_extent_mapping() takes a reference, so they are all left with em->refs = 1. I suggest the following: > +static noinline_for_stack int scrub_chunk(struct scrub_dev *sdev, > + u64 ch

Re: cppcheck and btrfs

2011-03-14 Thread Ilya Dryomov
On Tue, Mar 15, 2011 at 07:32:13AM +1100, Chris Samuel wrote: > Hi Chris, et. al, > > I've recently come across cppcheck (static analyser for C code) > and ran it on the current btrfs directory from Linus's repo and > it's reported the following potential issues: > > linux-2.6$ cppcheck -q fs/btr

Re: [PATCH v3 3/6] btrfs: add scrub code and prototypes

2011-03-13 Thread Ilya Dryomov
On Sat, Mar 12, 2011 at 03:50:42PM +0100, Arne Jansen wrote: > This is the main scrub code. > > Updates v3: > > - fixed EIO handling, need to reallocate bio instead of reusing it > - Updated according to David Sterba's review > - don't clobber bi_flags on reuse, just set UPTODATE > - allocate

Re: [PATCH] Btrfs: fix infinite loop in btrfs_shrink_device()

2011-02-26 Thread Ilya Dryomov
On Sat, Feb 26, 2011 at 10:05:40AM +0800, Yan, Zheng wrote: > On Sat, Feb 26, 2011 at 7:43 AM, Ilya Dryomov wrote: > > In case of an ENOSPC error from btrfs_relocate_chunk() (line 2202) while > > relocating a block group with offset 0 we end up endlessly looping. > >

[PATCH] Btrfs: fix infinite loop in btrfs_shrink_device()

2011-02-25 Thread Ilya Dryomov
In case of an ENOSPC error from btrfs_relocate_chunk() (line 2202) while relocating a block group with offset 0 we end up endlessly looping. This happens because key.offset -= 1 statement then unconditionally brings us back to the beginnig of the loop (key.offset == (u64)-1). Signed-off-by: Ilya

[PATCH] Btrfs: make btrfs_rm_device() fail gracefully

2011-02-15 Thread Ilya Dryomov
btrfs_rm_device() could lead to a situation where it was impossible to remove any of the devices because of the "unable to remove the only writeable device" error. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-)

[PATCH] Btrfs: set FMODE_EXCL in btrfs_device->mode

2011-02-15 Thread Ilya Dryomov
t;mode. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2636a05..a228f63 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1631,7 +1631,7 @@ int btrfs_init_new_device(

[PATCH] Btrfs - use %pU to print fsid

2011-02-09 Thread Ilya Dryomov
Get rid of FIXME comment. Uuids from dmesg are now the same as uuids given by btrfs-progs. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2636a05..83b789c 100644

[PATCH] Btrfs - Fix memory leak in btrfs_init_new_device()

2011-02-06 Thread Ilya Dryomov
Memory allocated by calling kstrdup() should be freed. Signed-off-by: Ilya Dryomov --- fs/btrfs/volumes.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d158530..9649cdd 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs

[PATCH] Btrfs: use checksums_len instead of first_page_offset

2011-01-19 Thread Ilya Dryomov
Minimizes the number of (sizeof(u32) * num_checksums) we have to do, removes now useless first_page_offset variable. Signed-off-by: Ilya Dryomov --- fs/btrfs/free-space-cache.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs

[PATCH v2] Btrfs: remove unneeded allocation in load_free_space_cache()

2011-01-19 Thread Ilya Dryomov
izeof(u32) * num_checksums) bytes because disk_crcs should only hold checksums. gen is fetched directly from the page. cur_crc is initialized later in the code. Don't initialize it in a declaration. Signed-off-by: Ilya Dryomov --- fs/btrfs/free-space-cache.c | 12 1 files

[PATCH] Btrfs: remove unneeded allocation in load_free_space_cache()

2011-01-19 Thread Ilya Dryomov
used independently. cur_crc is initialized later in the code. Don't initialize it in a declaration. Signed-off-by: Ilya Dryomov --- fs/btrfs/free-space-cache.c | 12 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cac

[PATCH] Btrfs: fix memory leak in btrfs_parse_early_options()

2011-01-17 Thread Ilya Dryomov
strsep() modifies the string pointer, therefore freeing it instead of original one results in a small memory leak. Fixes kmemleak warning. Signed-off-by: Ilya Dryomov --- fs/btrfs/super.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs

<    1   2   3