[PATCH 4/4 V2] btrfs-progs: rework get_fs_info to remove side effects

2013-03-11 Thread Eric Sandeen
get_fs_info() has been silently switching from a device to a mounted path as needed; the caller's filehandle was unexpectedly closed & reopened outside the caller's scope. Not so great. The callers do want "fdmnt" to be the filehandle for the mount point in all cases, though - the various ioctls

Re: [PATCH] Btrfs: get better concurrency for snapshot-aware defrag work

2013-03-11 Thread Liu Bo
On Mon, Mar 11, 2013 at 06:26:40PM +0100, David Sterba wrote: > On Mon, Mar 11, 2013 at 05:20:58PM +0800, Liu Bo wrote: > > Using spinning case instead of blocking will result in better concurrency > > overall. > > Do you have numbers to support that? > Sorry, I don't, just judging from what lea

Re: WARNING: at fs/btrfs/extent_map.c:77 free_extent_map

2013-03-11 Thread Liu Bo
On Mon, Mar 11, 2013 at 10:34:04PM +0100, Johannes Hirte wrote: > Since the updates for linux-3.9 I've had three or four times a system > freeze and only a reset (Magic SysRq) helped. After the reboot I found > a bunch of this in syslog: > > Mar 11 21:56:09 localhost kernel: [ cut here

Re: Unable to boot btrfs filesystem, and btrfsck aborts

2013-03-11 Thread Josef Bacik
On Mon, Mar 11, 2013 at 04:44:58PM -0600, Matthew Booth wrote: > My laptop crashed hard earlier today. It reset immediately to a black > screen followed by the BIOS. I have no idea why. > > However, it now fails to boot. I took a picture of the kernel panic > that results from trying to mount the

[PULL] Re: Integration branch of btrfs-progs 2013-02-27

2013-03-11 Thread David Sterba
Hi Chris, please pull this integration branch git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130227 so far no problems reported (which may also mean that nobody is using it), worked in my test setups and I've tested the label get/set patches specifically. thanks, david On We

Re: Unable to boot btrfs filesystem, and btrfsck aborts

2013-03-11 Thread Harald Glatt
If you are going to use btrfs-zero-log please create a btrfs-image first that you can then upload to a bug report so that this can be fixed. # btrfs-image -c 9 -t 8 /dev/yourbtrfs /tmp/fs_image On Mon, Mar 11, 2013 at 11:53 PM, Jan Steffens wrote: > On Mon, Mar 11, 2013 at 11:49 PM, Harald Glatt

Re: Unable to boot btrfs filesystem, and btrfsck aborts

2013-03-11 Thread Jan Steffens
On Mon, Mar 11, 2013 at 11:49 PM, Harald Glatt wrote: > On Mon, Mar 11, 2013 at 11:44 PM, Matthew Booth wrote: >> My laptop crashed hard earlier today. It reset immediately to a black >> screen followed by the BIOS. I have no idea why. >> >> However, it now fails to boot. I took a picture of the

Re: Unable to boot btrfs filesystem, and btrfsck aborts

2013-03-11 Thread Harald Glatt
On Mon, Mar 11, 2013 at 11:44 PM, Matthew Booth wrote: > My laptop crashed hard earlier today. It reset immediately to a black > screen followed by the BIOS. I have no idea why. > > However, it now fails to boot. I took a picture of the kernel panic > that results from trying to mount the root fil

Unable to boot btrfs filesystem, and btrfsck aborts

2013-03-11 Thread Matthew Booth
My laptop crashed hard earlier today. It reset immediately to a black screen followed by the BIOS. I have no idea why. However, it now fails to boot. I took a picture of the kernel panic that results from trying to mount the root filesystem: https://plus.google.com/107763699965053810188/posts/QZZt

Re: [PATCH 4/4] btrfs-progs: rework get_fs_info to remove side effects

2013-03-11 Thread Eric Sandeen
On 3/11/13 6:13 PM, Eric Sandeen wrote: > get_fs_info() has been silently switching from a device to a mounted > path as needed; the caller's filehandle was unexpectedly closed & > reopened outside the caller's scope. Not so great. > > The callers do want "fdmnt" to be the filehandle for the moun

[PATCH 3/4] btrfs-progs: don't open-code mountpoint discovery in scrub cancel

2013-03-11 Thread Eric Sandeen
cmd_scrub_cancel had its own mountpoint discovery routine; just use open_path_or_dev_mnt() for that now. Signed-off-by: Eric Sandeen --- cmds-scrub.c | 53 + 1 files changed, 17 insertions(+), 36 deletions(-) diff --git a/cmds-scrub.c b/cmds

[PATCH 1/4] btrfs-progs: close fd on return from label get/set functions

2013-03-11 Thread Eric Sandeen
Somehow missed these 2 in the last round. Signed-off-by: Eric Sandeen --- utils.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/utils.c b/utils.c index f68436d..1c73d67 100644 --- a/utils.c +++ b/utils.c @@ -1217,6 +1217,7 @@ static int set_label_mounted(const char *m

[PATCH 0/4] smalle cleanup + get_fs_info rework

2013-03-11 Thread Eric Sandeen
The first patch is a trival close of fd on function returns, somehow missed that last go-round. The next 3 are a little more substantial, working to avoid the nasty behavior of get_fs_info, closing & re-opening the callers' filehandle out of scope, if it needs to switch from device node to mountpo

[PATCH 4/4] btrfs-progs: rework get_fs_info to remove side effects

2013-03-11 Thread Eric Sandeen
get_fs_info() has been silently switching from a device to a mounted path as needed; the caller's filehandle was unexpectedly closed & reopened outside the caller's scope. Not so great. The callers do want "fdmnt" to be the filehandle for the mount point in all cases, though - the various ioctls

[PATCH 2/4] btrfs-progs: three new device/path helpers

2013-03-11 Thread Eric Sandeen
Add 3 new helpers: * is_block_device(), to test if a path is a block device. * get_btrfs_mount(), to get the mountpoint of a device, if mounted. * open_path_or_dev_mnt(path), to open either the pathname or, if it's a mounted btrfs dev, the mountpoint. Useful for some commands which can take

Re: [PATCH 2/2] btrfs: clean up transaction abort messages

2013-03-11 Thread David Sterba
On Mon, Mar 11, 2013 at 12:02:09PM -0700, Zach Brown wrote: > No worries if you're not keen to fix it up, but it'd be nice. One less > wart to be distracted by when stumbling through the code. I'll gladly update the code, thanks for the hints and comments. david -- To unsubscribe from this list:

WARNING: at fs/btrfs/extent_map.c:77 free_extent_map

2013-03-11 Thread Johannes Hirte
Since the updates for linux-3.9 I've had three or four times a system freeze and only a reset (Magic SysRq) helped. After the reboot I found a bunch of this in syslog: Mar 11 21:56:09 localhost kernel: [ cut here ] Mar 11 21:56:09 localhost kernel: WARNING: at fs/btrfs/exte

[PATCH] btrfs-progs: Add a rule to build a static mkfs.btrfs

2013-03-11 Thread Antoine Sirinelli
Static mkfs.btrfs can be used to "bootstrap" a system from a live CD which does not provide mkfs.btrfs. The executable produced is named mkfs.btrfs.static and built by invoking the "static" make rule. Signed-off-by: Antoine Sirinelli --- Makefile |9 +++-- 1 file changed, 7 insertions(+

Re: [PATCH] btrfs-progs: add options for changing size representations

2013-03-11 Thread Mike Fleetwood
On 11 March 2013 10:12, Audrius Butkevicius wrote: > Add '--si', '-h'/'--human-readable' and '--block-size' global options, > which allow users to customize the way sizes are displayed. > > Options and their format tries to mimic GNU ls utility. > > Signed-off-by: Audrius Butkevicius > --- > btr

[PATCH v2 0/5] RAID-level terminology change

2013-03-11 Thread Hugo Mills
Some time ago, and occasionally since, we've discussed altering the "RAID-n" terminology to change it to an "NcMsPp" format, where N is the number of copies, M is the number of (data) devices in a stripe per copy, and P is the number of parity devices in a stripe. The current kernel implemen

[PATCH v2 1/5] Use NcMsPp format for mkfs

2013-03-11 Thread Hugo Mills
Teach mkfs.btrfs about ncmspp format for replication levels, which avoids the semantic uncertainty over the "RAID-XYZ" naming. Signed-off-by: Hugo Mills --- mkfs.c | 91 +++- 1 file changed, 84 insertions(+), 7 deletions(-) diff --gi

[PATCH v2 4/5] Change output of btrfs fi df to report new (or old) RAID names

2013-03-11 Thread Hugo Mills
Signed-off-by: Hugo Mills --- cmds-filesystem.c | 173 ++--- 1 file changed, 152 insertions(+), 21 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 2210020..3150ff7 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -18

[PATCH v2 3/5] Convert balance filter parser to use common NcMsPp replication-level parser

2013-03-11 Thread Hugo Mills
Balance filters are the second location which takes user input of replication levels. Update this to use the common parser so that we can provide nCmSpP-style names. Signed-off-by: Hugo Mills --- cmds-balance.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) dif

[PATCH v2 2/5] Move parse_profile to utils.c

2013-03-11 Thread Hugo Mills
Make parse_profile a shared function so it can be used across the code-base. Signed-off-by: Hugo Mills --- mkfs.c | 94 --- utils.c | 94 +++ utils.h |1 + 3 files cha

[PATCH v2 5/5] Add man page description for NcMsPp replication levels

2013-03-11 Thread Hugo Mills
Signed-off-by: Hugo Mills --- man/btrfs.8.in | 16 man/mkfs.btrfs.8.in | 24 +++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/man/btrfs.8.in b/man/btrfs.8.in index 94f4ffe..4072510 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@

converting to raid5

2013-03-11 Thread Remco Hosman
Hi, Just installed 3.9.0-rc2 and the latest btrfs-progs. filesystem is a 4 disk raid1 array. first, i did the following: `btrfs val start -dconvert=raid5,usage=1` to convert the mostly empty chunks. This resulted in a lot of allocated space (10's of gigs), with only a few 100 meg used. i did

Re: [PATCH 2/2] btrfs: clean up transaction abort messages

2013-03-11 Thread Zach Brown
> * print the exact negative errno from btrfs_decode_error and > don't expect a simple snprintf to fail What an.. odd function. Looks like it was inherited from ext*. And the callers over in that neck of the woods also don't check for the implemented-but-basically-impossible snprintf failure t

Re: [PATCH 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-11 Thread David Sterba
On Mon, Mar 11, 2013 at 10:03:46AM -0500, Eric Sandeen wrote: > IMHO, nothing should be checking the backup superblocks unless explicitly > told to. That's the whole point I believe. update the infrastructure, every SB access looks to the first copy unless told by command line options. david --

Re: snapshot deletion / unmount slowness

2013-03-11 Thread David Sterba
On Sun, Mar 10, 2013 at 10:31:08PM -0700, Michael Johnson - MJ wrote: > I currently have a btrfs filesystem that I am unmounting and it has > been has been "unmounting" for the last 20 minutes. > > I'm pretty sure I know exactly what is going on and in my current > situation it's not a huge issues

Re: [PATCH] Btrfs: get better concurrency for snapshot-aware defrag work

2013-03-11 Thread David Sterba
On Mon, Mar 11, 2013 at 05:20:58PM +0800, Liu Bo wrote: > Using spinning case instead of blocking will result in better concurrency > overall. Do you have numbers to support that? david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...

Re: Creating zero-filled file aborts after 20GB in a 4GB volume with compress=lzo

2013-03-11 Thread David Sterba
On Mon, Mar 11, 2013 at 04:16:34PM +0100, Clemens Eisserer wrote: > When running ... > > > dd if=/dev/zero of=testfile bs=1M > > on a compressed btrfs volume of 4GB mounted with compress=lzo, dd > aborts after about 20GB written. # mkfs 4g # dd if=/dev/zero of=testfile bs=1M dd: writing `testfil

[PATCH 2/2] btrfs: clean up transaction abort messages

2013-03-11 Thread David Sterba
The transaction abort stacktrace is printed only once per module lifetime, but we'd like to see it each time it happens per filesystem. Introduce a fs_state flag that records the state. Tweak the messages around abort: * add error number to the first abor * print the exact negative errno from btrf

[PATCH 1/2] btrfs: merge save_error_info helpers into one

2013-03-11 Thread David Sterba
Signed-off-by: David Sterba --- fs/btrfs/super.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 68a29a1..eed1464 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -91,7 +91,7 @@ static const char *btrfs_decode_error(i

Re: snapshot deletion / unmount slowness

2013-03-11 Thread Liu Bo
On Mon, Mar 11, 2013 at 11:20:15AM +0100, Swâmi Petaramesh wrote: > Le 11/03/2013 07:47, Liu Bo a écrit : > > A recent commit(commit fa6ac8765c48a06dfed914e8c8c3a903f9d313a0 > > Btrfs: fix cleaner thread not working with inode cache option) > > may improve the situation. > > Hi Liu, > > I have ne

Re: [PATCH 3/3] btrfs-progs: use BTRFS_SCAN_BACKUP_SB flag in btrfs_scan_one_device

2013-03-11 Thread Eric Sandeen
On 3/8/13 9:25 AM, Anand Jain wrote: > bug: > --- > mkfs.btrfs /dev/sdb -f && yes| mkfs.ext4 /dev/sdb && mount /dev/sdb /ext4 > mkfs.btrfs -f /dev/sdc /dev/sdd (run twice) > mkfs.btrfs -f /dev/sdc /dev/sdd > :: > ERROR: unable to scan the device '/dev/sdb' - Device or resource busy > ERROR: una

Re: snapshot deletion / unmount slowness

2013-03-11 Thread Liu Bo
On Sun, Mar 10, 2013 at 10:31:08PM -0700, Michael Johnson - MJ wrote: > I currently have a btrfs filesystem that I am unmounting and it has > been has been "unmounting" for the last 20 minutes. > > I'm pretty sure I know exactly what is going on and in my current > situation it's not a huge issues

Integration branch of btrfs-progs 2013-03-11

2013-03-11 Thread David Sterba
Hi, this set contains help text updates, the series from Eric and my fix to mkfs superblock checksum (now needed to mount a new filesystem when the kernel-side check is in place -- applies to current btrfs-next). git://repo.or.cz/btrfs-progs-unstable/devel.git integration-20130311 david

Re: about btrfs quota issues

2013-03-11 Thread Arne Jansen
On 11.03.2013 15:35, Wang Shilong wrote: > >> On 11.03.2013 15:15, Wang Shilong wrote: >>> >>> >>> > The worst thing is that i don't think users can master this magic > concept very well. Normally users don't need very sophisticated scenarios. In fact, they don't even need

Re: about btrfs quota issues

2013-03-11 Thread Wang Shilong
> On 11.03.2013 15:15, Wang Shilong wrote: >> >> >> The worst thing is that i don't think users can master this magic concept very well. >>> >>> Normally users don't need very sophisticated scenarios. In fact, they >>> don't even need higher level quota groups, the basic tracking is

Re: about btrfs quota issues

2013-03-11 Thread Arne Jansen
On 11.03.2013 15:15, Wang Shilong wrote: > > > >>> The worst thing is that i don't think users can master this magic >>> concept very well. >> >> Normally users don't need very sophisticated scenarios. In fact, they >> don't even need higher level quota groups, the basic tracking is >> enough. I

Re: about btrfs quota issues

2013-03-11 Thread Wang Shilong
>> The worst thing is that i don't think users can master this magic >> concept very well. > > Normally users don't need very sophisticated scenarios. In fact, they > don't even need higher level quota groups, the basic tracking is > enough. In this case, everything just works as expected for t

Re: [PATCH 0/5] [RFC] RAID-level terminology change

2013-03-11 Thread David Sterba
On Sun, Mar 10, 2013 at 11:49:53PM +, Hugo Mills wrote: > > Using an asterisk '*' in something will be used as a command line argument > > risks having the shell expand it. Sticking to pure alphanumeric names would > > be better. > >Yeah, David's just pointed this out on IRC. After a bit

Re: about btrfs quota issues

2013-03-11 Thread Arne Jansen
On 11.03.2013 14:31, Wang Shilong wrote: > > Hello, > >>> >>> In fact, i think you try to put some work on users, especially when >>> snapshot happens. >>> It is complex to track all the group's accounting when having >>> snapshots..See the following >>> commands. >>> >>> btrfs sub snapshot -c

Re: about btrfs quota issues

2013-03-11 Thread Wang Shilong
Hello, > On 10.03.2013 05:21, Shilong Wang wrote: >> Hello, Arne >> >> Steps to reproduce: >> >> >>mkfs.btrfs >>mount >>btrfs quota enable >> >>btrfs sub create /sub >>btrfs qgroup create 1/1 >>

Re: about btrfs quota issues

2013-03-11 Thread Arne Jansen
On 10.03.2013 05:21, Shilong Wang wrote: > Hello, Arne > > Steps to reproduce: > > > mkfs.btrfs > mount > btrfs quota enable > > btrfs sub create /sub > btrfs qgroup create 1/1 > btrfs

Re: BTRFS and "ionice"

2013-03-11 Thread Dan van der Ster
Hi, Which IO scheduler do you use? I used to have terrible read performance during a btrfs scrub until I switched the disk scheduler from deadline to cfq. Cheers, Dan On Mon, Mar 11, 2013 at 11:26 AM, Swâmi Petaramesh wrote: > Hi, > > I use "ionice -c 3 " to run some low-priority background task

Re: [PATCH] btrfs-progs: add options for changing size representations

2013-03-11 Thread Wang Shilong
Hello, > Add '--si', '-h'/'--human-readable' and '--block-size' global options, > which allow users to customize the way sizes are displayed. why not use the function getopt_long() to complete the parsing. Never Re-inventing the wheel again. As discussed before, better not use 'exit(1)' in t

Re: about btrfs quota issues

2013-03-11 Thread Wang Shilong
ping.. > Hello, Arne > > Steps to reproduce: > > >mkfs.btrfs >mount >btrfs quota enable > >btrfs sub create /sub >btrfs qgroup create 1/1 >btrfs qgroup assign sub_qgroupid 1/1 > > >

BTRFS and "ionice"

2013-03-11 Thread Swâmi Petaramesh
Hi, I use "ionice -c 3 " to run some low-priority background tasks (i.e. tar, big file copies, or performing checksums sur very big files) using the disk "only when idle", which would be supposed to have very little impact on my system performance meanwhile. I can be pretty sure that those tasks

Re: snapshot deletion / unmount slowness

2013-03-11 Thread Swâmi Petaramesh
Le 11/03/2013 07:47, Liu Bo a écrit : > A recent commit(commit fa6ac8765c48a06dfed914e8c8c3a903f9d313a0 > Btrfs: fix cleaner thread not working with inode cache option) > may improve the situation. Hi Liu, I have never seen this issue with btrfs-cleaner not working, when I delete snapshots it typ

[PATCH] btrfs-progs: add options for changing size representations

2013-03-11 Thread Audrius Butkevicius
Add '--si', '-h'/'--human-readable' and '--block-size' global options, which allow users to customize the way sizes are displayed. Options and their format tries to mimic GNU ls utility. Signed-off-by: Audrius Butkevicius --- btrfs.c |3 ++ utils.c | 146 +++

[PATCH] Btrfs: remove btrfs_try_spin_lock

2013-03-11 Thread Liu Bo
Remove an useless function claim. Signed-off-by: Liu Bo --- fs/btrfs/locking.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h index ca52681..b81e0e9 100644 --- a/fs/btrfs/locking.h +++ b/fs/btrfs/locking.h @@ -26,7 +26,6 @@ voi

[PATCH] Btrfs: get better concurrency for snapshot-aware defrag work

2013-03-11 Thread Liu Bo
Using spinning case instead of blocking will result in better concurrency overall. Signed-off-by: Liu Bo --- fs/btrfs/inode.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 13ab4de..1f26 100644 --- a/fs/btrfs/inode.c +++ b

[PATCH] Btrfs: update to use fs_state bit

2013-03-11 Thread Liu Bo
Now that we use bit operation to check fs_state, update btrfs_free_fs_root()'s checker, otherwise we get back to memory leak case. Signed-off-by: Liu Bo --- 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

Re: [PATCH 0/5] [RFC] RAID-level terminology change

2013-03-11 Thread Hugo Mills
On Sun, Mar 10, 2013 at 11:55:10PM +, sam tygier wrote: > On 09/03/13 20:31, Hugo Mills wrote: > >Some time ago, and occasionally since, we've discussed altering the > > "RAID-n" terminology to change it to an "nCmSpP" format, where n is the > > number of copies, m is the number of (data) d