[PATCH 1/3 RESEND] Btrfs-progs: search subvolumes with proper objectid

2012-07-30 Thread Liu Bo
Btrfs's subvolume/snapshot is limited to [BTRFS_FIRST_FREE_OBJECTID, BTRFS_LAST_FREE_OBJECTID], so just apply the range. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- btrfs-list.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index

[PATCH 3/3] Btrfs-progs: list snapshots by generation

2012-07-30 Thread Liu Bo
by their _created_ generation. What we need to do is just to list them in descending order and get the latest snapshot. What's more, we can find the oldest snapshot as well by listing snapshots in ascending order. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- btrfs-list.c | 176

[PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list

2012-07-30 Thread Liu Bo
is going to show 'creation generation'. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- btrfs-list.c | 61 - 1 files changed, 55 insertions(+), 6 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index ac6507a..05360dc 100644

Re: [PATCH 3/3] Btrfs-progs: list snapshots by generation

2012-08-01 Thread Liu Bo
On 08/01/2012 05:16 AM, Goffredo Baroncelli wrote: Hi Bo, On 07/31/2012 07:49 AM, Liu Bo wrote: The idea is that we usually use snapshot to backup/restore our data, and the common way can be a cron script which makes lots of snapshots, so we can end up with spending some time to find

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

2012-08-01 Thread Liu Bo
On 08/01/2012 07:45 PM, Stefan Behrens wrote: With commit acce952b0, btrfs was changed to flag the filesystem with BTRFS_SUPER_FLAG_ERROR and switch to read-only mode after a fatal error happened like a write I/O errors of all mirrors. In such situations, on unmount, the superblock is written

Re: [PATCH] add crtime to the snapshot list

2012-08-01 Thread Liu Bo
patches Liu Bo: [PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list [PATCH 3/3] Btrfs-progs: list snapshots by generation Eg output: #btrfs su list -s 1 /btrfs ID 258 gen 39 cgen 6 top level 5 crtime 2012-07-27 17:43:55 path ss1 ID 260 gen 8 cgen 8 top

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

2012-08-01 Thread Liu Bo
On 08/01/2012 09:07 PM, Jan Schmidt wrote: On Wed, August 01, 2012 at 14:02 (+0200), Liu Bo wrote: On 08/01/2012 07:45 PM, Stefan Behrens wrote: With commit acce952b0, btrfs was changed to flag the filesystem with BTRFS_SUPER_FLAG_ERROR and switch to read-only mode after a fatal error

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

2012-08-02 Thread Liu Bo
On 08/02/2012 06:30 PM, Stefan Behrens wrote: On Wed, 01 Aug 2012 16:31:54 +0200, Stefan Behrens wrote: On Wed, 01 Aug 2012 21:31:58 +0800, Liu Bo wrote: On 08/01/2012 09:07 PM, Jan Schmidt wrote: On Wed, August 01, 2012 at 14:02 (+0200), Liu Bo wrote: On 08/01/2012 07:45 PM, Stefan Behrens

Re: [PATCH] Btrfs: barrier before waitqueue_active

2012-08-02 Thread Liu Bo
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 flushers and the transaction commit because the ordered flushers were waiting for more refs and were never woken up, so those

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

2012-08-02 Thread Liu Bo
On 08/02/2012 07:18 PM, Arne Jansen wrote: On 02.08.2012 12:36, Liu Bo wrote: On 08/02/2012 06:30 PM, Stefan Behrens wrote: On Wed, 01 Aug 2012 16:31:54 +0200, Stefan Behrens wrote: On Wed, 01 Aug 2012 21:31:58 +0800, Liu Bo wrote: On 08/01/2012 09:07 PM, Jan Schmidt wrote: On Wed, August 01

Re: [PATCH] Btrfs: make filesystem read-only when submitting barrier fails

2012-08-11 Thread Liu Bo
)sorry, forgot to CC btrfs Maillist) On 08/11/2012 10:36 AM, Liu Bo wrote: On 08/10/2012 09:38 PM, Stefan Behrens wrote: So far the return code of barrier_all_devices() is ignored, which means that errors are ignored. The result can be a corrupt filesystem which is not consistent

Re: [PATCH RFC] Btrfs: fix deadlock between sys_sync and freeze

2012-08-14 Thread Liu Bo
On 08/14/2012 08:59 PM, Marco Stornelli wrote: Il 14/08/2012 07:01, liub.li...@gmail.com ha scritto: From: Liu Bo bo.li@oracle.com I found this while testing xfstests 068, the story is t1t2 sys_sync

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

2012-08-14 Thread Liu Bo
On 08/02/2012 05:06 AM, 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 is full run 5

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

2012-08-14 Thread Liu Bo
On 08/15/2012 10:48 AM, Marc MERLIN wrote: On Tue, Aug 14, 2012 at 11:23:14AM -0700, Marc MERLIN wrote: My laptop oopsed due to a wireless bug When I rebooted, the system came back ok, and seemed to work, but soon went to read only with the error in the subject line. I have hourly snapshots

Re: [PATCH RFC] Btrfs: fix deadlock between sys_sync and freeze

2012-08-15 Thread Liu Bo
(CCed Jan, the author of freeze code) On 08/14/2012 10:12 PM, Marco Stornelli wrote: Il 14/08/2012 15:53, Liu Bo ha scritto: On 08/14/2012 08:59 PM, Marco Stornelli wrote: Il 14/08/2012 07:01, liub.li...@gmail.com ha scritto: From: Liu Bo bo.li@oracle.com I found this while testing

[PATCH] Btrfs: update delayed ref's tracepoints to show sequence

2012-08-15 Thread Liu Bo
We've added a new field 'sequence' to delayed ref node, so update related tracepoints. Signed-off-by: Liu Bo bo.li@oracle.com --- include/trace/events/btrfs.h | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/trace/events/btrfs.h b/include/trace

[PATCH 1/2] Btrfs: fix a bug in parsing return value in logical resolve

2012-08-15 Thread Liu Bo
. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/backref.c | 24 fs/btrfs/backref.h |3 ++- fs/btrfs/ioctl.c |6 -- fs/btrfs/scrub.c | 14 -- fs/btrfs/send.c|7 --- 5 files changed, 34 insertions(+), 20 deletions(-) diff

[PATCH 2/2] Btrfs: use helper for logical resolve

2012-08-15 Thread Liu Bo
We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 20 +++- 1 files changed, 3 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index

Re: [PATCH 2/2] Btrfs: use helper for logical resolve

2012-08-15 Thread Liu Bo
On 08/16/2012 01:10 PM, Jan Schmidt wrote: On Thu, August 16, 2012 at 06:42 (+0200), Liu Bo wrote: We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 20 +++- 1

[PATCH v2 1/2] Btrfs: fix a bug in parsing return value in logical resolve

2012-08-16 Thread Liu Bo
. Acked-by: Jan Schmidt list.bt...@jan-o-sch.net Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/backref.c | 24 fs/btrfs/backref.h |3 ++- fs/btrfs/ioctl.c |6 -- fs/btrfs/scrub.c | 14 -- fs/btrfs/send.c|7 --- 5 files

[PATCH v2 2/2] Btrfs: use helper for logical resolve

2012-08-16 Thread Liu Bo
We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- v1-v2: patch -EINVAL to -ENOENT to keep the behaviour, thanks to Jan. fs/btrfs/ioctl.c | 19 +++ 1 files changed, 3 insertions(+), 16

Re: [PATCH] btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID

2012-08-16 Thread Liu Bo
On 08/16/2012 10:53 PM, Wang Sheng-Hui wrote: It should be storing. Please cc these typo fixes to triv...@kernel.org. thanks, liubo Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/ctree.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

Re: State of nocow file attribute

2012-08-16 Thread Liu Bo
On 08/15/2012 06:12 PM, Lluís Batlle i Rossell wrote: Hello, 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 attribute set. Chris mentioned to find a fix quickly for

Re:

2012-08-17 Thread Liu Bo
On 08/17/2012 10:59 PM, David Sterba wrote: 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

Re: State of nocow file attribute

2012-08-21 Thread Liu Bo
On 08/21/2012 10:33 PM, David Sterba wrote: 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

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

2012-08-23 Thread Liu Bo
, cnt=510, missed=2493 This changes to regard 4096 as the lowest limit. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9449b84..525915f 100644 --- a/fs/btrfs/ioctl.c

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

2012-08-23 Thread Liu Bo
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 insertions(+), 6 deletions(-) diff --git a/cmds-inspect.c b

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

2012-08-23 Thread Liu Bo
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 --- v1-v2: update btrfs inspect-internal's manual. cmds-inspect.c | 18 -- man/btrfs.8.in |6 -- 2

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

2012-08-23 Thread Liu Bo
On 08/23/2012 06:07 PM, Jan Schmidt wrote: On Thu, August 23, 2012 at 10:56 (+0200), Liu Bo wrote: This is the change of the kernel side. Transition of logical to inode used to have a limit 4096 on inode container's size, but the limit is not large enough for a data with a great many of refs

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

2012-08-23 Thread Liu Bo
On 08/23/2012 06:24 PM, Liu Bo wrote: On 08/23/2012 06:07 PM, Jan Schmidt wrote: On Thu, August 23, 2012 at 10:56 (+0200), Liu Bo wrote: This is the change of the kernel side. Transition of logical to inode used to have a limit 4096 on inode container's size, but the limit is not large

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

2012-08-23 Thread Liu Bo
. Signed-off-by: Liu Bo bo.li@oracle.com Original-Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/inode.c | 617 ++ 1 files changed, 617 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 85bc35f..c612bb7

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

2012-08-23 Thread Liu Bo
and writeback started by defragmentation. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/extent_io.c| 11 +-- fs/btrfs/extent_io.h| 29 ++--- fs/btrfs/file.c |4 ++-- fs/btrfs/free-space-cache.c |7 --- fs/btrfs/inode.c

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

2012-08-23 Thread Liu Bo
On 08/23/2012 07:01 PM, 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 writeback thread can

Re: [PATCH] Btrfs: fix deadlock with freeze and sync V2

2012-08-24 Thread Liu Bo
the umount sem for the sb so we're safe from freezes coming in after we've done our check. With this patch the freeze xfstests no longer deadlocks. Thanks, Actually I have a same patch pending to send... Anyway, I'm happy with the bug has been fixed. Reviewed-by: Liu Bo bo.li@oracle.com

Re: [PATCH] Btrfs: turbo charge fsync

2012-08-24 Thread Liu Bo
On 08/25/2012 02:42 AM, Chris Mason wrote: On Fri, Aug 24, 2012 at 12:43:28PM -0600, Josef Bacik wrote: OriginalPatched SATA drive 82KB/s 140KB/s Fusion drive431KB/s 2532KB/s So around 2-6 times faster depending on your hardware. There are

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

2012-08-25 Thread Liu Bo
On 08/25/2012 01:34 AM, David Sterba wrote: 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

Re: BTRFS filesystem is not mountable after crash

2012-08-26 Thread Liu Bo
On 08/26/2012 01:27 PM, Alfred Zastrow wrote: Hello, has realy nobody a hint for me? Is compiling chris's latest for-linus helpful? git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git thanks, liubo br Alfred -- To unsubscribe from this list: send the line

Re: crash while trying to access corrupt fs

2012-08-27 Thread Liu Bo
On 08/27/2012 07:12 PM, Stefan Behrens wrote: On Sun, 26 Aug 2012 16:07:33 -0400 (EDT), tubalcane wrote: I'm primarily interested in the block level checksums of files and the scrubbing feature to detect corrupt files. Currently I use ext4 and create and keep md5sums of everything which is

[PATCH 1/2] Btrfs: cleanup extents after we finish logging inode

2012-08-27 Thread Liu Bo
This is based on Josef's Btrfs: turbo charge fsync. We should cleanup those extents after we've finished logging inode, otherwise we may do redundant work on them. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/tree-log.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions

[PATCH 2/2] Btrfs: improve fsync by filtering extents that we want

2012-08-27 Thread Liu Bo
-by: Liu Bo bo.li@oracle.com --- fs/btrfs/extent_map.c | 20 fs/btrfs/extent_map.h |2 ++ fs/btrfs/inode.c |1 + fs/btrfs/tree-log.c |6 +++--- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c

Re: [PATCH 2/2] Btrfs: improve fsync by filtering extents that we want

2012-08-27 Thread Liu Bo
On 08/28/2012 01:12 AM, Josef Bacik wrote: On Mon, Aug 27, 2012 at 10:52:20AM -0600, Liu Bo wrote: This is based on Josef's Btrfs: turbo charge fsync. The above Josef's patch performs very good in random sync write test, because we won't have too much extents to merge. However, it does

[PATCH 1/2] Btrfs: fix a bug in checking whether a inode is already in log

2012-08-29 Thread Liu Bo
. sub_trans Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/btrfs_inode.h | 14 ++ fs/btrfs/inode.c |2 ++ fs/btrfs/transaction.h |1 + fs/btrfs/tree-log.c|1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs

[PATCH 2/2] Btrfs: check if an inode has no checksum when logging it

2012-08-29 Thread Liu Bo
This is based on Josef's Btrfs: turbo charge fsync. If an inode is a BTRFS_INODE_NODATASUM one, we don't need to look for csum items any more. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/tree-log.c | 23 --- 1 files changed, 12 insertions(+), 11 deletions

[PATCH 0/6] bug-fixes and cleanup

2012-08-30 Thread Liu Bo
From: Liu Bo liub.li...@gmail.com This is a collection of some posted patches. It is also available in git://github.com/liubogithub/btrfs-work.git Liu Bo (5): Btrfs: fix a bug of per-file nocow Btrfs: update delayed ref's tracepoints to show sequence Btrfs: fix a bug in parsing

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

2012-08-30 Thread Liu Bo
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 --- fs/btrfs/inode.c |3 +-- fs/btrfs/ioctl.c |3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs

[PATCH 2/6] Btrfs: cleanup for unused ref cache stuff

2012-08-30 Thread Liu Bo
From: liubo liubo2...@cn.fujitsu.com As ref cache has been removed from btrfs, there is no user on its lock and its check. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.h |3 --- fs/btrfs/disk-io.c |5 - 2 files

[PATCH 3/6] Btrfs: update delayed ref's tracepoints to show sequence

2012-08-30 Thread Liu Bo
We've added a new field 'sequence' to delayed ref node, so update related tracepoints. Signed-off-by: Liu Bo bo.li@oracle.com --- include/trace/events/btrfs.h | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/trace/events/btrfs.h b/include/trace

[PATCH 4/6] Btrfs: fix a bug in parsing return value in logical resolve

2012-08-30 Thread Liu Bo
From: Liu Bo liub.li...@gmail.com In logical resolve, we parse extent_from_logical()'s 'ret' as a kind of flag. It is possible to lose our errors because (-E BTRFS_EXTENT_FLAG_TREE_BLOCK) is true. I'm not sure if it is on purpose, it just looks too hacky if it is. I'd rather use a real

[PATCH 5/6] Btrfs: use helper for logical resolve

2012-08-30 Thread Liu Bo
We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index

[PATCH 6/6] Btrfs: use larger limit for translation of logical to inode

2012-08-30 Thread Liu Bo
=19944, cnt=510, missed=2493 This changes to regard 64k as the upper limit and use vmalloc instead of kmalloc to get memory more easily. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/backref.c |2 +- fs/btrfs/ioctl.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions

[PATCH v3] Btrfs-progs: add options to change bufsize in logical to inode translation

2012-08-30 Thread Liu Bo
Add an option 's' to set bufsize in logical to inode transition, then we are able to read all the refs to the logical address. Meanwhile, set a max value 64k for the bufsize. Signed-off-by: Liu Bo bo.li@oracle.com --- v2-v3: - use 64k as the upper limit - document command's options

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

2012-09-05 Thread Liu Bo
and writeback started by defragmentation. Original-Signed-off-by: Li Zefan l...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- v2: get rid of cleanup for deprecated flags and remove defrag flags in free space cache since it'll never have it, thanks to David. fs/btrfs/extent_io.c |8

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

2012-09-05 Thread Liu Bo
. Original-Signed-off-by: Li Zefan l...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- v2: rebase against the latest btrfs-repo fs/btrfs/inode.c | 617 ++ 1 files changed, 617 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/inode.c

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

2012-09-06 Thread Liu Bo
On Thu, Sep 06, 2012 at 09:11:53AM -0400, Josef Bacik wrote: On Wed, Sep 05, 2012 at 07:10:52PM -0600, 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

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

2012-09-06 Thread Liu Bo
On Thu, Sep 06, 2012 at 09:11:53AM -0400, Josef Bacik wrote: On Wed, Sep 05, 2012 at 07:10:52PM -0600, 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

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

2012-09-07 Thread Liu Bo
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 --- v1-v2: add check for only regular file fs/btrfs/inode.c |3 +-- fs/btrfs/ioctl.c |7 +-- 2 files changed, 6 insertions

[PATCH v2 2/6] Btrfs: cleanup for unused ref cache stuff

2012-09-07 Thread Liu Bo
From: liubo liubo2...@cn.fujitsu.com As ref cache has been removed from btrfs, there is no user on its lock and its check. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.h |3 --- fs/btrfs/disk-io.c |5 - 2 files

[PATCH v2 3/6] Btrfs: update delayed ref's tracepoints to show sequence

2012-09-07 Thread Liu Bo
We've added a new field 'sequence' to delayed ref node, so update related tracepoints. Signed-off-by: Liu Bo bo.li@oracle.com --- include/trace/events/btrfs.h | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/trace/events/btrfs.h b/include/trace

[PATCH v2 5/6] Btrfs: use helper for logical resolve

2012-09-07 Thread Liu Bo
We already have a helper, iterate_inodes_from_logical(), for logical resolve, so just use it. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index

[PATCH v2 6/6] Btrfs: use larger limit for translation of logical to inode

2012-09-07 Thread Liu Bo
=19944, cnt=510, missed=2493 This changes to regard 64k as the upper limit and use vmalloc instead of kmalloc to get memory more easily. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/backref.c |2 +- fs/btrfs/ioctl.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions

Re: enquiry about defrag

2012-09-10 Thread Liu Bo
On 09/10/2012 08:19 PM, ching wrote: On 09/09/2012 08:05 PM, ching wrote: On 09/09/2012 05:11 PM, Fajar A. Nugraha wrote: On Sun, Sep 9, 2012 at 2:49 PM, ching lschin...@gmail.com wrote: On 09/09/2012 08:30 AM, Jan Steffens wrote: On Sun, Sep 9, 2012 at 2:03 AM, ching lschin...@gmail.com

Re: [PATCH v2 0/6] bug-fixes and cleanup

2012-09-10 Thread Liu Bo
On 09/11/2012 12:20 AM, Josef Bacik wrote: On Fri, Sep 07, 2012 at 08:01:24PM -0600, Liu Bo wrote: From: Liu Bo liub.li...@gmail.com This is a collection of some posted patches. It is also available in git://github.com/liubogithub/btrfs-work.git for-chris v1-v2: patch 1 (Btrfs: fix

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

2012-09-11 Thread Liu Bo
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 --- v3: fix my stupid finger error. fs/btrfs/inode.c |3 +-- fs/btrfs/ioctl.c |5 - 2 files changed, 5 insertions(+), 3

Re: Deadlock in btrfs-cleaner, related to snapshot deletion

2012-09-12 Thread Liu Bo
On 09/12/2012 03:53 PM, Roman Mamedov wrote: Hello, (this is a recap of yesterday's discussion on BTRFS IRC, also to save relevant pastes before pastebins expire) I have my /home on btrfs; a cronjob makes one snapshot every 30 minutes; these snapshots are kept for 24-48 hours, then

Re: [PATCH] Btrfs: delay block group item insertion

2012-09-12 Thread Liu Bo
On Wed, Sep 12, 2012 at 02:04:13PM -0400, Josef Bacik wrote: So we have lots of places where we try to preallocate chunks in order to make sure we have enough space as we make our allocations. This has historically meant that we're constantly tweaking when we should allocate a new chunk, and

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

2012-09-14 Thread Liu Bo
; --- orig_rsv is now B trans-block_rsv = C ... This uses a list of block_rsv instead so that we can either a) PUSH the old one into the list and use a new one in joining, or b) POP the old one in ending this transaction. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/transaction.c

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

2012-09-14 Thread Liu Bo
fs_info-hashers is now an obsolete one. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.h |1 - fs/btrfs/disk-io.c |1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0d195b5..ab7cd13 100644 --- a/fs/btrfs/ctree.h

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

2012-09-14 Thread Liu Bo
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 --- fs/btrfs/extent-tree.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index ba58024

[PATCH 1/5] Btrfs: fix deadlock with freeze and sync

2012-09-14 Thread Liu Bo
freeze and sync. So IMO the safest and most efficient way is to check running transaction in joining a transaction directly. With this patch, I tested xfstests 068 for 120 times and it did not get into deadlock at least here. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/super.c

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

2012-09-14 Thread Liu Bo
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(struct btrfs_root *root, WARN_ON(type

Re: [PATCH 1/5] Btrfs: fix deadlock with freeze and sync

2012-09-14 Thread Liu Bo
On 09/14/2012 06:07 PM, Miao Xie wrote: Onfri, 14 Sep 2012 16:58:03 +0800, Liu Bo wrote: While testing xfstests 068, I realized that commit bd7de2c9a449e26a5493d918618eb20ae60d56bd (Btrfs: fix deadlock with freeze and sync V2) did not fix the bug yet, since someone might jump in between

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

2012-09-14 Thread Liu Bo
On 09/14/2012 08:07 PM, David Sterba wrote: 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

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

2012-09-14 Thread Liu Bo
On 09/14/2012 08:45 PM, 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, All of its callers use 0 as nocow_only now. thanks, liubo Josef

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

2012-09-14 Thread Liu Bo
On 09/14/2012 08:41 PM, Josef Bacik wrote: On Fri, Sep 14, 2012 at 02:58:04AM -0600, Liu Bo wrote: In some workloads we have nested joining transaction operations, eg. run_delalloc_nocow btrfs_join_transaction cow_file_range btrfs_join_transaction it can

Re: [PATCH 1/5] Btrfs: fix deadlock with freeze and sync

2012-09-14 Thread Liu Bo
On 09/14/2012 08:42 PM, Josef Bacik wrote: On Fri, Sep 14, 2012 at 02:58:03AM -0600, Liu Bo wrote: While testing xfstests 068, I realized that commit bd7de2c9a449e26a5493d918618eb20ae60d56bd (Btrfs: fix deadlock with freeze and sync V2) did not fix the bug yet, since someone might jump

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

2012-09-14 Thread Liu Bo
On 09/14/2012 09:01 PM, Liu Bo wrote: On 09/14/2012 08:41 PM, Josef Bacik wrote: On Fri, Sep 14, 2012 at 02:58:04AM -0600, Liu Bo wrote: In some workloads we have nested joining transaction operations, eg. run_delalloc_nocow btrfs_join_transaction cow_file_range

Re: [PATCH] Btrfs: fix race in sync and freeze again

2012-09-14 Thread Liu Bo
do the try lock on the freeze stuff. If it fails we'll return EPERM and just return from sync. This fixes a hang Liu Bo reported when running xfstest 68 in a loop. Thanks, This is also a trylock, why don't we just add a trylock for sb_start_intwrite directly just as what I've done before

Re: Oops with a degraded volume

2012-09-17 Thread Liu Bo
On 09/15/2012 10:17 PM, Antoine Sirinelli wrote: Hi, I have experienced a very reproducible Oops within the btrfs driver. On a linux 3.5.4, if I mount a volume with the option degraded because one of the device is missing, I would get an Oops when I unmount it (or even before). You can see

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

2012-09-17 Thread Liu Bo
and writeback started by defragmentation. This patch is used for the latter one. Originally patch by Li Zefan l...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/extent_io.c |8 fs/btrfs/extent_io.h |2 ++ fs/btrfs/file.c |4 ++-- fs/btrfs/inode.c

[PATCH 2/2 v3] Btrfs: snapshot-aware defrag

2012-09-17 Thread Liu Bo
. Originally patch by Li Zefan l...@cn.fujitsu.com Signed-off-by: Liu Bo bo.li@oracle.com --- Changes since v2: - adopt better names for local structures. - add proper reschedule phrase - better error handling - minor cleanups (Thanks, David) fs/btrfs/inode.c

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

2012-09-17 Thread Liu Bo
Please only push this one since the first one remains unchanged, I also posted it for others to better review. thanks, liubo On 09/17/2012 05:58 PM, 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

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

2012-09-18 Thread Liu Bo
Btrfs uses inclusive range end for lock_extent(), unlock_extent() and related functions, so we made off-by-one errors in file clone. This fixes it and also fixes some style problems. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 18 +- 1 files changed, 9

[PATCH] Btrfs: fix a compiling warning

2012-09-18 Thread Liu Bo
...@intel.com Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/inode.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2a6e9fb..1f85d37 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2095,7 +2095,6 @@ static noinline

Re: [josef-btrfs:master 66/68] fs/btrfs/inode.c:2185:6: warning: passing argument 2 of 'btrfs_drop_extents' from incompatible pointer type

2012-09-18 Thread Liu Bo
On 09/18/2012 10:05 PM, Fengguang Wu wrote: Hi Liu, FYI, there are new compile warnings show up in tree: git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git master head: 6a47d2266699f2d7903d26f178ed135dd9a109cf commit: 434728b4678badfad6e8a35df26034a081014254 [66/68]

Re: enquiry about autodefrag option

2012-09-19 Thread Liu Bo
On 09/19/2012 07:28 PM, ching wrote: can anybody helps? On 09/17/2012 07:15 PM, ching wrote: I am testing btrfs for long-term storage and backup, and i would like to know more about autodefrag option: 1. Will autodefrag option benefit ssd? My understanding is: autodrag -

Re: [PATCH] Btrfs: small fix the commment for the action flags in delayed-ref.h

2012-09-20 Thread Liu Bo
On 09/20/2012 11:07 PM, Wang Sheng-Hui wrote: The action has been merged into struct btrfs_delayed_ref_node, and no struct btrfs_delayed_ref is available now. You can consider sending this kind of typo fix patch to trivial list instead. thanks, liubo Signed-off-by: Wang Sheng-Hui

Re: kernel BUG at fs/btrfs/extent_io.c:1884!

2012-09-20 Thread Liu Bo
On 09/21/2012 11:46 AM, Marc MERLIN wrote: On Thu, Sep 20, 2012 at 10:17:47AM -0700, Marc MERLIN wrote: I had a btrfs built on top of 5 drives (dmcrypt devices). The drive then died while I was writing to the filesystem and my system crashed and rebooted: [384555.534020] sd 10:0:0:0:

[PATCH] Btrfs: limit thread pool size when remounting

2012-09-25 Thread Liu Bo
For some asynchronous threads, such as submit worker and cache worker, we limit their thread pool size when mounting. So we also need to do such things when remounting. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/super.c | 13 - 1 files changed, 8 insertions(+), 5

Re: [PATCH] Btrfs: limit thread pool size when remounting

2012-09-25 Thread Liu Bo
On 09/25/2012 07:39 PM, David Sterba wrote: On Tue, Sep 25, 2012 at 02:48:33PM +0800, Liu Bo wrote: --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1158,17 +1158,20 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info, printk(KERN_INFO btrfs: resize thread pool %d

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

2012-09-25 Thread Liu Bo
On 09/26/2012 01:39 AM, Mitch Harder wrote: On Mon, Sep 17, 2012 at 4:58 AM, Liu Bo bo.li@oracle.com 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

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

2012-10-04 Thread Liu Bo
On 10/03/2012 10:02 PM, Chris Mason wrote: On Tue, Sep 25, 2012 at 07:07:53PM -0600, Liu Bo wrote: On 09/26/2012 01:39 AM, Mitch Harder wrote: On Mon, Sep 17, 2012 at 4:58 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any

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

2012-10-08 Thread Liu Bo
On 10/03/2012 10:02 PM, Chris Mason wrote: On Tue, Sep 25, 2012 at 07:07:53PM -0600, Liu Bo wrote: On 09/26/2012 01:39 AM, Mitch Harder wrote: On Mon, Sep 17, 2012 at 4:58 AM, Liu Bo bo.li@oracle.com wrote: This comes from one of btrfs's project ideas, As we defragment files, we break any

Re: [BUG] __tree_mod_log_rewind makes extent buffers larger than leafsize

2012-10-17 Thread Liu Bo
On 10/17/2012 11:27 PM, Liu Bo wrote: [ 103.354284] kernel BUG at fs/btrfs/ctree.c:1582! [ 103.354305] invalid opcode: [#1] SMP [ 103.354326] Modules linked in: btrfs(O) tcp_lp zlib_deflate libcrc32c fuse lockd rfcomm bnep ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6

[PATCH] Btrfs: cleanup for __merge_refs

2012-10-18 Thread Liu Bo
Parents must be same after going through ref_for_same_block. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/backref.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index f318793..9aaa38e6 100644 --- a/fs/btrfs

Re: [PATCH] Btrfs: cleanup for __merge_refs

2012-10-18 Thread Liu Bo
On 10/18/2012 03:42 PM, Jan Schmidt wrote: On Thu, October 18, 2012 at 09:36 (+0200), Liu Bo wrote: On 10/18/2012 03:31 PM, Jan Schmidt wrote: On Thu, October 18, 2012 at 09:10 (+0200), Liu Bo wrote: Parents must be same after going through ref_for_same_block. Well. We could kill

Re: [PATCH V2] Btrfs: fix unnecessary while loop when search the free space, cache

2012-10-18 Thread Liu Bo
because it is impossible that the extent entry which is in front of a bitmap entry can cover the offset of the entry after that bitmap entry. Looks good to me. Reviewed-by: Liu Bo bo.li@oracle.com Signed-off-by: Miao Xie mi...@cn.fujitsu.com --- Changelog v1 - v2: - fix the same

Re: [PATCH] Btrfs: MOD_LOG_KEY_REMOVE_WHILE_MOVING never change node's nritems

2012-10-18 Thread Liu Bo
On 10/19/2012 01:13 PM, Jan Schmidt wrote: On Thu, October 18, 2012 at 09:32 (+0200), Liu Bo wrote: Key MOD_LOG_KEY_REMOVE_WHILE_MOVING means that we're doing memmove inside an extent buffer node, and the node's number of items remains unchanged, so we don't need to increment node's number

[PATCH 1/4] Btrfs: MOD_LOG_KEY_REMOVE_WHILE_MOVING never change node's nritems

2012-10-19 Thread Liu Bo
pointer, we need to decrease node's nritems by one, and we honor MOD_LOG_KEY_REMOVE for deleting. - If we do memory move for balance left/right, we need to decrease node's nritems, and we honor MOD_LOG_KEY_REMOVE for balaning. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.c

[PATCH 2/4] Btrfs: reorder tree mod log operations in deleting a pointer

2012-10-19 Thread Liu Bo
Since we don't use MOD_LOG_KEY_REMOVE_WHILE_MOVING to add nritems during rewinding, we should insert a MOD_LOG_KEY_REMOVE operation first. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/btrfs

[PATCH 4/4] Btrfs: cleanup unused arguments

2012-10-19 Thread Liu Bo
'disk_key' is not used at all. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ctree.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 235831f..7f649d2 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -772,8

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