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

Re: enquiry about defrag

2012-09-11 Thread David Sterba
On Tue, Sep 11, 2012 at 07:12:58PM +0800, ching wrote: 1. According to btrfs wiki, defragment a COW file will produce two unrelated files. Does it apply to the autodefrag mount option? can anybody helps on question 1? The data blocks associated with the files (that were originally

Re: [PATCH v3] Btrfs: fix a bug of per-file nocow

2012-09-13 Thread David Sterba
breaks the extent into three parts 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. Signed-off-by: Liu Bo bo.li@oracle.com Reviewed-by: David Sterba dste...@suse.cz -- To unsubscribe

Re: do_sync_write and do_sync_read

2012-09-13 Thread David Sterba
On Fri, Sep 14, 2012 at 12:08:35AM +0800, Sonu wrote: trying to locate do_sync_read (write) any idea where are they ? fs/read_write.c -- 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

[PATCH] btrfs: return EPERM upon rmdir on a subvolume

2012-09-13 Thread David Sterba
A subvolume cannot be deleted via rmdir, but the error code ENOTEMPTY is confusing. Return EPERM instead, as this is not permitted. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/inode.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 01:50:24PM +0800, anand jain wrote: btrfs send introduced a part of code to read kernel-data from user-end using pipe. We need this part of code to be useable outside of send sub-cmd, so that developing service sub-cmd can use it. What's 'service sub-cmd' please?

Re: [PATCH 2/5] Btrfs: fix trans block rsv regression

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 04:58:04PM +0800, Liu Bo wrote: --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -306,9 +306,17 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root, WARN_ON(type != TRANS_JOIN type != TRANS_JOIN_NOLOCK

Re: [PATCH 4/5] Btrfs: cleanup fs_info-hashers

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 04:58:06PM +0800, Liu Bo wrote: fs_info-hashers is now an obsolete one. Signed-off-by: Liu Bo bo.li@oracle.com Reviewed-by: David Sterba dste...@suse.cz -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord

Re: [PATCH 3/5] Btrfs: cleanup for duplicated code in find_free_extent

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 04:58:05PM +0800, Liu Bo wrote: There is already an 'add free space' phrase in front of this one, we needn't to redo it. Signed-off-by: Liu Bo bo.li@oracle.com Yes, the check is duplicate and the values cannot change inbetween, moreover this calls the

Re: [PATCH 2/5] Btrfs: fix trans block rsv regression

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 07:25:45PM +0800, Liu Bo wrote: On 09/14/2012 07:15 PM, David Sterba wrote: On Fri, Sep 14, 2012 at 04:58:04PM +0800, Liu Bo wrote: --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -306,9 +306,17 @@ static struct btrfs_trans_handle *start_transaction

Re: [PATCH 5/5] Btrfs: kill obsolete arguments in btrfs_wait_ordered_extents

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 08:45:16AM -0400, Josef Bacik wrote: On Fri, Sep 14, 2012 at 02:58:07AM -0600, Liu Bo wrote: nocow_only is now an obsolete argument. Why is it obsolete, it looks like it's being used to me? Thanks, It's always 0 so the removed code never executes. I'm tracking

Re: [PATCH 2/5] Btrfs: fix trans block rsv regression

2012-09-14 Thread David Sterba
On Fri, Sep 14, 2012 at 09:01:36PM +0800, Liu Bo wrote: Fine, please run xfstests 068 till it hits a BUG_ON inside either btrfs_delete_delayed_dir_index or btrfs_insert_delayed_dir_index. 068 is the freezer test, we've seen enough issues in the freezing area recently, I'm curious if you were

Re: [PATCH] Btrfs: using for_each_set_bit_from to simplify the code

2012-09-14 Thread David Sterba
...@trendmicro.com.cn Reviewed-by: David Sterba dste...@suse.cz -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-14 Thread David Sterba
On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: div_factor{_fine} has been implemented for two times, cleanup it. And I move them into a independent file named math.h because they are common math functions. You removed the sanity checks: - if (factor = 0) -

Re: [RFC][PATCH] Btrfs-progs: Fix compiler warnings on PPC64.

2012-09-14 Thread David Sterba
On Wed, Sep 12, 2012 at 04:21:56PM -0700, cli...@linux.vnet.ibm.com wrote: Defining __KERNEL__ before the file asm/types.h, or any file that includes this file, will let PPC64 know to use unsigned long long for u64 instead. This patch adds the defines and fixes the print warnings on PPC64.

Re: [PATCH] Btrfs: use vfree instead of kfree

2012-09-16 Thread David Sterba
On Fri, Sep 14, 2012 at 01:05:09PM -0400, Josef Bacik wrote: We are vmalloc()'ing the fspath now so we should be vfree'ing it and not kfreeing it. Thanks, Reported-by: Dave Sterba d...@jikos.cz Signed-off-by: Josef Bacik jba...@fusionio.com IMO better to fold this change into the patch

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-17 Thread David Sterba
On Mon, Sep 17, 2012 at 12:48:10PM +0800, Anand Jain wrote: btrfs send introduced a part of code to read kernel-data from user-end using pipe. We need this part of code to be useable outside of send sub-cmd, so that developing service sub-cmd can use it. What's 'service sub-cmd'

Re: [RFC inside][PATCH] btrfs: allow setting NOCOW for a zero sized file via ioctl

2012-09-17 Thread David Sterba
Hi, Josef, I noticed that you did not add the patch to btrfs-next. This is understandable for a RFC patch of course, but I'd like to ask you to add it into the queue, so people testing -next have a chance to give it a try. Thanks, david -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 1/2] Btrfs: cleanup duplicated division functions

2012-09-17 Thread David Sterba
On Mon, Sep 17, 2012 at 10:21:00AM +0800, Miao Xie wrote: On fri, 14 Sep 2012 15:54:18 +0200, David Sterba wrote: On Thu, Sep 13, 2012 at 06:51:36PM +0800, Miao Xie wrote: div_factor{_fine} has been implemented for two times, cleanup it. And I move them into a independent file named math.h

Re: [PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot()

2012-09-17 Thread David Sterba
On Thu, Sep 06, 2012 at 06:00:32PM +0800, Miao Xie wrote: This patch fixes the following problem: - If we failed to deal with the delayed dir items, we should abort transaction, just as its comment said. Fix it. - If root reference or root back reference insertion failed, we should

Re: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-18 Thread David Sterba
On Tue, Sep 18, 2012 at 09:19:40AM +0100, Hugo Mills wrote: On Tue, Sep 18, 2012 at 10:19:30AM +0600, Roman Mamedov wrote: On Tue, 18 Sep 2012 10:31:41 +0800 Miao Xie mi...@cn.fujitsu.com wrote: On tue, 18 Sep 2012 10:30:17 +0900, Hidetoshi Seto wrote: This patch adds mount-option

Re: [PATCH 1/2] Btrfs: make space to keep default mount options

2012-09-18 Thread David Sterba
On Tue, Sep 18, 2012 at 10:28:48AM +0900, Hidetoshi Seto wrote: This patch create space to hold default mount option, and to use saved default mount option change super.c to read default mount option first when mount devices. Signed-off-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com ---

Re: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-18 Thread David Sterba
On Tue, Sep 18, 2012 at 10:30:17AM +0900, Hidetoshi Seto wrote: Now, the command can set/get 24 options. These options are equal to mount options which store in fs_info/mount-opt. Some of the options do not IMO fit for being default, like DEGRADED, maybe RECOVERY, maybe SKIP_BALANCE. +

Re: [PATCH] Btrfs: fix the missing error information in create_pending_snapshot()

2012-09-18 Thread David Sterba
On Tue, Sep 18, 2012 at 01:52:38PM +0800, Miao Xie wrote: The macro btrfs_abort_transaction() can get the line number of the code where the problem happens, so we should invoke it in the place that the error occurs, or we will lose the line number. Thanks, that's it! AFAICS it's based on

[PATCH] btrfs: move transaction aborts to the point of failure

2012-09-18 Thread David Sterba
Call btrfs_abort_transaction as early as possible when an error condition is detected, that way the line number reported is useful and we're not clueless anymore which error path led to the abort. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.h |5 fs/btrfs/extent

Re: [PATCH] Btrfs: fix off-by-one in file clone

2012-09-19 Thread David Sterba
of such calculations, I didn't spot any other instances, but another review round would not harm. Reviewed-by: David Sterba dste...@suse.cz -- 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 http

Re: [PATCH 1/2] Btrfs: make space to keep default mount options

2012-09-20 Thread David Sterba
On Wed, Sep 19, 2012 at 05:31:25PM +0900, Hidetoshi Seto wrote: + info-mount_opt = info-super_copy-default_mount_opt; the options have to respect some priority, eg. when I set default options to a filesystem, but mount with a different set, I expect that the explicit flags apply

Re: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-20 Thread David Sterba
On Wed, Sep 19, 2012 at 05:32:16PM +0900, Hidetoshi Seto wrote: (2012/09/18 11:31), Miao Xie wrote: On tue, 18 Sep 2012 10:30:17 +0900, Hidetoshi Seto wrote: This patch adds mount-option command. The command can set/get default mount options. Now, the command can set/get 24 options.

Re: R: [PATCH 2/2] Btrfs-progs: add mount-option command

2012-09-20 Thread David Sterba
On Tue, Sep 18, 2012 at 12:03:47PM +0200, Goffredo Baroncelli kreij...@libero.it wrote: Why it was not provided a way to clear a *single* flag ? To me it seems a bit too long to clear all the flag (btrfs mount-option clear) and then set the right one. As user interface I suggest something

Re: enquiry about autodefrag option

2012-09-20 Thread David Sterba
On Thu, Sep 20, 2012 at 07:36:53AM +0800, ching wrote: 2. AFAIK, autodefrag detects small random writes into files and queues them up for an automatic defrag process, so the filesystem will defragment itself while it's used. If the system reboot/crash/remount-ro, will the

Re: [PATCH V4 5/7] Btrfs-progs: restructure list_subvolumes

2012-09-20 Thread David Sterba
On Tue, Sep 18, 2012 at 07:06:49PM +0800, Miao Xie wrote: The current code of list_subvols() has very bad scalability, if we want to add new filter conditions or new sort methods, we have to modify lots of code. I've briefly skimmed through the patch, not a short one, IMO the right way to go.

Re: [PATCH] Btrfs + Btrfs-progs: make pipe functions re-usable

2012-09-20 Thread David Sterba
On Tue, Sep 18, 2012 at 01:33:29PM +0800, Anand Jain wrote: 'btrfs service history mnt|dev' is basically to show the list of cli/gui commands which are successfully run on the btrfs as part of its - creation (may be), configuration and maintenance. Is it modelled after ZFS 'zpool

Re: [PATCH V2 1/2] Btrfs: cleanup duplicated division functions

2012-09-20 Thread David Sterba
On Thu, Sep 20, 2012 at 10:57:54AM +0800, Miao Xie wrote: Because those functions are mostly used on the hot path, and we are sure the parameters are right in the most cases, we don't add complex checks for the parameters. But in the other place, we must check and make sure the parameters are

Re: btrfs: open_ctree failed on external usb drive

2012-09-20 Thread David Sterba
On Sun, Sep 16, 2012 at 03:24:53PM +0200, Sébastien Kalt wrote: I'm running Debian Sid, 3.2.0-3-amd64 kernel and Btrfs v0.19 (0.19+20120328-8 according to dpkg), using XFCE4 and dolphin as a file manager. The usb drive is auto-mounting, and I'm accessing it with dolphin or console. I always

Re: enquiry about autodefrag option

2012-09-20 Thread David Sterba
On Wed, Sep 19, 2012 at 07:39:42PM +0200, Martin Steigerwald wrote: (P.S. I am aware that autodefrag will introduce extra write I/O) Yes, your understanding is right, random write workloads will benefit from it. What about the extra I/O? And the greatly reduced seek times on SSDs?

Re: [RFC][PATCH] Btrfs-progs: Fix compiler warnings on PPC64.

2012-09-20 Thread David Sterba
On Fri, Sep 14, 2012 at 10:13:13AM -0700, Wade Cline wrote: By the time kerncompat.h is included, u64 is almost always defined to the non-compatible value. So either kerncompat.h needs to be defined as the -first- This makes most sense to me. Although the include files should go in the order

Re: [PATCH] Btrfs: make compress and nodatacow mount options mutually exclusive

2012-09-20 Thread David Sterba
andrei.p...@i-neo.ro Reviewed-by: David Sterba dste...@suse.cz -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] Btrfs-progs: fix the btrfs-debug-tree usage

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 02:59:44PM +0800, Anand jain wrote: @@ -51,6 +51,8 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb) btrfs_node_blockptr(eb, i), size,

Re: [PATCH] Btrfs-progs: btrfs subvolume delete could delete subvolumes

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 02:54:08PM +0800, Anand jain wrote: From: Anand Jain anand.j...@oracle.com With this user will be able to provide more than one subvolume to delete. eg: btrfs subvolume delete subvol1 subvol2 Yes, this is useful, thanks. I'm thinking if it's ok to stop on first

Re: [PATCH V3 1/2] Btrfs: cleanup duplicated division functions

2012-09-21 Thread David Sterba
On Fri, Sep 21, 2012 at 05:07:46PM +0800, Miao Xie wrote: --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3335,6 +3335,24 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) goto do_balance; } + + if

Re: Userland commands repository in wiki

2012-09-24 Thread David Sterba
On Fri, Sep 21, 2012 at 06:23:36PM +0200, Alfredo Esteban wrote: Yesterday, I modified the URL of the userland commands repository in this wiki page: https://btrfs.wiki.kernel.org/index.php/Debugging_Btrfs_with_GDB Former URL doesn't work:

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