Re: [PATCH] xfstests/btrfs: do not test btrfs/010 with autodefrag

2013-10-01 Thread David Sterba
On Fri, Sep 27, 2013 at 09:45:44AM -0400, Josef Bacik wrote: On Wed, Sep 18, 2013 at 01:17:55PM +0800, Liu Bo wrote: btrfs/010 is going to create a fragmented file, however, with autodefrag this is impossible, so just skip the test when we're with autodefrag. Signed-off-by: Liu Bo

Re: [PATCH v2 0/9] btrfs: Replace the btrfs_workers with kernel workqueue

2013-10-01 Thread David Sterba
On Fri, Sep 20, 2013 at 02:13:08PM +0800, Qu Wenruo wrote: * WQ_MEM_RECLAIM for the scrub thread does not seem right I think scrub_workers,scrub_wr_completion_workers still need WQ_MEM_RECLAIM. However scrub_nocow_workers does not need WQ_MEM_RECLAIM flags. Did you mean this? If you

Re: Handful of btrfs fixes for 3.11.x stable

2013-10-01 Thread David Sterba
Hi Greg, On Fri, Sep 20, 2013 at 09:53:02AM -0700, Greg KH wrote: Thanks for this, I'll queue them up soon. 3.11.3 has been just released and the btrfs fixes are not there nor in the stable-queue git repo. There's a fix for a crash that affects a number of users. Please queue the patches or let

Re: [PATCH] Btrfs: do not defrag extent root in ioctl

2013-10-08 Thread David Sterba
On Tue, Oct 08, 2013 at 06:19:30PM +0800, Liu Bo wrote: We can't defrag the extent root without deadlock. Deadlock under what circumstance? Eg. with snapshot aware defag turned on or extent tree cannot be safely defragmented at all? david -- To unsubscribe from this list: send the line

Re: [PATCH v3 02/12] Btrfs-progs: introduces '-p' option to print the ID of the parent qgroups

2013-10-08 Thread David Sterba
On Mon, Oct 07, 2013 at 03:21:38PM +0800, Wang Shilong wrote: +static void print_parent_column(struct btrfs_qgroup *qgroup) +{ + struct btrfs_qgroup_list *list = NULL; + + list_for_each_entry(list, qgroup-qgroups, next_qgroup) { + printf(%llu/%llu, (list-qgroup)-qgroupid

Re: [PATCH v3 03/12] Btrfs-progs: introduces '-c' option to print the ID of the child qgroups

2013-10-08 Thread David Sterba
On Mon, Oct 07, 2013 at 03:21:39PM +0800, Wang Shilong wrote: From: Wang Shilong wangsl-f...@cn.fujitsu.com This patch introduces '-c' option to print the ID of the child qgroups. You may use it like: btrfs qgroup show -c path I haven't looked closely, but using -c leads probably to a

Re: [PATCH v3 10/12] Btrfs-progs: add '--block-size' option to control print result

2013-10-08 Thread David Sterba
On Mon, Oct 07, 2013 at 03:21:46PM +0800, Wang Shilong wrote: You can use it like: btrfs qgroup show --block-size=m mnt Here, block size supports k/K/m/M/g/G/t/T/p/P/e/E. There is no distinction between the 1000 and 1024 based prefixes, also no way to get the raw values in bytes. I

Re: [PATCH v3 10/12] Btrfs-progs: add '--block-size' option to control print result

2013-10-08 Thread David Sterba
On Wed, Oct 09, 2013 at 12:27:23AM +0800, Shilong Wang wrote: Thanks for finding this, the problem comes to patch [v3 9/12]. When updating max columns len of child_qgroup, i miswrite qgroup-member to qgroup-parent, i have updated this patch and send a v4, it can be appiled without conflicts

Re: [RFC] another round of static analysis fixes

2013-10-08 Thread David Sterba
On Mon, Oct 07, 2013 at 02:42:53PM -0700, Zach Brown wrote: Eric imported a newer git snapshot of btrfs-progs into Red Hat's universe which kicked off a static analysis run which found a bunch of problems. This series is my attempt to fix the warnings that I agreed were either real bugs or

Re: [PATCH v2] btrfs-progs: calculate disk space that a subvol could free

2013-10-08 Thread David Sterba
On Mon, Oct 07, 2013 at 10:47:56AM +0800, Anand Jain wrote: I was also thinking if this should be inside kernel facilitated by a new ioctl? so that we avoid number of search ioctl thats required. I think so. And for the feature itself, it can be handy in case where qgroups are not

Re: [Bugme-new] [Bug 29302] New: Null pointer dereference with large max_sectors_kb

2011-02-18 Thread David Sterba
On Thu, Feb 17, 2011 at 03:37:19PM -0800, Andrew Morton wrote: [ 605.109630] BUG: unable to handle kernel NULL pointer dereference at 0010 [ 605.109928] IP: [81100a7a] bio_add_page+0xa/0x40 disassembly of the crashpoint obtained from Code: bytes below: 0: 48 8b 4f

Re: [PATCH V3] btrfs: implement delayed inode items operation

2011-03-08 Thread David Sterba
Hi, I did some testing, the speedup results match yours. I was watching kmem cache stats of the delayed_node, seem to behave well. Increase and decrease of number of active objects, from 3 to about ~400 (creat_unlink 5) and went back to initial values after a few seconds. On my setup, there

Re: [PATCH V3] btrfs: implement delayed inode items operation

2011-03-11 Thread David Sterba
On Wed, Mar 09, 2011 at 01:40:28PM +0800, Miao Xie wrote: Thanks for your advice. But AFAIK, reordering the fields like what you said can not reduce the space of delayed_nodes, because a hole is placed on the end to make the structure big enough to pack tightly into arrays and maintain proper

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

2011-03-11 Thread David Sterba
On Fri, Mar 11, 2011 at 03:49:40PM +0100, Arne Jansen wrote: This is the main scrub code. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/Makefile |2 +- fs/btrfs/ctree.h | 14 + fs/btrfs/scrub.c | 1463 + 3 files

Re: [PATCH v2 5/6] btrfs: add state information for scrub

2011-03-11 Thread David Sterba
On Fri, Mar 11, 2011 at 03:49:42PM +0100, Arne Jansen wrote: Add structures and state information needed for scrub Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/ctree.h | 26 ++ fs/btrfs/disk-io.c | 15 +++ fs/btrfs/ioctl.h | 17

Re: [PATCH] btrfs: properly access unaligned checksum buffer

2011-03-18 Thread David Sterba
/asm/unaligned.h accordingly, therefore it's safe to use put_unaligned_le32 without the ifdef. dave -- From: David Sterba dste...@suse.cz fixes https://bugzilla.kernel.org/show_bug.cgi?id=29142 reported on SPARC64, warnings like: [ 1523.941667] Kernel unaligned access at TPC[100e4034

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

2011-03-22 Thread David Sterba
Hi, sorry for late reply to this. (I will have another look at your git series.) David Sterba wrote: On Fri, Mar 11, 2011 at 03:49:40PM +0100, Arne Jansen wrote: This is the main scrub code. Signed-off-by: Arne Jansen sensi...@gmx.net --- fs/btrfs/Makefile |2 +- fs/btrfs/ctree.h

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

2011-03-23 Thread David Sterba
Hi, I'm reviewing the atomic counters and the wait/wake infrastructure, just found two missed mutex_unlock()s in btrfs_scrub_dev() in error paths. On Fri, Mar 18, 2011 at 04:55:06PM +0100, Arne Jansen wrote: This is the main scrub code. Updates v3: - fixed EIO handling, need to

Re: [PATCH v4 4/6] btrfs: sync scrub with commit device removal

2011-03-23 Thread David Sterba
Hi, you are adding a new smp_mb, can you please explain why it's needed and document it? thanks, dave On Fri, Mar 18, 2011 at 04:55:07PM +0100, Arne Jansen wrote: This adds several synchronizations: - for a transaction commit, the scrub gets paused before the tree roots are committed

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

2011-03-24 Thread David Sterba
On Thu, Mar 24, 2011 at 11:25:29AM +0100, Arne Jansen wrote: Thanks, I'll add you as Reported-by if that's ok. Ok it is :) dave -- 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 V5 1/2] btrfs: use GFP_NOFS instead of GFP_KERNEL

2011-03-24 Thread David Sterba
Hi, On Thu, Mar 24, 2011 at 07:41:21PM +0800, Miao Xie wrote: In the filesystem context, we must allocate memory by GFP_NOFS, or we may start another filesystem operation and make kswap thread hang up. indeed. Did you check for other GFP_KERNEL allocations? I've found 8 more them and at least

Re: [PATCH V5 2/2] btrfs: implement delayed inode items operation

2011-03-24 Thread David Sterba
Hi, there's one thing I want to bring up. It's not related to delayed functionality itself but to git tree base of the patch. There's a merge conflict when your patch is applied directly onto Linus' tree, and not when on Chris' one. On Thu, Mar 24, 2011 at 07:41:31PM +0800, Miao Xie wrote: ...

Re: [GIT PULL] Btrfs updates for 2.6.39

2011-03-28 Thread David Sterba
Hi, Chris, you did not add my sign-of on the unaligned fix I've posted, nor the tested-by or reported-by. Looking again into the mail, it seems like some automated-misprocessing picked the first part of the mail altough there was properly formated patch after '--' marker (and I've verified this

Re: [PATCH v4 1/8] btrfs: Balance progress monitoring

2011-04-08 Thread David Sterba
Hi, a missing check ... On Thu, Apr 07, 2011 at 06:06:08PM +0100, Hugo Mills wrote: This patch introduces a basic form of progress monitoring for balance operations, by counting the number of block groups remaining. The information is exposed to userspace by an ioctl. Signed-off-by: Hugo

Re: [PATCH v4 1/8] btrfs: Balance progress monitoring

2011-04-08 Thread David Sterba
Hi, sorry for separate mail, just noticed a kfree inside a spinlock below On Thu, Apr 07, 2011 at 06:06:08PM +0100, Hugo Mills wrote: diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c @@ -2115,10 +2162,20 @@ int btrfs_balance(struct btrfs_root *dev_root)

Re: [PATCH v4 1/8] btrfs: Balance progress monitoring

2011-04-08 Thread David Sterba
a missing check ... ah, forget it, On Fri, Apr 08, 2011 at 03:12:21PM +0200, David Sterba wrote: diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5fdb2ab..a8fbb07 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2375,6 +2375,38 @@ static noinline long

Re: [PATCH v5 3/8] btrfs: Factor out enumeration of chunks to a separate function

2011-04-10 Thread David Sterba
On Sun, Apr 10, 2011 at 10:06:06PM +0100, Hugo Mills wrote: diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cf019af..20c2772 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2029,6 +2029,97 @@ static u64 div_factor(u64 num, int factor) +static void

Re: [PATCH] Btrfs: avoid taking the chunk_mutex in do_chunk_alloc

2011-04-12 Thread David Sterba
Hi, On Mon, Apr 11, 2011 at 08:30:24PM -0400, Josef Bacik wrote: diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0d00a07..a566780 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -740,10 +740,11 @@ struct btrfs_space_info { */ unsigned long reservation_progress;

Re: [PATCH v5 1/8] btrfs: Balance progress monitoring

2011-04-12 Thread David Sterba
Hi, I've noticed that Arne's scrub patches add scrub variables directly into the fs_info structure, while you have a separate struct. I was wondering whether it would be better to put items of btrfs_balance_info to fs_info too, balance state is a global info. Although fs_info is a huge

Re: Warning when mounting btrfs partition, kernel unaligned access

2011-04-13 Thread David Sterba
Hi On Wed, Apr 13, 2011 at 01:03:56AM +0200, Sébastien Bernard wrote: Then, after writing on the disk, I got a lot of warning: [ 822.515875] Kernel unaligned access at TPC[103c2204] I peeked a look at the btrf_csum_final and here's the function : void btrfs_csum_final(u32 crc, char

Re: [PATCH] Btrfs: avoid taking the chunk_mutex in do_chunk_alloc

2011-04-13 Thread David Sterba
On Tue, Apr 12, 2011 at 08:42:39AM -0400, Josef Bacik wrote: hmm, the goto will lead to problems, cause in out clause there is a mutex_unlock(), which we do not have a mutex_lock yet. Hrm I wonder why xfstests didn't trip over that, thats what I get for patching while watching the

Re: [PATCH v5 1/8] btrfs: Balance progress monitoring

2011-04-13 Thread David Sterba
On Tue, Apr 12, 2011 at 07:42:07PM +0100, Hugo Mills wrote: There will be savings in the future, however -- when I add Li's suggestion for tracking the number of bytes (in the block groups as a whole, and in terms of useful data stored), plus the vaddr of the last-moved block group, the

[PATCH] btrfs: separate superblock items out of fs_info

2011-04-13 Thread David Sterba
for freeing fs_info. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/compression.c |2 +- fs/btrfs/ctree.h | 12 ++-- fs/btrfs/disk-io.c | 20 ++-- fs/btrfs/extent-tree.c | 14 +++--- fs/btrfs/file-item.c | 12 ++-- fs/btrfs

Re: [RFC][PATCH] Btrfs: about chunk tree backups

2011-04-15 Thread David Sterba
Hi, On Thu, Apr 07, 2011 at 03:57:50PM +0800, WuBo wrote: hi,all I've been diging into the idea of chunk tree backups. Here is the predesign, before finishing chunk alloc, the first block in this chunk will be written in some information, these information will be useful for chunk tree

Re: [PATCH] Btrfs: check return value of kmalloc()

2011-04-19 Thread David Sterba
Hi, there are more unchecked kmallocs, in inode.c:btrfs_add_delayed_iput() 2030delayed = kmalloc(sizeof(*delayed), GFP_NOFS | __GFP_NOFAIL); and in extent-tree.c:relocate_one_extent() 7992new_extents = kmalloc(sizeof(*new_extents), 7993

Re: [PATCH] Btrfs: Free free_space item properly in btrfs_trim_block_group()

2011-04-20 Thread David Sterba
Hi, reviewed, and made sure by the means of a coccinelle script that there are no other instances of any kmem_cache allocated data being kfreed. dave On Wed, Apr 20, 2011 at 04:37:39PM +0800, Li Zefan wrote: Since commit dc89e9824464e91fa0b06267864ceabe3186fd8b, we've changed to use a

Re: [PATCH] Btrfs: remove trans and root argument from fixup_low_keys()

2011-04-21 Thread David Sterba
Hi, On Thu, Apr 21, 2011 at 06:54:45PM +0900, Tsutomu Itoh wrote: 'trans' and 'root' argument not used in fixup_low_keys() are deleted. And, the argument that became unnecessary is deleted about the caller of fixup_low_keys(). heh, coincidence or synchronicity, I've spent some time yesterday

Re: [PATCH] Btrfs: check return value of kmalloc()

2011-04-21 Thread David Sterba
On Wed, Apr 20, 2011 at 09:51:30AM +0900, Tsutomu Itoh wrote: 2030delayed = kmalloc(sizeof(*delayed), GFP_NOFS | __GFP_NOFAIL); I think that it doesn't fail ordinary when __GFP_NOFAIL is specified... yes I agree with you, my oversight. However, from linux/gfp.h * __GFP_NOFAIL: The

[PATCH 00/12] Cleanups, cruft removal

2011-04-22 Thread David Sterba
. thanks, david --- David Sterba (12): btrfs: rename variables clashing with global function names btrfs: remove nested duplicate variable declarations btrfs: fix dereference before check btrfs: unify checking of IS_ERR and null btrfs: remove useless mutex lock/unlock sequences btrfs

[PATCH 01/12] btrfs: rename variables clashing with global function names

2011-04-22 Thread David Sterba
reported by gcc -Wshadow: page_index, page_offset, new_inode, dev_name Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/compression.c | 42 +- fs/btrfs/compression.h |2 +- fs/btrfs/ctree.h |2 +- fs/btrfs/disk-io.c |2

[PATCH 04/12] btrfs: unify checking of IS_ERR and null

2011-04-22 Thread David Sterba
use IS_ERR_OR_NULL when possible, done by this coccinelle script: @ match @ identifier id; @@ ( - BUG_ON(IS_ERR(id) || !id); + BUG_ON(IS_ERR_OR_NULL(id)); | - IS_ERR(id) || !id + IS_ERR_OR_NULL(id) | - !id || IS_ERR(id) + IS_ERR_OR_NULL(id) ) Signed-off-by: David Sterba dste...@suse.cz --- fs

[PATCH 05/12] btrfs: remove useless mutex lock/unlock sequences

2011-04-22 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/extent-tree.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 31f33ba..c97ceab 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -756,8

[PATCH 03/12] btrfs: fix dereference before check

2011-04-22 Thread David Sterba
The superblock's -s_fs_info is properly set in btrfs_fill_super, after a call to open_ctree, which derefereces it before check. Although tree_root is set via btrfs_set_super, let's be defensive and leave the check in place. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c

[PATCH 02/12] btrfs: remove nested duplicate variable declarations

2011-04-22 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.c|1 - fs/btrfs/free-space-cache.c |3 --- 2 files changed, 0 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 84d7ca1..c60197b 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs

[PATCH 11/12] btrfs: drop gfp parameter from alloc_extent_buffer

2011-04-22 Thread David Sterba
pass GFP_NOFS directly to kmem_cache_alloc Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c |6 +++--- fs/btrfs/extent_io.c |7 +++ fs/btrfs/extent_io.h |3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

[PATCH 10/12] btrfs: drop gfp parameter from find_extent_buffer

2011-04-22 Thread David Sterba
pass GFP_NOFS directly to kmem_cache_alloc Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c |4 ++-- fs/btrfs/extent_io.c |3 +-- fs/btrfs/extent_io.h |3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c

[PATCH 09/12] btrfs: drop gfp parameter from alloc_extent_map

2011-04-22 Thread David Sterba
pass GFP_NOFS directly to kmem_cache_alloc Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c |2 +- fs/btrfs/extent-tree.c |2 +- fs/btrfs/extent_map.c |5 ++--- fs/btrfs/extent_map.h |2 +- fs/btrfs/file.c|4 ++-- fs/btrfs/inode.c | 12

[PATCH 12/12] btrfs: drop unused parameter from btrfs_release_path

2011-04-22 Thread David Sterba
parameter tree root it's not used since commit 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee (Btrfs: Create extent_buffer interface for large blocksizes) Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.c| 28 ++-- fs/btrfs/ctree.h|2 +- fs/btrfs

[PATCH 06/12] btrfs: make functions static when possible

2011-04-22 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.c|4 ++-- fs/btrfs/extent-tree.c |6 +++--- fs/btrfs/free-space-cache.c |4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c60197b..a36c87db

Re: [PATCH] Btrfs: check return value of kmalloc()

2011-04-22 Thread David Sterba
On Fri, Apr 22, 2011 at 10:23:14AM +0900, Tsutomu Itoh wrote: But, reading code again, I noticed nobody use relocate_one_extent() now. ;-) However, because there is a possibility to be going to be used in the future, I'll add the check of 'new_extents' for the readability. vim hilight confused

Re: [PATCH] Btrfs: fix missing mutex_unlock in btrfs_del_dir_entries_in_log()

2011-04-22 Thread David Sterba
Hi, On Fri, Apr 22, 2011 at 06:05:40PM +0900, Tsutomu Itoh wrote: It is necessary to unlock mutex_lock before it return an error when btrfs_alloc_path() fails. good catch! however I suggest to move the mutex_lock after the allocation and check, it'll be semantically equivalent to your change,

Re: [PATCH 05/12] btrfs: remove useless mutex lock/unlock sequences

2011-04-29 Thread David Sterba
On Mon, Apr 25, 2011 at 08:12:59AM -0400, Chris Mason wrote: This code tests whether the mutex_lock can be acquired, and when the mutex_lock can be taken, it try again. So I think that it is not a meaningless code. Correct, this code is waiting for the current lock holder to finish. It's

[PATCH] btrfs: Document a mutex lock/unlock sequence

2011-05-02 Thread David Sterba
--- fs/btrfs/extent-tree.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a160f11..fba1348 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -756,6 +756,10 @@ again:

Re: [PATCH 00/12] Cleanups, cruft removal

2011-05-02 Thread David Sterba
Hi, this patch series, with the updated mutex patch, can be pulled from git://repo.or.cz/linux-2.6/btrfs-unstable.git #cleanups David Sterba (12): btrfs: rename variables clashing with global function names btrfs: remove nested duplicate variable declarations btrfs

Re: [PATCH v6 2/8] btrfs: Cancel filesystem balance

2011-05-02 Thread David Sterba
Hi, I was thinking about the EINTR or ECANCELED retcode from balance: CANCELED is returned from ioctl call if a cancel has been already requested EINTR is returned from btrfs_balance after all the processing if the cancel_request is set. I don't see a reason to have 2 retcodes here, how will

Re: [PATCH v6 0/8] Balance management

2011-05-02 Thread David Sterba
consider these patches for 2.6.40, please? just went through the patches again, all my comments are in and I'm giving it a Reviewed-by: David Sterba dste...@suse.cz david -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org

[PATCH 0/3] Cleanups II, unused code removal

2011-05-05 Thread David Sterba
Hi, another round of cleanups, removing unused code. No functional chanes. The diffstat is quite big, please have a look if you feel that some code is unused by accident. thanks, david David Sterba (3): btrfs: remove unused function prototypes btrfs: remove all unused functions btrfs

[PATCH 2/3] btrfs: remove all unused functions

2011-05-05 Thread David Sterba
Remove static and global declarations and/or definitions. Reduces size of btrfs.ko by ~3.4kB. textdata bss dec hex filename 4020817464 200 409745 64091 btrfs.ko.base 3986207144 200 405964 631cc btrfs.ko.remove-all Signed-off-by: David Sterba dste

[PATCH 1/3] btrfs: remove unused function prototypes

2011-05-05 Thread David Sterba
function prototypes without a body Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.h | 12 fs/btrfs/delayed-ref.h |5 - fs/btrfs/disk-io.h | 11 --- fs/btrfs/extent_io.h |9 - fs/btrfs/transaction.h |3 --- fs/btrfs/tree

Lockdep warning in btrfs_clear_lock_blocking

2011-05-10 Thread David Sterba
Hi, I've hit this lockdep warning, 2.6.39rc6. Single btrfs partition, 30GB, filled with 2GB, compress-force=lzo, warning trigered after normal copy+du. Happened only once. [Might be a false positive.] david [14547.128565] = [14547.132010] [ INFO:

Re: [PATCH 2/4] Btrfs: don't look at the extent buffer level 3 times in a row

2011-05-12 Thread David Sterba
Hi, On Wed, May 11, 2011 at 05:35:53PM -0400, Josef Bacik wrote: We have a bit of debugging in btrfs_search_slot to make sure the level of the cow block is the same as the original block we were cow'ing. I don't think I've ever seen this tripped, so kill it. This saves us 2 kmap's per

[PATCH 1/1] btrfs: use printk_ratelimited instead of printk_ratelimit

2011-05-12 Thread David Sterba
As per printk_ratelimit comment, it should not be used. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c | 21 ++--- fs/btrfs/inode.c | 13 - 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk

[PATCH 1/1] btrfs: use unsigned type for single bit bitfield

2011-05-12 Thread David Sterba
Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/ctree.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e37d441..343304d 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -740,12 +740,12 @@ struct

Re: [PATCH v3 3/3] btrfs: quasi-round-robin for chunk allocation

2011-05-13 Thread David Sterba
Hi, here are my comments, after first review round, mostly on code itself, not the functionality/quality of the allocator (although after this patch the allocator code looks quite straightforward a better to read and understand). Reviewing the patch directly does not work, Arne's advice was to

Re: [PATCH] btrfs: quasi-round-robin for chunk allocation

2011-05-13 Thread David Sterba
Hi, On Mon, Apr 11, 2011 at 01:46:33PM -0400, Chris Mason wrote: My big complaint about this patch is that it is a feature fix mixed in with a huge cleanup. It's hard to differentiate between the two. Could you please separate it out so we can review them independently? I agree that changes

Re: Lockdep warning in btrfs_clear_lock_blocking

2011-05-17 Thread David Sterba
another lockdep warning, very similar to the previous. happened during xfstests/224 d/ [344121.276299] = [344121.284642] [ INFO: possible recursive locking detected ] [344121.286331] 2.6.39-rc7-default+ #22 [344121.286331]

Drive without DISCARD support crashes btrfs

2011-05-17 Thread David Sterba
Hi, while playing with lockedp, I started to hit consistent crashes with xfstests/013 (fsstress): [ 537.284234] [ cut here ] [ 537.288040] kernel BUG at fs/btrfs/tree-log.c:1792! [ 537.288040] invalid opcode: [#1] SMP [ 537.288040] last sysfs file:

[PATCH] btrfs: fix crash when no drive supports DISCARD

2011-05-17 Thread David Sterba
the EOPNOTSUPP retcode, but currently it does this only when some bytes were succesfully discarded. Signed-off-by: David Sterba dste...@suse.cz CC: sta...@kernel.org --- fs/btrfs/extent-tree.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent

Re: [PATCH] Btrfs: BUG_ON is deleted from the caller of btrfs_truncate_item btrfs_extend_item

2011-05-20 Thread David Sterba
Hi, On Thu, May 19, 2011 at 02:19:08PM +0900, Tsutomu Itoh wrote: Currently, btrfs_truncate_item and btrfs_extend_item returns only 0. So, the check by BUG_ON in the caller is unnecessary. well, I don't think it's right to remove the BUG_ONs right now. btrfs_extend_item has it's own BUG_ON()s,

Re: [PATCH] btrfs: fix crash when no drive supports DISCARD

2011-05-20 Thread David Sterba
On Wed, May 18, 2011 at 11:29:14AM +0800, Li Dongyang wrote: Thanks for the fix, I thought EOPNOTSUPP could be useful by the caller that time, and maybe we could do somthing like remove the discard mount_opt in the fs_info so we can avoid calling it again. I do not agree that discard should be

Re: [PATCH v1 3/5] btrfs: initial readahead code and prototypes

2011-05-26 Thread David Sterba
Hi, On Mon, May 23, 2011 at 02:59:06PM +0200, Arne Jansen wrote: +static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info, + struct btrfs_device *dev, u64 logical, + struct btrfs_multi_bio *multi) +{

Re: Problem with latest for-linus branch

2011-05-28 Thread David Sterba
Hi, On Sat, May 28, 2011 at 07:05:47PM +0200, Andrea Gelmini wrote: Everything works good with stock Ubuntu 11.04 kernel (2.6.38), vanilla 2.6.38 and vanilla 2.6.39. If I use Linus' git tree, BTRFS ooops at mount. can you please attach the oops traces? So I bisected using kernel

[PATCH] btrfs: add helper for fs_info-closing

2011-05-31 Thread David Sterba
wrap checking of filesystem 'closing' flag and fix a few missing memory barriers. Signed-off-by: David Sterba dste...@suse.cz --- based on 'for-linus' branch of mason/btrfs-unstable.git fs/btrfs/ctree.h|9 + fs/btrfs/extent-tree.c |3 +-- fs/btrfs/file.c

[PATCH] btrfs: use btrfs_ino to access inode number

2011-05-31 Thread David Sterba
commit 4cb5300bc (Btrfs: add mount -o auto_defrag) accesses inode number directly while it should use the helper with the new inode number allocator. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/file.c |2 +- fs/btrfs/ioctl.c |7 --- 2 files changed, 5 insertions(+), 4

Re: [PATCH] btrfs: use btrfs_ino to access inode number

2011-05-31 Thread David Sterba
both patches are pushed to git://repo.or.cz/linux-2.6/btrfs-unstable.git #fixes david On Tue, May 31, 2011 at 07:08:14PM +0200, David Sterba wrote: commit 4cb5300bc (Btrfs: add mount -o auto_defrag) accesses inode number directly while it should use the helper with the new inode number

Re: linux-next: build warninga in Linus' tree

2011-05-31 Thread David Sterba
Hi, On Mon, May 30, 2011 at 11:36:53AM +1000, Stephen Rothwell wrote: After merging the Linus' tree, today's linux-next build (powerpc ppc64_defconfig) produced these warnings: fs/btrfs/sysfs.c:76:26: warning: 'btrfs_root_attrs' defined but not used fs/btrfs/sysfs.c:97:26: warning:

Re: btrfs hang on brd

2011-06-01 Thread David Sterba
On Tue, May 31, 2011 at 10:03:12AM +0300, Adrian Hunter wrote: Hi I seem to be able to get btrfs reproducibly to produce warnings and finally hang when running a stress test on a ramdisk. Testing was done using the integration-test branch of btrfs-unstable. Note that I also tested

Re: [PATCH] Btrfs: don't save the inode cache if we are deleting this root

2011-06-01 Thread David Sterba
Hi, On Tue, May 31, 2011 at 03:33:33PM -0400, Josef Bacik wrote: Signed-off-by: Josef Bacik jo...@redhat.com Tested-by: David Sterba dste...@suse.cz really needed in order to run xfstests, thanks. david -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body

[PATCH][RESEND] btrfs: separate superblock items out of fs_info

2011-06-02 Thread David Sterba
for freeing fs_info. Signed-off-by: David Sterba dste...@suse.cz --- based on top of 3.0-rc1 pushed to git://repo.or.cz/linux-2.6/btrfs-unstable.git #cleanups passed xfstests fs/btrfs/compression.c |3 ++- fs/btrfs/ctree.h | 12 ++-- fs/btrfs/disk-io.c | 21

Re: linux-next: build warninga in Linus' tree

2011-06-03 Thread David Sterba
On Wed, Jun 01, 2011 at 10:16:48AM -0500, Mitch Harder wrote: I've been playing around with resurrecting the basic sysfs capabilities that had been previously incorporated into btrfs. As it stands right now, it was relatively easy to re-implement sysfs as it was originally. However, that

[PATCH] btrfs: move extra checks under debug option in btrfs_search_slot

2011-06-03 Thread David Sterba
CC: Josef Bacik jo...@redhat.com Signed-off-by: David Sterba dste...@suse.cz --- this patch is in conflict with josef's patch http://git.kernel.org/?p=linux/kernel/git/josef/btrfs-work.git;a=commit;h=98cdd9ffc5da7aa4c516347f7fc8f65cb08df6ae fs/btrfs/ctree.c |2 ++ 1 files changed, 2

[PATCH] btrfs: fix uninitialized variable warning

2011-06-03 Thread David Sterba
From: David Sterba dste...@suse.cz With Linus' tree, today's linux-next build (powercp ppc64_defconfig) produced this warning: fs/btrfs/delayed-inode.c: In function 'btrfs_delayed_update_inode': fs/btrfs/delayed-inode.c:1598:6: warning: 'ret' may be used uninitialized in this function

Re: [PATCH 2/2] Btrfs: serialize flushers in reserve_metadata_bytes

2011-06-09 Thread David Sterba
On Tue, Jun 07, 2011 at 04:44:09PM -0400, Josef Bacik wrote: --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2932,6 +2932,8 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags, found-full = 0; found-force_alloc = CHUNK_ALLOC_NO_FORCE;

[PATCH] btrfs: fix unlocked access of delalloc_inodes

2011-06-09 Thread David Sterba
list_splice_init will make delalloc_inodes empty, but without a spinlock around, this may produce corrupted list head, accessed in many placess, The race window is very tight and nobody seems to have hit it so far. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c |3 +-- 1

Re: [PATCH] Btrfs: turn to readonly if btrfs_start_transaction() fails

2011-06-09 Thread David Sterba
On Thu, Jun 09, 2011 at 06:38:52PM +0900, Tsutomu Itoh wrote: When btrfs_start_transaction() fails, we should call btrfs_std_error() properly for filesystem to readonly. (in this patch, forced readonly framework is used) Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com ---

Re: [PATCH 2/2] Btrfs: serialize flushers in reserve_metadata_bytes

2011-06-09 Thread David Sterba
On Thu, Jun 09, 2011 at 10:00:42AM -0400, Josef Bacik wrote: We're not trying to be perfect here, we're trying to be fast :). Be even faster with smp_rmb() :) david -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org

Re: 3.0-rcX BUG at fs/btrfs/ioctl.c:432 - bisected

2011-06-09 Thread David Sterba
Hi, a candidate fix: http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-unstable.git;a=commit;h=aa0467d8d2a00e75b2bb6a56a4ee6d70c5d1928f With Linus' tree, today's linux-next build (powercp ppc64_defconfig) produced this warning: fs/btrfs/delayed-inode.c: In function

Re: defrag makes fragmentation worse

2011-06-09 Thread David Sterba
On Fri, Jun 10, 2011 at 12:48:36AM +0200, Johannes Hirte wrote: I've observed several times that after a btrfs filesystem defrag a file was way more fragmented than before. For example, a file that was recently written, had 10 extents (output from filefrag). After a defrag filefrag showed

Re: [PATCH] Btrfs: add discard flag to btrfs_device and make btrfs_discard_extent aware of that

2011-06-09 Thread David Sterba
On Thu, Jun 09, 2011 at 03:28:09PM +0800, Li Dongyang wrote: --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -45,6 +45,7 @@ struct btrfs_device { int running_pending; u64 generation; + int discard; can you pick a better name? this does not describe that it's the

Re: kernel BUG at fs/btrfs/inode.c:2260!

2011-06-09 Thread David Sterba
Hi, On Mon, May 30, 2011 at 01:33:21PM -0400, James Cloos wrote: The BUG_ON() call is from: if (!BTRFS_I(inode)-orphan_meta_reserved) { BTRFS_I(inode)-orphan_meta_reserved = 1; reserve = 1; } /* *ELIDED* */ /* grab metadata

Re: [PATCH 00/11 v2] Btrfs: improve write ahead log with sub transaction

2011-06-09 Thread David Sterba
Hi, is it possible to refresh this patchset and resend? I'd like to enroll it and give it some review and testing. So far I have seen notions and use of trans_mutex, which has been removed. thanks, david -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a

Re: [PATCH 2/2] Btrfs: serialize flushers in reserve_metadata_bytes

2011-06-10 Thread David Sterba
On Thu, Jun 09, 2011 at 08:00:15PM +0200, David Sterba wrote: On Thu, Jun 09, 2011 at 10:00:42AM -0400, Josef Bacik wrote: We're not trying to be perfect here, we're trying to be fast :). Be even faster with smp_rmb() :) Arne made me think about this again. Let's analyze it in more detail

Re: strange filefrag output on btrfs

2011-06-13 Thread David Sterba
On Sat, Jun 11, 2011 at 05:39:15PM +0200, Andreas Philipp wrote: On one of my btrfs volumes I see a strange output from filefrag when run against a particular large (~8GB) file. filefrag and filefrag -v give me a different number of extents, see below. aph@thor /mnt/nutshell $ sudo filefrag

[PATCH] btrfs: fix uninitialized return value

2011-06-13 Thread David Sterba
When allocation fails in btrfs_read_fs_root_no_name, ret is not set although it is returned, holding a garbage value. Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/disk-io.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs

Re: [PATCH] Btrfs: add discard flag to btrfs_device and make btrfs_discard_extent aware of that

2011-06-13 Thread David Sterba
On Fri, Jun 10, 2011 at 01:40:31PM +0800, Li Dongyang wrote: otherwise the patch looks good (and matches my view how to do it). I will test it eventually. Thanks a lot, I'll resend this this a proper name. JFYI, tested in the previous scenario, ie. all devices without trim support, does not

[PATCH][RFC] btrfs: fix potential overflow in leafsize accounting

2011-06-13 Thread David Sterba
are near to full, though I'm not aware of any related reports so far. Signed-off-by: David Sterba dste...@suse.cz --- I haven't tested this yet (thoug I will) because I want to let it out ASAP. fs/btrfs/ctree.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs

[PATCH] btrfs: fix dereference of ERR_PTR value

2011-06-13 Thread David Sterba
smatch reports: btrfs_recover_log_trees error: 'wc.replay_dest' dereferencing possible ERR_PTR() Signed-off-by: David Sterba dste...@suse.cz --- fs/btrfs/tree-log.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 592396c

Re: BUG: scheduling while atomic: mount/1608/0x00000002

2011-06-13 Thread David Sterba
Hi, I've analyzed this error during today and want to share my findings: On Mon, Jun 13, 2011 at 02:08:21PM -0400, dont wrote: 6. dmesg output: [ 236.556931] Loglevel set to 9 [ 252.491295] Btrfs loaded [ 268.978445] device fsid 48487393f515c9b8-be3d620d5899c184 devid 4 transid 906477

Re: BUG: scheduling while atomic: mount/1608/0x00000002

2011-06-13 Thread David Sterba
On Tue, Jun 14, 2011 at 01:21:00AM +0200, David Sterba wrote: The code 1972-1979 was added by cleancache. I've asked the reporter to try it without cleancache, but we did not figure out how to disable it on commandline (and there was no followup on compiling without cleancache). without

Re: [PATCH] Btrfs: protect the pending_snapshots list with trans_lock

2011-06-15 Thread David Sterba
Hi, On Tue, Jun 14, 2011 at 03:17:47PM -0400, Josef Bacik wrote: Currently there is nothing protecting the pending_snapshots list on the transaction. We only hold the directory mutex that we are snapshotting and a read lock on the subvol_sem, so we could race with somebody else creating a

<    1   2   3   4   5   6   7   8   9   10   >