[PATCH v2 0/2] Online data deduplication

2013-04-14 Thread Liu Bo
This is the second attempt for online data deduplication. NOTE: This leads to a FORMAT CHANGE, DO NOT use it on real data! Data deduplication is a specialized data compression technique for eliminating duplicate copies of repeating data.[1] This patch set is also related to "Content based storag

[PATCH v2 2/2] Btrfs: skip merge part for delayed data refs

2013-04-14 Thread Liu Bo
When we have data deduplication on, we'll hang on the merge part because it needs to verify every queued delayed data refs related to this disk offset. And in the case of delayed data refs, we don't usually have too much data refs to merge. So it's safe to shut it down for data refs. Signed-off-

[PATCH v2 1/2] Btrfs: online data deduplication

2013-04-14 Thread Liu Bo
(NOTE: This leads to a FORMAT CHANGE, DO NOT use it on real data.) This introduce the online data deduplication feature for btrfs. (1) WHY do we need deduplication? To improve our storage effiency. (2) WHAT is deduplication? Two key ways for practical deduplication implementations, *

[PATCH] Btrfs: cleanup to remove reduplicate code in transaction.c

2013-04-14 Thread Wang Shilong
From: Wang Shilong Signed-off-by: Wang Shilong --- fs/btrfs/transaction.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index c4a1531..a8e3c36 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @

[PATCH mainline] btrfs: fix minor typo in comment

2013-04-14 Thread Nathaniel Yazdani
In the comment describing the sync_writers field of the btrfs_inode struct, "fsyncing" was misspelled "fsycing." Signed-off-by: Nathaniel Yazdani --- diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index d9b97d4..08b286b 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.

Re: [PATCH 2/9] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
On 04/12/2013 11:57 PM, David Sterba wrote: On Fri, Apr 05, 2013 at 01:54:56PM +0800, Anand Jain wrote: --- a/cmds-balance.c +++ b/cmds-balance.c @@ -662,8 +662,12 @@ static int cmd_balance_status(int argc, char **argv) close(fd); if (ret < 0) { + if (e == ENOTCO

[PATCH v2] Btrfs: allow file data clone within a file

2013-04-14 Thread Liu Bo
We did not allow file data clone within the same file because of deadlock issues. However, we now use nested lock to avoid deadlock between the parent directory and the child file. So it's safe to do file clone within the same file when the two ranges are not overlapped. Signed-off-by: Liu Bo -

Re: [PATCH 2/2] Btrfs: introduce noextiref mount option

2013-04-14 Thread Miao Xie
On Fri, 12 Apr 2013 09:02:34 +0200, Jan Schmidt wrote: +static int btrfs_close_extend_iref(struct btrfs_fs_info *fs_info, + unsigned long old_opts) >>> >>> The name irritated me, it's more like "unset" instead of "close", isn't it? >> >> Maybe "btrfs_set_no_ext

Re: [PATCH 2/2] Btrfs: introduce noextiref mount option

2013-04-14 Thread Jan Schmidt
On Mon, April 15, 2013 at 04:58 (+0200), Miao Xie wrote: > On Fri, 12 Apr 2013 09:02:34 +0200, Jan Schmidt wrote: > +static int btrfs_close_extend_iref(struct btrfs_fs_info *fs_info, > +unsigned long old_opts) The name irritated me, it's more like "unse

Re: [PATCH 2/2] Btrfs: introduce noextiref mount option

2013-04-14 Thread Wang Shilong
Jan Schmidt 写道: > On Mon, April 15, 2013 at 04:58 (+0200), Miao Xie wrote: >> On Fri, 12 Apr 2013 09:02:34 +0200, Jan Schmidt wrote: >> +static int btrfs_close_extend_iref(struct btrfs_fs_info *fs_info, >> + unsigned long old_opts) > The name irritated

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Wed, April 10, 2013 at 18:47 (+0200), David Sterba wrote: > On Fri, Apr 05, 2013 at 01:38:16PM +0200, Jan Schmidt wrote: >> +if (root->fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN) { > > I was wondering if merging qgroup_flags with fs_state would make sense > to you. There are cu

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Mon, April 15, 2013 at 07:44 (+0200), Jan Schmidt wrote: > Thanks, v2 to come. Uh, but not immediately. I didn't get tracking of "exclusive" right. That will need some time to fix and test. -Jan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Wang Shilong
Hello Jan, > On Mon, April 15, 2013 at 07:44 (+0200), Jan Schmidt wrote: >> Thanks, v2 to come. > > Uh, but not immediately. I didn't get tracking of "exclusive" right. That will > need some time to fix and test. 'exclusive' adds the complexity of btrfs qgroup. So if you send V2. I'd like you a

[PATCH 00/11 v2] a bunch of miscellaneous bug fixes

2013-04-14 Thread Anand Jain
v1->v2: Accepts the review comments from David Accepts the review comments from Stefan Rebase changes Adds the 10/11 and 11/11 which was outside this patch-set Anand Jain (11): btrfs-progs: root_item generation_v2 is out of sync after btrfsck btrfs-progs: no pen

[PATCH 01/11, RESEND] btrfs-progs: root_item generation_v2 is out of sync after btrfsck

2013-04-14 Thread Anand Jain
reproducing steps: mkfs.btrfs /dev/dm-2 -f mount /dev/dm-2 /btrfs umount /btrfs btrfs check /dev/dm-2 --repair mount /dev/dm-2 /btrfs btrfs: mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields. btrfs

[PATCH 02/11, RESEND] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-off-by: Anand Jain --- cmds-balance.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmds-balance.c b/cmds-balan

[PATCH 03/11 v2] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-14 Thread Anand Jain
In the cases where one of the disk is not suitable for btrfs, then we would fail the mkfs, however we determine that after we have written btrfs to the preceding disks. At this time if user changes mind for not to use btrfs will left with no choice. So this patch will check if all the provided dis

[PATCH 07/11, RESEND] btrfs-progs: delete unused function get_mountpt

2013-04-14 Thread Anand Jain
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain --- utils.c | 35 --- 1 file changed, 35 deletions(-) diff --git a/utils.c b/utils.c index 67419da..926421c 100644 --- a/utils.c +++ b/utils.c @@ -977,41 +977,6 @@ out_mntloop_err: return ret;

[PATCH 09/11, RESEND] btrfs-progs: fix btrfs scrub start help

2013-04-14 Thread Anand Jain
a very trivial fix Signed-off-by: Anand Jain --- cmds-scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 5922361..c0dc584 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1465,7 +1465,7 @@ out: } static const char * const cmd_scr

[PATCH 11/11, RESEND] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

2013-04-14 Thread Anand Jain
If one of the copy of the superblock is zero it does not confirm to us that btrfs isn't there on that disk. When we are having more than one copy of superblock we should rather let the for loop to continue to check other copies. the following test case and results would justify the fix mkfs.btrfs

[PATCH 10/11, RESEND] btrfs-progs: avoid ioctl for multipath-dev with its non-multipath path

2013-04-14 Thread Anand Jain
We should avoid using non multi-path (mp) path for mp disks As of now there is no good way (like api) to check that. A workaround way is to check if the O_EXCL open is unsuccessful. This is safe since otherwise the BTRFS_IOC_SCAN_DEV ioctl would fail if the disk-path can not be opened with the flag

[PATCH 06/11, v2] btrfs-progs: check if btrfs kernel module is loaded

2013-04-14 Thread Anand Jain
when we have to report no such file error for /dev/btrfs-control we could confirm if btrfs kernel is present and report it and skip registration where appropriate v1->v2: use /proc/filesystems to check if the btrfs is present Signed-off-by: Anand Jain --- cmds-device.c | 60

[PATCH 08/11, RESEND] btrfs-progs: btrfs-select-super output is confusing when it fails

2013-04-14 Thread Anand Jain
Trivial patch: ./btrfs-progs/btrfs-select-super -s 0 /dev/sdc using SB copy 0, bytenr 65536 No valid Btrfs found on /dev/sdc Open ctree failed The line 'using..' is confusing which gives an indication that command is successful This patch will avoid that when command fails Signed-off-by: Anand J

[PATCH 04/11 v2] btrfs-progs: cmd replace should check target-dev fully

2013-04-14 Thread Anand Jain
as of now in replace command target dev is being checked for mounted and for existing fs, however there is newly introduced test_dev_for_mkfs in mkfs.c which is suitable for this job, and further it also checks if dev can be opened for with O_EXCL. Its better to use test_dev_for_mkfs Signed-off-by

[PATCH 05/11, RESEND] btrfs-progs: mkfs stdout print to match chronology

2013-04-14 Thread Anand Jain
A trivial fix: To match the events inside to what being printed out before: :: adding device /dev/dm-3 id 2 adding device /dev/dm-4 id 3 adding device /dev/dm-5 id 4 fs created label (null) on /dev/dm-2 nodesize 4096 leafsize 4096 sectorsize 4096 size 213.20GB Btrfs v0.20-rc1-235-gdd21bc1 ---

Re: [PATCH 02/11, v2] btrfs-progs: no pending balance is not an error

2013-04-14 Thread Anand Jain
Oh. this title prefix should be v2 not RESEND. v1->v2 Accepts David review comments Thanks, Anand On 04/15/2013 02:38 PM, Anand Jain wrote: Having no balance running/ paused/completed is a normal situation, so the current output message should be positive with return val zero. Signed-off-

Re: [PATCH 3/9] btrfs-progs: mkfs should first check all disks before writing to a disk

2013-04-14 Thread Anand Jain
On 04/13/2013 12:06 AM, David Sterba wrote: On Fri, Apr 05, 2013 at 01:54:57PM +0800, Anand Jain wrote: In the cases where one of the disk is not suitable for btrfs, then we would fail the mkfs, however we determine that after we have written btrfs to the preceding disks. At this time if user

Re: [PATCH 1/2] Btrfs: rescan for qgroups

2013-04-14 Thread Jan Schmidt
On Mon, April 15, 2013 at 08:08 (+0200), Wang Shilong wrote: > Hello Jan, > >> On Mon, April 15, 2013 at 07:44 (+0200), Jan Schmidt wrote: >>> Thanks, v2 to come. >> >> Uh, but not immediately. I didn't get tracking of "exclusive" right. That >> will >> need some time to fix and test. > > > 'ex