[PATCH] btrfs: fix stat blocks accounting

2011-11-16 Thread David Sterba
Round inode bytes and delalloc bytes up to real blocksize before converting to sector size. Otherwise eg. files smaller than 512 are reported with zero blocks due to incorrect rounding. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/inode.c |6 -- 1 files changed, 4 insertions

Re: Segmentation Faults

2011-11-16 Thread David Sterba
Hi, On Wed, Nov 16, 2011 at 04:39:21PM +, Tim Crone wrote: root@berna:~# uname -a Linux berna 2.6.38-bpo.2-amd64 #1 SMP Mon Jun 6 15:24:02 UTC 2011 x86_64 GNU/Linux 2.6.38 is quite old from btrfs perspective and it's highly possible that the bug you've hit is already fixed. Try newer

Re: Segmentation Faults

2011-11-22 Thread David Sterba
On Fri, Nov 18, 2011 at 07:29:52AM -0500, Timothy Crone wrote: Okay, I installed 3.1.1 and continue to oops when trying to delete a directory. Please let me know if you would like any additional information. Do you have more detailed stacktraces from the crash? david -- To unsubscribe from

Re: [PATCH] Btrfs: rewrite btrfs_trim_block_group()

2011-11-23 Thread David Sterba
On Thu, Nov 17, 2011 at 03:26:17PM +0800, Li Zefan wrote: diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 8c32434..89cc54e 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c +static int trim_no_bitmap(struct btrfs_block_group_cache

Re: [PATCH 1/2] Removed extraneous whitespace from mkfs man page

2011-11-23 Thread David Sterba
On Wed, Nov 23, 2011 at 04:25:30PM -0500, Phillip Susi wrote: There were extra spaces around some of the arguments in the man page for mkfs. Please resend with Signed-off-by: tag, and it would be helpful to prepend the subject with eg. btrfs-progs. thanks, david -- To unsubscribe from this

[PATCH] btrfs: polish names of kmem caches

2011-11-24 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

Re: [patch 03/99] btrfs: Panic on bad rbtree operations

2011-11-24 Thread David Sterba
On Wed, Nov 23, 2011 at 07:35:36PM -0500, Jeff Mahoney wrote: diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index a1c9404..5a53d94 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -59,6 +59,14 @@ static struct rb_node *tree_insert(struct rb_root *root,

Re: [patch 13/99] btrfs: clear_extent_uptodate can drop gfp_t argumetn

2011-11-24 Thread David Sterba
Subject: Re: [patch 13/99] btrfs: clear_extent_uptodate can drop gfp_t argumetn typo in subject s/argumetn/argument/, same in the next 2 patches -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [patch 65/99] btrfs: -submit_bio_hook error push-up

2011-11-24 Thread David Sterba
On Wed, Nov 23, 2011 at 07:36:38PM -0500, Jeff Mahoney wrote: --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2752,10 +2759,12 @@ retry: static void flush_epd_write_bio(struct extent_page_data *epd) { if (epd-bio) { + int ret; if (epd-sync_io) -

Re: [PATCH 0/5] fix bugs of sub transid

2011-11-28 Thread David Sterba
On Mon, Nov 21, 2011 at 06:10:19PM +0800, Liu Bo wrote: We've been sufferring two big bugs with sub transid: one is a bug related to root's last_snapshot, the other is a bug related to disk extent refs' generation. Do you have a testcase to trigger and check these bugs? 1) The first patch

Re: [PATCH 2/2] Btrfs: set the i_nlink to 2 for an initial dir inode

2011-11-28 Thread David Sterba
On Mon, Nov 28, 2011 at 03:47:20PM +0800, Jeff Liu wrote: For an initial dir inode, stat(1) show it links as 1, IMHO it should be 2 by default. Yes, this is correct for directories. And newly created subvolumes should have nlink == 2 as well, can you please add it to your patch? (I have tested

Re: [PATCH 0/5] fix bugs of sub transid -- WARNING: at fs/btrfs/ctree.c:432

2011-11-29 Thread David Sterba
On Tue, Nov 29, 2011 at 09:18:35AM +0800, Liu Bo wrote: a) For the first one (last_snapshot bug), The test involves three processes (derived from Chris): mkfs.btrfs /dev/xxx mount /dev/xxx /mnt 1) run compilebench -i 30 --makej -D /mnt Let compilebench run until it starts the create

Re: kernel BUG at /build/buildd/linux-3.2.0/fs/btrfs/extent-tree.c:4816!

2011-11-29 Thread David Sterba
On Tue, Nov 29, 2011 at 10:49:13AM -0500, Chris Mason wrote: The good news about this one is that it is very clear cut. The hard part is figuring out where these bogus link counts came from. I'd suggest that you spend some time running memtest on the machine. Just to add some evidence from

[PATCH] btrfs: simplify move_pages and copy_pages

2011-11-29 Thread David Sterba
After commit a65917156e34594 (Btrfs: stop using highmem for extent_buffers) we don't need to kmap_atomic anymore and can simplify both functions. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/extent_io.c | 19 --- 1 files changed, 4 insertions(+), 15 deletions

Re: [PATCH 0/5] fix bugs of sub transid -- WARNING: at fs/btrfs/ctree.c:432

2011-12-02 Thread David Sterba
On Thu, Dec 01, 2011 at 09:32:19AM +0800, Liu Bo wrote: The warning is aimed to check whether this ref_cow root is in this transaction, so we can change it to WARN_ON(root-ref_cows trans-transaction-transid root-last_trans); Ok, I'll add this change to next testing round. BTW, did you

Re: [GIT PULL] Btrfs updates

2011-12-05 Thread David Sterba
On Mon, Dec 05, 2011 at 08:14:13AM -0500, Chris Mason wrote: On Mon, Dec 05, 2011 at 04:10:49PM +0800, Miao Xie wrote: [PATCH 08/20] Btrfs: try to allocate from cluster even at LOOP_NO_EMPTY_SIZE Thanks, I'll push this 08/20 out as well. Please pick Li Zefan: Btrfs: check if the

Re: [PATCH] Btrfs-progs: fail gracefully on error from open_ctree()

2011-12-12 Thread David Sterba
On Tue, Nov 01, 2011 at 11:47:22PM +0200, Ilya Dryomov wrote: --- a/mkfs.c +++ b/mkfs.c @@ -1328,7 +1328,12 @@ int main(int ac, char **av) fprintf(stderr, error during mkfs %d\n, ret); exit(1); } + root = open_ctree(file, 0, O_RDWR); + if

Re: kernel BUG at /build/buildd/linux-3.2.0/fs/btrfs/extent-tree.c:4816!

2011-12-14 Thread David Sterba
On Tue, Nov 29, 2011 at 01:12:14PM -0500, Chris Mason wrote: Nov 28 00:11:14 karl-workstation kernel: [212918.235050] kernel BUG at /home/apw/COD/linux/fs/btrfs/extent-tree.c:4775! Nov 28 00:11:14 karl-workstation kernel: [212918.235118] RAX: ea01 RBX: 880412c3ab40 RCX:

[PATCH] btrfs: add new ioctl to determine size of compressed file

2011-12-19 Thread David Sterba
is number of occupied 512B sectors so this can be easily compared to stat.st_blocks to determine rough compression ratio of a file. Based on implementation from Ulrich Hecht, http://comments.gmane.org/gmane.comp.file-systems.btrfs/6253 Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ioctl.c

A sample tool how to use the new ioctl

2011-12-19 Thread David Sterba
This is a standalone tool I've used to exercise the ioctl, simply pass the name of a file and see the result. The numbers are a rough estimate. It also takes the range arguments, but the ratio will be bogus due to comparison to whole file (st_blocks), an exact extent length from fiemap/filefrag is

Re: A sample tool how to use the new ioctl

2011-12-19 Thread David Sterba
On Mon, Dec 19, 2011 at 09:47:06AM -0500, Chris Mason wrote: On Mon, Dec 19, 2011 at 03:25:39PM +0100, David Sterba wrote: This is a standalone tool I've used to exercise the ioctl, simply pass Could you please add this to btrfs filesystem stat filename Here it is, but I haven't really

Re: [PATCH] btrfs: add new ioctl to determine size of compressed file

2011-12-20 Thread David Sterba
On Tue, Dec 20, 2011 at 09:33:06AM +0800, Liu Bo wrote: +static long btrfs_ioctl_compr_size(struct file *file, void __user *argp) +{ + struct inode *inode = fdentry(file)-d_inode; + struct btrfs_ioctl_compr_size_args compr_args; + u64 len; + u64 compressed_size = 0; + u64

[PATCH V2] btrfs: add new ioctl to determine size of compressed file

2011-12-20 Thread David Sterba
are number of occupied 512B sectors for uncompressed and compressed size and can be easily compared to determine rough compression ratio of the given file range. Based on implementation from Ulrich Hecht, http://comments.gmane.org/gmane.comp.file-systems.btrfs/6253 Signed-off-by: David Sterba dste

[PATCH V2] btrfs-progs: Add ioctl to read compressed size of a file

2011-12-20 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- V1-V2: * match current kernel side and print uncompressed length as well * now it's easy to print the compression ratio for the given range btrfs.c |9 ++- btrfs_cmds.c | 68

Re: BTRFS fsck apparent errors

2012-07-04 Thread David Sterba
On Wed, Jul 04, 2012 at 07:40:05AM +0700, Fajar A. Nugraha wrote: Are there any known btrfs regression in 3.4? I'm using 3.4.0-3-generic from a ppa, but a normal mount - umount cycle seems MUCH longer compared to how it was on 3.2, and iostat shows the disk is read-IOPS-bound Is it just

Re: 3.4.4: BUG: Bad rss-counter state x

2012-07-04 Thread David Sterba
Hi, On Tue, Jul 03, 2012 at 10:05:55PM -0700, Marc MERLIN wrote: Since I heard absolutely nothing on my last but and corruption report, I'm not sure if they are useful or wanted (please let me know). They are, both useful and wanted, thanks. The last thing I've seen with 3.4.4 is this:

Re: [PATCH 3/3] Btrfs-progs: add 's' option for 'btrfs subvolume list'

2012-07-04 Thread David Sterba
On Fri, Jun 29, 2012 at 06:00:38PM +0800, Liu Bo wrote: We want 'btrfs subvolume list' to act as 'ls', which means that we can not only list out all the subvolumes we have, but also list each single one. So this patch add 's' option to show a single one: $ ./btrfs sub list /mnt/btrfs/ ID

Re: btrfs_print_tree?

2012-07-04 Thread David Sterba
On Sun, Jul 01, 2012 at 06:16:55PM +0800, Jeff Liu wrote: On 07/01/2012 05:49 PM, Zhi Yong Wu wrote: On Sun, Jul 1, 2012 at 5:41 PM, Mike Fleetwood No, i also did as this, but didn't find out who will invoke this function. From above output, we only saw that it invokes itself one time.

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread David Sterba
On Wed, Jul 04, 2012 at 10:18:34PM +0200, Alexander Block wrote: It might be worth to note in the comment, that tmp_buff should be large enough to hold the item from the left tree. Can it happen that the right tree has a different leafsize? This function is only to be used for for the

Re: BTRFS fsck apparent errors

2012-07-04 Thread David Sterba
On Wed, Jul 04, 2012 at 10:46:21PM +0700, Fajar A. Nugraha wrote: Is it just mount/umount without any other activity? Yes Is the fs fragmented Not sure how to check that quickly (or aged), Over 1 year, so yes almost full, df says 83% used, so probably yes (depending on how you

[PATCH] btrfs-progs: mkfs: rename nodiscard option to K

2012-07-17 Thread David Sterba
The original patch named the option -T, mkfs.xfs uses -K let's keep it same. Signed-off-by: David Sterba dste...@suse.cz --- Based on 8935d8436147f (current master) not yet tagged as 0.20, I hope it's still time to fix it before it's released. Sorry for not sending the patch earlier. man

[PATCH] btrfs-progs: mkfs: create root directory with 755 permissions

2012-07-17 Thread David Sterba
That's what all other mkfs do and there's no reason for 0555. Signed-off-by: David Sterba dste...@suse.cz --- utils.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/utils.c b/utils.c index aade9e2..cfe7c49 100644 --- a/utils.c +++ b/utils.c @@ -614,7 +614,7 @@ int

[PATCH v2] btrfs-progs: mkfs: rename nodiscard option to K

2012-07-17 Thread David Sterba
The original patch named the option -T, mkfs.xfs uses -K let's keep it same. Signed-off-by: David Sterba dste...@suse.cz --- v1-v2: original patch at http://comments.gmane.org/gmane.comp.file-systems.btrfs/16287 listed the shot option, dunno where it got lost, adding it now. man/mkfs.btrfs.8

[PATCH] btrfs-progs: fsck: understand the -s option

2012-07-17 Thread David Sterba
Short options have to be repeated at the getopt_long call. Signed-off-by: David Sterba dste...@suse.cz --- btrfsck.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index 088b9f4..2e81adc 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -3499,7 +3499,7

[PATCH] btrfs-progs: sort devices by id in fi show

2012-07-17 Thread David Sterba
Devids are printed in descending order now, switch it to ascending. Signed-off-by: David Sterba dste...@suse.cz --- btrfs-show.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfs-show.c b/btrfs-show.c index 8210fd2..2a85932 100644 --- a/btrfs-show.c +++ b/btrfs

Re: [PATCH] Btrfs: add DEVICE_READY ioctl

2012-07-17 Thread David Sterba
On Fri, Jun 22, 2012 at 08:12:52PM +0200, Goffredo Baroncelli wrote: On 06/21/2012 10:10 PM, Josef Bacik wrote: This will be used in conjunction with btrfs device ready dev. This is needed for initrd's to have a nice and lightweight way to tell if all of the devices needed for a file

Re: [PATCH 0/5] btrfs: lz4/lz4hc compression

2012-07-17 Thread David Sterba
On Sat, Jul 07, 2012 at 11:06:44PM +0200, Jan Killius wrote: I get lots of kick the bucket messages with the newest lz4 patches. Is there any way to debug/fix this ? That was a debugging message, harmless, will be removed in another round. david -- To unsubscribe from this list: send the line

Re: [PATCH 0/2] Support for small units in display

2012-07-17 Thread David Sterba
On Mon, Jul 09, 2012 at 05:27:41PM +, Pierre Carrier wrote: I didn't test the initial patches enough. A second round is coming. Please indicate the updated version by eg. adding a v2 to the subject of the cover letter and describe the changes, makes it more clear to maintainers/reviewers

Re: [PATCH 1/2] utils.c: fix sizes in B malloc in pretty_sizes

2012-07-17 Thread David Sterba
On Mon, Jul 09, 2012 at 05:29:34PM +, Pierre Carrier wrote: Before, sizes below 1KB are still displayed in KB, but without a unit. Does it matter when the only size below 1KB one can get is 0 ? Though for sake of consistency the B unit could be there in that case as well. -- To unsubscribe

Re: [PATCH 2/2] utils.c: offer to limit divisions in pretty_sizes

2012-07-17 Thread David Sterba
On Mon, Jul 09, 2012 at 05:30:21PM +, Pierre Carrier wrote: Dirty hack to allow inspection of sizes in lower units. A commandline option would suit better IMHO. If this is a one-shot task to find the sizes expressed with a different multiplier, then I don't understhand the env variable

Re: [PATCH 2/2] Btrfs: kill root from btrfs_is_free_space_inode

2012-07-17 Thread David Sterba
On Tue, Jul 10, 2012 at 07:28:39PM +0800, Liu Bo wrote: Since root can be fetched via BTRFS_I macro directly, we can save an args for btrfs_is_free_space_inode(). I see a great opportunity to rename the function :) It does not cover just the free space inode anymore and it'll be more confusing

Re: [PATCH v3] Btrfs: improve multi-thread buffer read

2012-07-18 Thread David Sterba
On Mon, Jul 16, 2012 at 02:05:25PM -0400, Liu Bo wrote: v2-v3: adopt kernel native pagevec instead of kmalloc. Do we really use the pagevec features here? It looks more like a fancy way to employ a simple array ... And with a simple array we could use 16 page pointers covering 16 * 4k = 64k

Re: [PATCH v2] Btrfs: allow mount -o remount,compress=no

2012-07-18 Thread David Sterba
On Fri, Jul 13, 2012 at 10:19:14AM -0500, Mitch Harder wrote: I was testing the lz4(hc) patches, and I found the the compression INCOMPAT flags are not being updated using the method in this patch. The compression INCOMPAT flags are generally checked and updated in the open_ctree() function.

Re: [PATCH v3] Btrfs: improve multi-thread buffer read

2012-07-18 Thread David Sterba
On Thu, Jul 19, 2012 at 09:11:06AM +0800, Liu Bo wrote: On 07/18/2012 07:57 PM, David Sterba wrote: On Mon, Jul 16, 2012 at 02:05:25PM -0400, Liu Bo wrote: v2-v3: adopt kernel native pagevec instead of kmalloc. Do we really use the pagevec features here? It looks more like a fancy

Re: [PATCH v3 1/1] Btrfs: Check INCOMPAT flags on remount and add helper function

2012-07-24 Thread David Sterba
We don't need a helper for every incompatibility bit, let's do it in a more generic way as suggested below [modulo syntax errors]: On Fri, Jul 20, 2012 at 05:16:41PM -0500, Mitch Harder wrote: --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3103,6 +3103,19 @@ void

Re: [PATCH] Xfstests: add btrfs snapshot function test

2012-07-24 Thread David Sterba
On Sat, Jul 21, 2012 at 11:46:00AM +0800, Liu Bo wrote: From: Zhou Bo zhoub-f...@cn.fujitsu.com This patch adds btrfs snapshot function test to xfstests. Signed-off-by: Zhou Bo zhoub-f...@cn.fujitsu.com --- 285 | 365 +++

Re: [PATCH v4] Btrfs: Check INCOMPAT flags on remount and add helper function

2012-07-24 Thread David Sterba
the new helper function when defragmenting with explicit lzo compression and when setting the default subvolume. Signed-off-by: Mitch Harder mitch.har...@sabayonlinux.org Thanks! Reviewed-by: David Sterba dste...@suse.cz -- To unsubscribe from this list: send the line unsubscribe linux-btrfs

Re: No/bad auto-detection of fs type for small volumes (related to mixed metadata/data?)

2012-07-26 Thread David Sterba
On Tue, Jul 24, 2012 at 08:39:36PM -0400, Marios Titas wrote: When I create a btrfs volume of size strictly less than 256 MiB then if I do mount /dev/sdb1 /mnt/test the kernel tries unsuccessfully to do the mount with many other file systems before successfully trying with btrfs. For

[next] kernel BUG at fs/btrfs/relocation.c:2331!

2012-07-26 Thread David Sterba
Hi, while testing a branch that'll become the next pull or so, I've hit $subj crash. (top commit: Chris Mason [cmason/next] Btrfs: uninit variable fixes in send/receive) # btrfs fi df /mnt/sdc Data: total=34.01GB, used=26.53GB System, DUP: total=8.00MB, used=12.00KB System: total=4.00MB,

Re: mkfs devices ordering relevant with devices of different sizes?

2012-07-26 Thread David Sterba
On Wed, Jul 25, 2012 at 03:26:20PM +0200, Cyril B. wrote: When creating a filesystem with devices of different sizes, the resulting filesystem total size depends on the device order specified to mkfs. When the smaller device is specified first, the second (larger) device is seen as the

Re: [PATCH 2/2] Btrfs: fix the snapshot that should not exist

2012-07-27 Thread David Sterba
On Fri, Jul 27, 2012 at 04:52:21PM +0900, Hidetoshi Seto wrote: (2012/07/26 15:57), Miao Xie wrote: btrfs_abort_transaction(trans, root, ret); goto fail; } @@ -1386,13 +1408,13 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, */

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread David Sterba
On Thu, Aug 02, 2012 at 08:11:58AM -0400, Josef Bacik wrote: On Thu, Aug 02, 2012 at 04:46:44AM -0600, Liu Bo wrote: On 08/02/2012 04:25 AM, Josef Bacik wrote: We need an smb_mb() before waitqueue_active to avoid missing wakeups. Before Mitch was hitting a deadlock between the ordered

Re: BTRFS crash on mount with 3.4.4

2012-08-02 Thread David Sterba
On Tue, Jul 31, 2012 at 06:01:04PM -0700, Marc MERLIN wrote: On Tue, Jul 31, 2012 at 11:04:12AM -0700, Marc MERLIN wrote: My kernel crashed for some other reason, and now I can't mount my btrfs filesystem. I don't care about the data, it's backed up. I'll compile a 3.5 kernel, but is

Re: kernel BUG at fs/btrfs/extent-tree.c:5038 (linux 3.4.7)

2012-08-02 Thread David Sterba
On Thu, Aug 02, 2012 at 03:41:03PM +0200, Olivier Bonvalet wrote: Yes... it's a copy from my /var/log/kern.log. Is it really disabled ? I was mistaken, it really is enabled unconditionally in ctree.h:55. Josef says that the V0 extent refs are not used for a long time, so the question is how did

Re: [PATCH v2] Btrfs: remove superblock writing after fatal error

2012-08-02 Thread David Sterba
On Thu, Aug 02, 2012 at 03:46:50PM +0200, Arne Jansen wrote: Anyway, for now, our error flag has only been stored in memory, so what about just keep it until we find a graceful way? Yeah, we need this patch to restore consistency. We can define a fixed area on disk (e.g. behind the

Re: [PATCH V3 2/2] Btrfs: fix the snapshot that should not exist

2012-08-08 Thread David Sterba
On Sat, Aug 04, 2012 at 01:53:28PM +0800, Miao Xie wrote: But I'm not sure these two bugs is the same, so I need the test tool of David to look into it. Attached. It's a set of scripts and has a few assumptions hardcoded, like where the tar srouce is and the name of extracted directory, so

Re: [RFC] [PATCH] Btrfs: manage metadata cache ourselves

2012-08-08 Thread David Sterba
On Wed, Aug 01, 2012 at 05:06:45PM -0400, Josef Bacik wrote: === PLEASE REVIEW AND TEST THIS CAREFULLY I've dug this patch out of the bin and cleaned it up but who knows what kind of crust I've missed. This makes the create empty files until the file system

Re: kernel BUG at fs/btrfs/extent-tree.c:5038 (linux 3.4.7)

2012-08-08 Thread David Sterba
On Sun, Aug 05, 2012 at 04:11:47PM +0200, Olivier Bonvalet wrote: On 05/08/2012 10:57, Chris Samuel wrote: On 08/04/2012 08:41 AM, Olivier Bonvalet wrote: Is there something I can do to fix that ? (the mount option recovery didn't help here) I've seen someone (perhaps Marc Merlin)

Re: [PATCH] Btrfs: don't allocate a seperate csums array for direct reads

2012-08-08 Thread David Sterba
On Fri, Aug 03, 2012 at 04:51:55PM -0400, Josef Bacik wrote: We've been allocating a big array for csums instead of storing them in the io_tree like we do for buffered reads because previously we were locking the entire range, so we didn't have an extent state for each sector of the range.

Re: [PATCH] Btrfs: remove mnt_want_write call in btrfs_mksubvol

2012-08-08 Thread David Sterba
On Sat, Aug 04, 2012 at 01:39:25AM +0200, Alexander Block wrote: On Fri, Aug 3, 2012 at 11:13 PM, Josef Bacik jba...@fusionio.com wrote: I'm confused, this isn't here in btrfs-next, so is this a problem still? It's in linus current master. Lio Bo moved the call out of btrfs_mksubvol into the

Re: [PATCH] Btrfs: fix enospc problems when deleting a subvol

2012-08-08 Thread David Sterba
requirements for this. With this patch I can now delete a subvol on a problem image Dave Sterba sent me. Thanks, Thanks for the fix, tested on my side as well. Reported-by: David Sterba d...@jikos.cz Tested-by: David Sterba dste...@suse.cz Signed-off-by: Josef Bacik jba...@fusionio.com --- fs

Re: BUG on 3.5.0

2012-08-08 Thread David Sterba
Hi, On Wed, Aug 08, 2012 at 06:18:19PM +0200, Lluís Batlle i Rossell wrote: I attach dmesg.txt, and the disasm of insert_inline_extent_backref. That disasm was a bit tricky; my objdump does not seem to understand the btrfs.ko. thanks, added a few bits to the picture [ 6095.255745]

Re: [RFC PATCH] Btrfs: fix full backref problem when inserting shared block reference

2012-08-09 Thread David Sterba
On Thu, Aug 09, 2012 at 11:10:17AM +0800, Miao Xie wrote: I chose the 1st way to fix it. The least I can say now is that it fixed the crash! The approach is minimalistic and I think we can take it for now. I didn't review it, only tested with reproducer you described plus modified the numbers up

Re: [RFC PATCH] Btrfs: fix full backref problem when inserting shared block reference

2012-08-09 Thread David Sterba
On Thu, Aug 09, 2012 at 08:48:02AM +0200, David Sterba wrote: and down, no problems so far, and the wikipedia test-subvol stresstest that caused trouble to one of your patches is also ok. I'll do some more testing on other machines and will report problems eventually. So it won't be so easy

Re: [BUG] btrfs dev del causes 'possible circular locking dependency detected'

2012-08-09 Thread David Sterba
On Thu, Aug 09, 2012 at 05:36:54PM +0200, Stefan Behrens wrote: Aug 9 16:02:21 qvarne kernel: [ 543.479460] - #2 (fs_info-cleaner_mutex){+.+...}: Aug 9 16:02:21 qvarne kernel: [ 543.541341][810da005] lock_acquire+0x95/0x150 Aug 9 16:02:21 qvarne kernel: [ 543.612269]

Re: Can't umount a read-only FS ?

2012-08-15 Thread David Sterba
Hi, On Wed, Aug 15, 2012 at 07:32:45PM +0200, Olivier Bonvalet wrote: On 15/08/2012 19:28, Olivier Bonvalet wrote: I have a strange problem with a btrfs partition : after an error, btrfs was forced readonly. I forgot, it was set readonly after that error : Aug 15 09:44:33 sofia

[no subject]

2012-08-17 Thread David Sterba
On Fri, Aug 17, 2012 at 09:45:20AM +0800, Liu Bo wrote: On 08/15/2012 06:12 PM, Lluís Batlle i Rossell wrote: some time ago we discussed on #btrfs that the nocow attribute for files wasn't working (around 3.3 or 3.4 kernels). That was evident by files fragmenting even with the

Re: State of nocow file attribute

2012-08-21 Thread David Sterba
On Fri, Aug 17, 2012 at 11:30:14PM +0800, Liu Bo wrote: IMO the following is better, just make use of the original check. If you agree with this, I'll send it as a patch :) I think it's cleaner to keep all flags that get inherited from the directory - new file at one place, ie

Re: btrfs and mdadm raid 6

2012-08-21 Thread David Sterba
On Mon, Aug 20, 2012 at 11:06:03PM +0600, Roman Mamedov wrote: 2) On filesystem converted with btrfs-convert the metadata allocation is unnecessarily large due to some other, conversion-related reasons; but this can be fixed with btrfs filesystem balance -musage=5 /mount/point (do several runs

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

2012-08-21 Thread David Sterba
On Sun, Aug 19, 2012 at 03:05:11PM -0500, C Anthony Risinger wrote: On Sun, Aug 19, 2012 at 2:51 PM, dg1727 dg1...@hushmail.com wrote: permissions of the directories in /dev are drwx-- for the NTFS and dr-xr-xr-x for the Btrfs. How can the OS be set up so that the Btrfs will automount

Re: Computer crash, btrfs partition errors

2012-08-21 Thread David Sterba
Hi, On Fri, Aug 17, 2012 at 09:02:07PM -0700, Not Zippy wrote: My sabayon box locked up while doing a repo sync, now I am getting the following errors on one directory on my btrfs partition Can you be more specific how did you get to the state? Did you see any related error messages in syslog

Re: [PATCH] Btrfs-progs: seg fault in get_label_unmounted

2012-08-22 Thread David Sterba
On Wed, Aug 15, 2012 at 04:29:53PM +0800, Anand jain wrote: From: Anand Jain anand.j...@oracle.com btrfs f l / No valid Btrfs found on / Segmentation fault (core dumped) Patches fixing this have been sent like 4 times, last one was from Alexander's 'btrfs prop', that modified it a bit more

Re: Computer crash, btrfs partition errors

2012-08-22 Thread David Sterba
On Tue, Aug 21, 2012 at 09:50:58AM -0700, Not Zippy wrote: Thanks for the analysis, unfortunately I get the same assert error when I attempt to run the repair from the compiled source. # ./work/builds/btrfs-progs/btrfsck usage: btrfsck dev Btrfs Btrfs v0.19 'git describe' would be more

Re: How to get Btrfs on 2nd partition of USB HDD to automount as read/write

2012-08-22 Thread David Sterba
On Tue, Aug 21, 2012 at 03:28:22PM -0400, dg1727 wrote: Thanks a lot for these answers. As an exercise, how would I track that patch so I can tell when it has been released? Pointing me to a webpage that covers this would be fine. You can easily check that the patch appears in the main

Re: Hung I/O, Kernel BUG with corrupt leaf (bad key order)

2012-08-22 Thread David Sterba
On Tue, Aug 14, 2012 at 01:20:36PM -0500, Peter Marheine wrote: Hi all, I'm running btrfs in a 3-disk RAID1 configuration. After a hard power-off, I'm seeing a lot of hung I/O tasks on this volume, apparently due to a corrupt leaf. I first noticed the problem on kernel 3.4.7, and it's

Re: linux 3.5.0: BTRFS error in compress_file_range:581 (failed to join transaction)

2012-08-22 Thread David Sterba
On Tue, Aug 14, 2012 at 09:00:53PM -0700, Marc MERLIN wrote: What does the 'ret' shows? Is it -ENOSPC? I got nothing else in my logs. Unless it was a second error from a filesystem that went RO, there should be more than the Failed to join transaction message, and the first occurence of

Re: raw partition or LV for btrfs?

2012-08-22 Thread David Sterba
On Tue, Aug 14, 2012 at 07:23:48AM -0400, Calvin Walton wrote: A patch to add support for `btrfs fi defrag -c none file` or so would make this easier, and shouldn't be to hard to do :) This one is on my list of 'nice to have', it's needed to extend the ioctl to understand 'none' as to actually

Re: [PATCH] Btrfs: fix a dio write regression

2012-08-22 Thread David Sterba
Hi, a few minor style comments, On Wed, Aug 22, 2012 at 06:11:14PM +0800, bo.li@oracle.com wrote: --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5993,10 +5993,24 @@ unlock: * in the case of read we need to unlock only the end area that we * aren't using if there is any

Re: [PATCH] Btrfs-progs: replace find_mount_root from send code

2012-08-24 Thread David Sterba
On Thu, Aug 23, 2012 at 10:54:54AM +0200, Robert Buhren wrote: I'm on linux-3.6-rc2 and btrfs-progs from git. Please try it with Chris' for-linus branch, it contains a fair portion of send-related fixes and from brief look they may be related to the errors you see. david -- To unsubscribe from

Re: Computer crash, btrfs partition errors

2012-08-24 Thread David Sterba
On Wed, Aug 22, 2012 at 10:19:13AM -0700, Not Zippy wrote: The full output of the btrfs-debug-tree is 190MB compressed, did you want it still ? That's not the biggest one I've received :) (2.5G xz compressed) Please note that it contains filenames, so you may want to filter them out with sed

Re: [PATCH] Btrfs: fix ordered extent leak when failing to start a transaction

2012-08-24 Thread David Sterba
On Wed, Aug 22, 2012 at 11:13:25AM +0800, bo.li@oracle.com wrote: We cannot just return error before freeing ordered extent and releasing reserved space when we fail to start a transacion. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/inode.c |7 +-- 1 files

Re: [PATCH 1/3] writeback: change nr_pages_dirtied argument into local variable

2012-08-24 Thread David Sterba
On Thu, Aug 23, 2012 at 05:06:19PM +0900, Namjae Jeon wrote: 2012/8/19, Fengguang Wu fengguang...@intel.com: On Sat, Aug 18, 2012 at 05:48:29AM -0400, Namjae Jeon wrote: There is no reason nr_pages_dirtied is argument anymore. because nr_pages_dirtied value from caller is not used in

Re: [PATCH] Btrfs: use larger limit for transition of logical to inode

2012-08-24 Thread David Sterba
On Thu, Aug 23, 2012 at 06:24:02PM +0800, Liu Bo wrote: Hum. I added this because I wanted to avoid allocations PAGE_SIZE. We're doing kmalloc GFP_NOFS with whatever one enters as size, I'm not sure that's a good idea without any sanitizing. Yeah, I agree. So we do need to make

Re: [PATCH] Btrfs-progs: add options to change size in logical to inode transition

2012-08-24 Thread David Sterba
On Thu, Aug 23, 2012 at 04:56:28PM +0800, Liu Bo wrote: Add an option 's' to set size in logical to inode transition, then we are able to read all the refs to the logical address. Signed-off-by: Liu Bo bo.li@oracle.com --- cmds-inspect.c | 18 -- 1 files changed, 12

Re: [PATCH 1/2] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag

2012-08-24 Thread David Sterba
On Thu, Aug 23, 2012 at 07:01:33PM +0800, Liu Bo wrote: We're going to use this flag EXTENT_DEFRAG to indicate which range belongs to defragment so that we can implement snapshow-aware defrag: We set the EXTENT_DEFRAG flag when dirtying the extents that need defragmented, so later on

Re: Tail packing

2012-09-01 Thread David Sterba
On Fri, Aug 31, 2012 at 04:40:36PM +0200, Ben Wreder wrote: The disk format description implies that btrfs should be able to support tail packing. I just did some experimentation, and while small files are packed, it seems that files occupying more than one block are not. For example, a lot of

Re: rfc: fuzz testing by direct writes to device

2012-09-01 Thread David Sterba
On Sat, Sep 01, 2012 at 06:03:32PM -0700, Shentino wrote: This whole subject was also about using sed to corrupt-o-magic a file's data on disk. Is this an acceptable method for testing? Starting with kernels 3.4 the error handling has been improved, namely for the EIO, so it shouldn't take

Re: Tail packing

2012-09-03 Thread David Sterba
On Mon, Sep 03, 2012 at 09:23:10AM +0800, Li Zefan wrote: If the actual size of the file is 3916 bytes, no matter how compressible it is, it won't be inlined. You're right, sorry for misinformation. -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a

Re: rfc: fuzz testing by direct writes to device

2012-09-05 Thread David Sterba
On Sun, Sep 02, 2012 at 04:43:48AM -0700, Shentino wrote: I assume the same results are expected during a scrub as during a normal read? yes I've tested this on an 2 disk data/raid1, metadata/raid1 with a running dd over one of the devices continually and using the filesystem. It was

Re: [PATCH 1/2 RESEND] vfs: re-implement writeback_inodes_sb(_nr)_if_idle() and rename them

2012-09-05 Thread David Sterba
functions is cumbersome, so rename them to try_to_writeback_inodes_sb(_nr). This idea came from Christoph Hellwig. Some code is from the patch of Kamal Mostafa. Signed-off-by: Miao Xie mi...@cn.fujitsu.com Tested-by: David Sterba dste...@suse.cz --- Many users who use btrfs met the deadlock

Re: [PATCH 4/7] Btrfs: use a slab for ordered extents allocation

2012-09-05 Thread David Sterba
On Wed, Aug 29, 2012 at 12:12:50PM +0800, Miao Xie wrote: The ordered extent allocation is in the fast path of the IO, so use a slab to improve the speed of the allocation. Good. Size of the struct is 280, so this will fall into the size-512 bucket, giving 8 objects per page, while own slab

Re: [PATCH 6/7] Btrfs: fix corrupted metadata in the snapshot

2012-09-05 Thread David Sterba
On Wed, Aug 29, 2012 at 12:13:16PM +0800, Miao Xie wrote: 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

Re: [PATCH 1/3] btrfs: remove unnecessary -ENOMEM BUG_ON check in extent-tree.c/exclude_super_stripes

2012-09-06 Thread David Sterba
On Thu, Sep 06, 2012 at 02:40:41PM +0800, Wang Sheng-Hui wrote: The memory allocation failure is BUG_ON in add_excluded_extent (following the code path) and btrfs_rmap_block. No need to BUG_ON -ENOMEM inside exclude_super_stripes itself. No please. Its return value is always 0, and useless

Re: [PATCH 2/3] btrfs: remove unnecessary -ENOMEM BUG_ON check in extent-tree.c/btrfs_alloc_logged_file_extent

2012-09-06 Thread David Sterba
On Thu, Sep 06, 2012 at 02:41:02PM +0800, Wang Sheng-Hui wrote: The memory allocation failure is BUG_ON in add_excluded_extent (following the code path). No need to BUG_ON -ENOMEM inside btrfs_alloc_logged_file_extent. This indirectly calls __set_extent_bit that does BUG_ON on memory

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

2012-09-06 Thread David Sterba
On Fri, Aug 31, 2012 at 01:36:54PM +0800, Liu Bo wrote: The new created file should not only inherit the NODATACOW flag, but also honor NODATASUM flag, because we must do COW on a file extent with checksum. I was not entierly correct when suggesting to move NODATASUM to inherit_iflags. Se

[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
know the code and otherwise would look there before consulting the documentation. The patch implements 2.2.1. david -8--- From: David Sterba dste...@suse.cz It's safe to turn off checksums for a zero sized file. http://thread.gmane.org/gmane.comp.file-systems.btrfs

[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

Re: Symlink to a long filename filename too long error

2012-09-10 Thread David Sterba
On Mon, Sep 10, 2012 at 09:34:06AM -0700, Marc MERLIN wrote: Due to some filesystem corruption on my source device, I had a very long file as a symlink target that btrfs wasn't able to recreate. Mind you, in this case it's clearly not something I need, but is it expected/known that ext4 can

Re: [PATCH v2 2/2] Btrfs: snapshot-aware defrag

2012-09-10 Thread David Sterba
On Thu, Sep 06, 2012 at 09:10:52AM +0800, Liu Bo wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any sharing from other snapshots. The balancing code will preserve the sharing, and defrag needs to grow this as well. Now we're able to fill the blank with

<    4   5   6   7   8   9   10   11   12   13   >