[PATCH] btrfs: cleanup for open-coded alignment

2013-02-26 Thread Qu Wenruo
Though most of the btrfs codes are using ALIGN macro for page alignment, there are still some codes using open-coded alignment like the following: -- u64 mask = ((u64)root-stripesize - 1); u64 ret = (val + mask) ~mask; -- Or even hidden one: -- num_bytes = (end

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread Tsutomu Itoh
On 2013/02/26 16:05, Dave Chinner wrote: On Tue, Feb 26, 2013 at 01:25:11PM +0900, Tsutomu Itoh wrote: On 2013/02/26 13:06, Eric Sandeen wrote: On 2/25/13 9:55 PM, Tsutomu Itoh wrote: EXPERIMENTAL... It's certainly so. However, I think that we should not add the option that it troubles a lot

Re: lvm volume like support

2013-02-26 Thread Martin Steigerwald
Am Dienstag, 26. Februar 2013 schrieb Fajar A. Nugraha: On Tue, Feb 26, 2013 at 11:59 AM, Mike Fleetwood mike.fleetw...@googlemail.com wrote: On 25 February 2013 23:35, Suman C schakr...@gmail.com wrote: Hi, I think it would be great if there is a lvm volume or zfs zvol type support

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread Martin Steigerwald
Am Dienstag, 26. Februar 2013 schrieb Tsutomu Itoh: Therefore I want you to revert commit:2a2d8e1962e8b6cda7b0a7584f6d2fb95d442cb6. btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table How do you think about it? What if you submit a patch to

Re: Hybrid Storage proposal

2013-02-26 Thread Zhi Yong Wu
HI, It's a bit long so that i haven't read its whole, but i want to know if it has any collision with my ongoing feature btrfs hot relocation/migration? On Thu, Feb 21, 2013 at 12:46 AM, Matias Bjorling m...@itu.dk wrote: Here is a short proposal for the hybrid storage cache idea with

Re: [PATCH V2][BTRFS-PROGS] Enhance btrfs fi df with raid5/6 support

2013-02-26 Thread Martin Steigerwald
Am Montag, 25. Februar 2013 schrieb Zach Brown: I updates my previous patches [1] to add support for raid5/6. These patches update the btrfs fi df command and add two new commands: - btrfs filesystem disk-usage path - btrfs device disk-usage path This seems like a ton of code. Here's

Re: [PATCH] Btrfs: do not change inode flags in rename

2013-02-26 Thread David Sterba
On Tue, Feb 26, 2013 at 08:11:17AM +0800, Liu Bo wrote: On Mon, Feb 25, 2013 at 01:56:47PM -0500, Josef Bacik wrote: On Sun, Feb 24, 2013 at 09:04:42PM -0700, Liu Bo wrote: Before we forced to change a file's NOCOW and COMPRESS flag due to the parent directory's, but this ends up a bad

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread David Sterba
On Tue, Feb 26, 2013 at 08:39:52AM +0900, Tsutomu Itoh wrote: This means that it is now required to change all occurrences of mkfs.btrfs to mkfs.btrfs -f everywhere. Can't we first establish a I also think so. It means -f is not significant to me, I think. (Most of my test scripts fails

Re: [PATCH V2][BTRFS-PROGS] Enhance btrfs fi df with raid5/6 support

2013-02-26 Thread Martin Steigerwald
Am Samstag, 23. Februar 2013 schrieb Goffredo Baroncelli: Hi all, Hi Goffredo, I updates my previous patches [1] to add support for raid5/6. These patches update the btrfs fi df command and add two new commands: - btrfs filesystem disk-usage path - btrfs device disk-usage path Tested-By:

Re: [PATCH V2][BTRFS-PROGS] Enhance btrfs fi df with raid5/6 support

2013-02-26 Thread Martin Steigerwald
Am Dienstag, 26. Februar 2013 schrieb Gareth Pye: On Tue, Feb 26, 2013 at 10:09 PM, Martin Steigerwald mar...@lichtvoll.de wrote: I´d still like that for df, whose output is quite bogus in certain BTRFS setups at the moment and does not give applications a realistic estimate at all. One

Re: [POSSIBLE SPAM] Re: Hybrid Storage proposal

2013-02-26 Thread Matias Bjørling
On 02/26/2013 12:04 PM, Zhi Yong Wu wrote: HI, It's a bit long so that i haven't read its whole, but i want to know if it has any collision with my ongoing feature btrfs hot relocation/migration? It will utilize the hot track patch set you're been creating for VFS. I think the methods are

Re: [PATCH V2][BTRFS-PROGS] Enhance btrfs fi df with raid5/6 support

2013-02-26 Thread Martin Steigerwald
Am Dienstag, 26. Februar 2013 schrieb Martin Steigerwald: Am Dienstag, 26. Februar 2013 schrieb Gareth Pye: On Tue, Feb 26, 2013 at 10:09 PM, Martin Steigerwald mar...@lichtvoll.de wrote: I´d still like that for df, whose output is quite bogus in certain BTRFS setups at the moment

Re: WARNING: at fs/btrfs/inode.c:2165 btrfs_orphan_commit_root+0xcb/0xdf()

2013-02-26 Thread Josef Bacik
On Sun, Feb 24, 2013 at 07:55:46PM -0700, Marc MERLIN wrote: Is this useful to anyone? Got this after a crash/reboot: if (block_rsv) { WARN_ON(block_rsv-size 0); btrfs_free_block_rsv(root, block_rsv); } Fixed in btrfs-next, thanks for

Re: kernel BUG at fs/btrfs/volumes.c:3753! These btrfs crashes at mount time on log replay are really a problem

2013-02-26 Thread Josef Bacik
On Mon, Feb 25, 2013 at 11:51:02PM -0700, Marc MERLIN wrote: TL;DR; WARNING: at fs/btrfs/tree-log.c:1984 walk_down_log_tree+0x51/0x307() WARNING: at fs/btrfs/tree-log.c:1988 walk_down_log_tree+0x6c/0x307() kernel BUG at fs/btrfs/volumes.c:3753! It's way time for btrfs to stop crashing your

Re: [PATCH] Btrfs: do not change inode flags in rename

2013-02-26 Thread Josef Bacik
On Tue, Feb 26, 2013 at 05:33:00AM -0700, David Sterba wrote: On Tue, Feb 26, 2013 at 08:11:17AM +0800, Liu Bo wrote: On Mon, Feb 25, 2013 at 01:56:47PM -0500, Josef Bacik wrote: On Sun, Feb 24, 2013 at 09:04:42PM -0700, Liu Bo wrote: Before we forced to change a file's NOCOW and

Re: WARNING: at fs/btrfs/inode.c:2165 btrfs_orphan_commit_root+0xcb/0xdf()

2013-02-26 Thread Marc MERLIN
On Tue, Feb 26, 2013 at 03:02:01PM +0800, Liu Bo wrote: On Sun, Feb 24, 2013 at 06:55:46PM -0800, Marc MERLIN wrote: Is this useful to anyone? Hi Marc, Thanks for the report, of course they're useful. Thanks. I wasn't sure since I haven't seen the real problem of crashes during mount

Re: kernel BUG at fs/btrfs/volumes.c:3753! These btrfs crashes at mount time on log replay are really a problem

2013-02-26 Thread Zach Brown
Am I wrong when saying that ending up with replay journals that have unexpected data and that can't be replayed is just inevitable and something any journalling filesystem must deal with? If by journal you mean the btrfs log then yes, strictly speaking, you're wrong. btrfs does deal with the

Re: [PATCH 16/17] btrfs-progs: fix fd leak in cmd_subvol_set_default

2013-02-26 Thread Goffredo Baroncelli
Hi Eric, On 02/25/2013 11:54 PM, Eric Sandeen wrote: Rearrange cmd_subvol_set_default() slightly so we don't have to close the fd on an error return. While we're at it, fix whitespace remove magic return values. Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-subvolume.c |

Re: [PATCH 17/17] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Goffredo Baroncelli
On 02/25/2013 11:54 PM, Eric Sandeen wrote: The coverity had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could initialize it, but Zach points out that just using strsep is a lot simpler if there's only one delimiter, so just switch to that.

Re: [PATCH 01/17] btrfs-progs: Unify size-parsing

2013-02-26 Thread Goffredo Baroncelli
On 02/25/2013 11:54 PM, Eric Sandeen wrote: cmds-qgroup.c contained a parse_limit() function which duplicates much of the functionality of parse_size. The only unique behavior is to handle none; then we can just pass it off to parse_size(). Signed-off-by: Eric Sandeen sand...@redhat.com

Re: [PATCH] btrfs: cleanup for open-coded alignment

2013-02-26 Thread Zach Brown
Sometimes these open-coded alignment is not so easy to understand for newbie like me. Thanks, this is a nice change. You might have mentioned in the commit message that some of the changes aren't *strictly* equivalent but that they're still safe. - iosize = (iosize + blocksize -

Re: kernel BUG at fs/btrfs/volumes.c:3753! These btrfs crashes at mount time on log replay are really a problem

2013-02-26 Thread Marc MERLIN
On Tue, Feb 26, 2013 at 10:24:42AM -0800, Zach Brown wrote: Am I wrong when saying that ending up with replay journals that have unexpected data and that can't be replayed is just inevitable and something any journalling filesystem must deal with? If by journal you mean the btrfs log then

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread Goffredo Baroncelli
On 02/26/2013 11:37 AM, Martin Steigerwald wrote: Am Dienstag, 26. Februar 2013 schrieb Tsutomu Itoh: Therefore I want you to revert commit:2a2d8e1962e8b6cda7b0a7584f6d2fb95d442cb6. btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table How do you think

Re: Needed change in Wiki

2013-02-26 Thread Goffredo Baroncelli
Hi Anand, On 02/25/2013 05:39 AM, Anand Jain wrote: You may need to update the minimum version of libblkid-dev that is required. Since. latest btrfs-progs needs blkid_probe_get_wholedisk_devno() from the libblkid-dev. found libblkid-dev version 2.17.2 does not work, and 2.22 works.

Re: kernel BUG at fs/btrfs/volumes.c:3753! These btrfs crashes at mount time on log replay are really a problem

2013-02-26 Thread Zach Brown
The equivalent consistent update mechanism in btrfs is cow tree updates. The superblock that references new tree blocks written to free space is itself only written once all those blocks are stable on disk. If the tree block writes are interrupted then the superblock isn't updated and

Re: [PATCH 17/17] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Eric Sandeen
On 2/26/13 12:47 PM, Goffredo Baroncelli wrote: On 02/25/2013 11:54 PM, Eric Sandeen wrote: The coverity had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could initialize it, but Zach points out that just using strsep is a lot simpler if there's

Re: [PATCH 01/17] btrfs-progs: Unify size-parsing

2013-02-26 Thread Eric Sandeen
On 2/26/13 12:50 PM, Goffredo Baroncelli wrote: On 02/25/2013 11:54 PM, Eric Sandeen wrote: cmds-qgroup.c contained a parse_limit() function which duplicates much of the functionality of parse_size. The only unique behavior is to handle none; then we can just pass it off to parse_size().

[PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Eric Sandeen
The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could initialize it, but Zach points out that just using strsep is a lot simpler if there's only one delimiter, so just switch to that. Signed-off-by: Eric Sandeen sand...@redhat.com ---

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread Eric Sandeen
On 2/20/13 9:37 AM, Stefan Behrens wrote: ... This means that it is now required to change all occurrences of mkfs.btrfs to mkfs.btrfs -f everywhere. Can't we first establish a time period of 100 years where the -f option is tolerated and ignored, and then in 2113 we require that the users

Re: [PATCH 16/17] btrfs-progs: fix fd leak in cmd_subvol_set_default

2013-02-26 Thread Eric Sandeen
On 2/26/13 12:46 PM, Goffredo Baroncelli wrote: Hi Eric, On 02/25/2013 11:54 PM, Eric Sandeen wrote: Rearrange cmd_subvol_set_default() slightly so we don't have to close the fd on an error return. While we're at it, fix whitespace remove magic return values. Signed-off-by: Eric

Re: [PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Ilya Dryomov
On Tue, Feb 26, 2013 at 02:20:30PM -0600, Eric Sandeen wrote: The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could initialize it, but Zach points out that just using strsep is a lot simpler if there's only one delimiter, so just

[PATCH] xfstests: handle new mkfs.btrfs -f option cleanly

2013-02-26 Thread Eric Sandeen
I added an -f option to mkfs.btrfs to force overwrite of an existing filesystem. Now on an xfstests run, new mkfs.btrfs requires it, and old mkfs.btrfs cannot accept it. So, add a helper which works out whether -f is needed, and add it to the MKFS_BTRFS_PROG env. var as necessary, so that it is

Re: [PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Eric Sandeen
On 2/26/13 2:40 PM, Ilya Dryomov wrote: On Tue, Feb 26, 2013 at 02:20:30PM -0600, Eric Sandeen wrote: The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could initialize it, but Zach points out that just using strsep is a lot simpler

Re: [PATCH 16/17] btrfs-progs: fix fd leak in cmd_subvol_set_default

2013-02-26 Thread Goffredo Baroncelli
On 02/26/2013 09:10 PM, Eric Sandeen wrote: On 2/26/13 12:46 PM, Goffredo Baroncelli wrote: Hi Eric, On 02/25/2013 11:54 PM, Eric Sandeen wrote: Rearrange cmd_subvol_set_default() slightly so we don't have to close the fd on an error return. While we're at it, fix whitespace remove magic

Re: [PATCH 17/17 V2] btrfs-progs: replace strtok_r with strsep

2013-02-26 Thread Ilya Dryomov
On Tue, Feb 26, 2013 at 02:46:30PM -0600, Eric Sandeen wrote: On 2/26/13 2:40 PM, Ilya Dryomov wrote: On Tue, Feb 26, 2013 at 02:20:30PM -0600, Eric Sandeen wrote: The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. We could

Re: [PATCH 01/17] btrfs-progs: Unify size-parsing

2013-02-26 Thread Goffredo Baroncelli
On 02/26/2013 09:17 PM, Eric Sandeen wrote: On 2/26/13 12:50 PM, Goffredo Baroncelli wrote: On 02/25/2013 11:54 PM, Eric Sandeen wrote: cmds-qgroup.c contained a parse_limit() function which duplicates much of the functionality of parse_size. The only unique behavior is to handle none; then

Re: [PATCH, RFC] btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table

2013-02-26 Thread Martin Steigerwald
Am Dienstag, 26. Februar 2013 schrieb Goffredo Baroncelli: And I teach not to in my trainings as well. Everyone who uses rm -rf by default even just for deleting a single file does it as long as he or she deleted his / her home directory or something. Unfortunately the rm -rf is

Swapfile on btrfs

2013-02-26 Thread Alex Elsayed
Hey, I was looking at the wiki 'unclaimed projects' list and I thought I'd take a look at what might be needed to use the swap-over-n{fs,bd} functionality in order to implement swapfile support. It *looks* like it's surprisingly uncomplicated - to the point where I suspect I'm missing

[PATCH 17/17 V3] btrfs-progs: initialize save_ptr prior to strtok_r

2013-02-26 Thread Eric Sandeen
The coverity runs had a false positive complaining that save_ptr is uninitialized in the call to strtok_r. Turns out that under the covers glibc was doing enough to confuse the checker about what was being called. Just to keep the noise down, do a harmless initialization, with a comment as to

Re: WARNING: at fs/btrfs/inode.c:2165 btrfs_orphan_commit_root+0xcb/0xdf()

2013-02-26 Thread Liu Bo
On Tue, Feb 26, 2013 at 09:20:43AM -0500, Josef Bacik wrote: On Sun, Feb 24, 2013 at 07:55:46PM -0700, Marc MERLIN wrote: Is this useful to anyone? Got this after a crash/reboot: if (block_rsv) { WARN_ON(block_rsv-size 0); btrfs_free_block_rsv(root,

Re: lvm volume like support

2013-02-26 Thread Fajar A. Nugraha
On Tue, Feb 26, 2013 at 9:30 PM, Martin Steigerwald mar...@lichtvoll.de wrote: Am Dienstag, 26. Februar 2013 schrieb Fajar A. Nugraha: On Tue, Feb 26, 2013 at 11:59 AM, Mike Fleetwood mike.fleetw...@googlemail.com wrote: On 25 February 2013 23:35, Suman C schakr...@gmail.com wrote: Hi,

[PATCH] Btrfs-progs: fix segmentation fault of btrfs check

2013-02-26 Thread Tsutomu Itoh
Segmentation fault occurred in the following command. # btrfs check /dev/sdc7 No valid Btrfs found on /dev/sdc7 Segmentation fault (core dumped) Fix it. Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com --- cmds-check.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: lvm volume like support

2013-02-26 Thread Roman Mamedov
On Wed, 27 Feb 2013 13:23:23 +1100 Fajar A. Nugraha l...@fajar.net wrote: Not to mention the hassle in accessing the data if it resides on a partition inside the file (e.g. you need losetup + kpartx to access it, and you must remember to do the reverse when you're finished with it). In

btrfs crash when low on memory.

2013-02-26 Thread Dave Jones
Something I've yet to repeat managed to leak a whole bunch of memory while I was travelling, and locked up my workstation. When I got home, this was the last thing printed out before it locked up (it did make it into the logs thankfully) after a bunch of instances of the oom-killers handywork.

[PATCH] xfstests 276: fix error 'FIBMAP: Invalid argument'

2013-02-26 Thread Wang Sheng-Hui
Btrfs doesn't support FIEMAP_FLAG_XATTR, which is enabled by -x option of filefrag, and will fail with 'FIBMAP: Invalid argument' for 'filefrag -vx'. 'filefrag -vx' fails on btrfs with 'FIEMAP failed with unsupported flags 2' Remove the '-x' option. Signed-off-by: Wang Sheng-Hui