[PATCH] Btrfs: fix reada debug code compilation

2013-04-16 Thread Vincent
This fixes the following errors: fs/btrfs/reada.c: In function ‘btrfs_reada_wait’: fs/btrfs/reada.c:958:42: error: invalid operands to binary (have ‘atomic_t’ and ‘int’) fs/btrfs/reada.c:961:41: error: invalid operands to binary (have ‘atomic_t’ and ‘int’) Signed-off-by: Vincent Stehlé

Re: Activating space_cache after read-only snapshots without space_cache have been taken

2013-04-16 Thread Sander
Liu Bo wrote (ao): On Tue, Apr 16, 2013 at 02:28:51AM +0200, Ochi wrote: The situation is the following: I have created a backup-volume to which I regularly rsync a backup of my system into a subvolume. After rsync'ing, I take a _read-only_ snapshot of that subvolume with a timestamp

[PATCH] Btrfs: return error when we specify wrong start

2013-04-16 Thread Liu Bo
We need such a sanity check for wrong start, otherwise, even with a wrong start that's larger than file size, we can end up not only changing inode's force compress flag but also FS's incompat flags. Signed-off-by: Liu Bo bo.li@oracle.com --- fs/btrfs/ioctl.c | 11 +++ 1 files

[PATCH] Btrfs-progs: record errno for ioctl DEFRAG_RANGE

2013-04-16 Thread Liu Bo
In order to sparse exact error message, we need to record errno here. Signed-off-by: Liu Bo bo.li@oracle.com --- cmds-filesystem.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 2210020..3f386e2 100644 ---

Re: [PATCH] Btrfs: return error when we specify wrong start

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 10:40 (+0200), Liu Bo wrote: We need such a sanity check for wrong start, otherwise, even with a wrong start that's larger than file size, we can end up not only changing inode's force compress flag but also FS's incompat flags. That reads out very cryptic. Can you

[PATCH v2 0/3] Btrfs: quota rescan for 3.10

2013-04-16 Thread Jan Schmidt
The kernel side for rescan, which is needed if you want to enable qgroup tracking on a non-empty volume. The first patch splits btrfs_qgroup_account_ref into readable ans reusable units. The second patch adds the rescan implementation (refer to its commit message for a description of the

[PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
If qgroup tracking is out of sync, a rescan operation can be started. It iterates the complete extent tree and recalculates all qgroup tracking data. This is an expensive operation and should not be used unless required. A filesystem under rescan can still be umounted. The rescan continues on the

[PATCH v2 3/3] Btrfs: automatic rescan after quota enable command

2013-04-16 Thread Jan Schmidt
When qgroup tracking is enabled, we do an automatic cycle of the new rescan mechanism. Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net --- fs/btrfs/qgroup.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index

[PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Jan Schmidt
The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that the function is restructured into readable subunits. Signed-off-by: Jan

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Wang Shilong
Hello Jan, The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that the function is restructured into readable subunits. How

Re: [PATCH] Btrfs: return error when we specify wrong start

2013-04-16 Thread Liu Bo
On Tue, Apr 16, 2013 at 10:44:33AM +0200, Jan Schmidt wrote: On Tue, April 16, 2013 at 10:40 (+0200), Liu Bo wrote: We need such a sanity check for wrong start, otherwise, even with a wrong start that's larger than file size, we can end up not only changing inode's force compress flag but

[PATCH v2] Btrfs: return error when we specify wrong start to defrag

2013-04-16 Thread Liu Bo
We need such a sanity check for wrong start when we defrag a file, otherwise, even with a wrong start that's larger than file size, we can end up changing not only inode's force compress flag but also FS's incompat flags. Signed-off-by: Liu Bo bo.li@oracle.com --- v2: make changelog more

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Wang Shilong
Hello, Jan If qgroup tracking is out of sync, a rescan operation can be started. It iterates the complete extent tree and recalculates all qgroup tracking data. This is an expensive operation and should not be used unless required. A filesystem under rescan can still be umounted. The rescan

[PATCH] btrfs-progs: delete unused function btrfs_read_super_device

2013-04-16 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- volumes.c | 9 - 1 file changed, 9 deletions(-) diff --git a/volumes.c b/volumes.c index b555ded..7a9b6f0 100644 --- a/volumes.c +++ b/volumes.c @@ -1643,15 +1643,6 @@ static int read_one_dev(struct btrfs_root *root, return ret;

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 11:20 (+0200), Wang Shilong wrote: Hello Jan, The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side effect is that

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 11:26 (+0200), Wang Shilong wrote: Hello, Jan If qgroup tracking is out of sync, a rescan operation can be started. It iterates the complete extent tree and recalculates all qgroup tracking data. This is an expensive operation and should not be used unless required.

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Wang Shilong
Jan Schmidt 写道: ..[snip].. I don't see where I'm calling ulist_free(roots) in the error path. One of us is missing something :-) Yeah, you are right. i read a more '}'.. ^_^ Thanks, Wang + spin_lock(fs_info-qgroup_lock); + seq = fs_info-qgroup_seq; +

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Wang Shilong
Hello Jan, On Tue, April 16, 2013 at 11:20 (+0200), Wang Shilong wrote: Hello Jan, The function is separated into a preparation part and the three accounting steps mentioned in the qgroups documentation. The goal is to make steps two and three usable by the rescan functionality. A side

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Wang Shilong
Hello Jan, slot = path-slots[0]; ptr = btrfs_item_ptr(l, slot, struct btrfs_qgroup_status_item); + spin_lock(fs_info-qgroup_lock); Why we need hold qgroup_lock here? would you please explain... Thanks, Wang btrfs_set_qgroup_status_flags(l, ptr,

[PATCH] Btrfs: remove unused variable in the iterate_extent_inodes()

2013-04-16 Thread Wang Shilong
Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com --- fs/btrfs/backref.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index bd605c8..fa531e8 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1461,8 +1461,6 @@ int

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread David Sterba
On Tue, Apr 16, 2013 at 05:56:05PM +0800, Wang Shilong wrote: But static checker may want to know what is 3 steps just by the function name but not to read the pdf. I'm curious what static checker you mean and how a function name helps there. thanks, david -- To unsubscribe from this list:

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread Wang Shilong
Hi David, On Tue, Apr 16, 2013 at 05:56:05PM +0800, Wang Shilong wrote: But static checker may want to know what is 3 steps just by the function name but not to read the pdf. I'm curious what static checker you mean and how a function name helps there. I mean that other developers will

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Jan Schmidt
On Tue, April 16, 2013 at 12:08 (+0200), Wang Shilong wrote: Hello Jan, slot = path-slots[0]; ptr = btrfs_item_ptr(l, slot, struct btrfs_qgroup_status_item); +spin_lock(fs_info-qgroup_lock); Why we need hold qgroup_lock here? would you please explain... It would have

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread David Sterba
On Tue, Apr 16, 2013 at 10:45:19AM +0200, Jan Schmidt wrote: +static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg) +{ + struct btrfs_root *root = BTRFS_I(fdentry(file)-d_inode)-root; + struct btrfs_ioctl_quota_rescan_args *qsa; + int ret = 0; + +

Re: [PATCH v2 1/3] Btrfs: split btrfs_qgroup_account_ref into four functions

2013-04-16 Thread David Sterba
On Tue, Apr 16, 2013 at 06:47:15PM +0800, Wang Shilong wrote: I mean that other developers will get more information by the function name. I don't dare to suggest putting a comment before the functions david -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of

Re: Activating space_cache after read-only snapshots without space_cache have been taken

2013-04-16 Thread Ochi
On 04/16/2013 10:10 AM, Sander wrote: Liu Bo wrote (ao): On Tue, Apr 16, 2013 at 02:28:51AM +0200, Ochi wrote: The situation is the following: I have created a backup-volume to which I regularly rsync a backup of my system into a subvolume. After rsync'ing, I take a _read-only_ snapshot of

Re: [PATCH] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

2013-04-16 Thread David Sterba
On Fri, Apr 12, 2013 at 03:55:06PM +0800, Anand Jain wrote: 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.

Re: [PATCH v2 2/3] Btrfs: rescan for qgroups

2013-04-16 Thread Wang Shilong
Hello Jan, more comments below.. [...snip..] + +static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg) +{ + struct btrfs_root *root = BTRFS_I(fdentry(file)-d_inode)-root; + struct btrfs_ioctl_quota_rescan_args *qsa; + int ret = 0; + + if

Re: [PATCH 00/17] Btrfs-progs: some receive related patches

2013-04-16 Thread David Sterba
Hi, On Tue, Apr 09, 2013 at 07:08:28PM +0200, Stefan Behrens wrote: Alex Lyakas (1): btrfs-progs: Fix the receive code pathing Stefan Behrens (16): Btrfs-progs: Use /proc/mounts instead of /etc/mtab Btrfs-progs: ignore subvols above BTRFS_LAST_FREE_OBJECTID Btrfs-progs: close file

Re: btrfs scrub gives unable to find logical $hugenum len 16384

2013-04-16 Thread Martin Steigerwald
On Saturday 13 April 2013 17:48:31 Martin Steigerwald wrote: Hi! Please answer soon whether it would be a good idea to replay a backup right now as I am leaving to Berlin tomorrow for a week without my backup drive with me. Well, I made space on an external 2,5 inch drive, that I can take

Re: [PATCH v2 3/3] Btrfs: automatic rescan after quota enable command

2013-04-16 Thread Wang Shilong
Hi Chris, I' ve put my efforts in btrfs quota for a period of time. and i send a bunch of patches about btrfs quota. If you pull Jan's qgroup rescan patches, i'd like that you pull my this patch firstly: https://patchwork.kernel.org/patch/2402871/ Jan's group

Re: [PATCH] Btrfs: fix reada debug code compilation

2013-04-16 Thread David Sterba
On Tue, Apr 16, 2013 at 10:15:25AM +0200, Vincent wrote: This fixes the following errors: fs/btrfs/reada.c: In function ‘btrfs_reada_wait’: fs/btrfs/reada.c:958:42: error: invalid operands to binary (have ‘atomic_t’ and ‘int’) fs/btrfs/reada.c:961:41: error: invalid operands to

Re: [PATCH v2] Btrfs: return error when we specify wrong start to defrag

2013-04-16 Thread David Sterba
On Tue, Apr 16, 2013 at 05:20:28PM +0800, Liu Bo wrote: We need such a sanity check for wrong start when we defrag a file, otherwise, even with a wrong start that's larger than file size, we can end up changing not only inode's force compress flag but also FS's incompat flags. The range-start

Re: [PATCH v2] Btrfs: return error when we specify wrong start to defrag

2013-04-16 Thread Liu Bo
On Tue, Apr 16, 2013 at 03:38:28PM +0200, David Sterba wrote: On Tue, Apr 16, 2013 at 05:20:28PM +0800, Liu Bo wrote: We need such a sanity check for wrong start when we defrag a file, otherwise, even with a wrong start that's larger than file size, we can end up changing not only

Re: corrupted filesystem. mounts with -o recovery,ro but not -o recovery or -o ro

2013-04-16 Thread Jon Nelson
Tried to mount with -o recovery using 3.8.7. No change. Does anybody have any suggestions? On Sat, Apr 13, 2013 at 6:21 PM, Jon Nelson jnel...@jamponi.net wrote: I have a 4-disk btrfs filesystem in raid1 mode. I'm running openSUSE 12.3, 3.7.10, x86_64. A few days ago something went wrong and

One random read streaming is fast (~1200MB/s), but two or more are slower (~750MB/s)?

2013-04-16 Thread Matt Pursley
Hi All, I have an LSI HBA card (LSI SAS 9207-8i) with 12 7200rpm SAS drives attached. When it's formated with mdraid6+ext4 I get about 1200MB/s for multiple streaming random reads with iozone. With btrfs in 3.9.0-rc4 I can also get about 1200MB/s, but only with one stream at a time. As soon as

[PATCH] Btrfs-progs: fix csum check when extent lands on block group

2013-04-16 Thread Josef Bacik
I was running fsync() tests and noticed that occasionally I was getting a bunch of errors from fsck complaining about csums not having corresponding extents. Thankfully after a few days of debugging this it turned out to be a bug with fsck. The csums were for an extent that started at the same

[PATCH] Btrfs-progs: make restore deal with really broken file systems V2

2013-04-16 Thread Josef Bacik
All we need for restore to work is the chunk root, the tree root and the fs root we want to restore from. So to do this we need to make a few adjustments 1) Make open_ctree_fs_info fail completely if it can't read the chunk tree. There is no sense in continuing if we can't read the chunk tree

[PATCH 0/4] [RFC] btrfs: offline dedupe

2013-04-16 Thread Mark Fasheh
Hi, The following series of patches implements in btrfs an ioctl to do offline deduplication of file extents. To be clear, offline in this sense means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software

[PATCH 1/4] btrfs: abtract out range locking in clone ioctl()

2013-04-16 Thread Mark Fasheh
The range locking in btrfs_ioctl_clone is trivially broken out into it's own function. This reduces the complexity of btrfs_ioctl_clone() by a small bit and makes that locking code available to future functions in fs/btrfs/ioctl.c Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c |

[PATCH 2/4] btrfs_ioctl_clone: Move clone code into it's own function

2013-04-16 Thread Mark Fasheh
There's some 250+ lines here that are easily encapsulated into their own function. I don't change how anything works here, just create and document the new btrfs_clone() function from btrfs_ioctl_clone() code. Signed-off-by: Mark Fasheh mfas...@suse.de --- fs/btrfs/ioctl.c | 232

[PATCH 3/4] btrfs: Introduce extent_read_full_page_nolock()

2013-04-16 Thread Mark Fasheh
We want this for btrfs_extent_same. Basically readpage and friends do their own extent locking but for the purposes of dedupe, we want to have both files locked down across a set of readpage operations (so that we can compare data). Introduce this variant and a flag which can be set for

[PATCH 4/4] btrfs: offline dedupe

2013-04-16 Thread Mark Fasheh
This patch adds an ioctl, BTRFS_IOC_FILE_EXTENT_SAME which will try to de-duplicate a list of extents across a range of files. Internally, the ioctl re-uses code from the clone ioctl. This avoids rewriting a large chunk of extent handling code. Userspace passes in an array of file, offset pairs

Re: [PATCH 0/4] [RFC] btrfs: offline dedupe

2013-04-16 Thread Marek Otahal
Hi Mark, could you compare (appart from online/offline) your implementation to LiuBo's work?, appeared on ML a while ago: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg23656.html It would be interesting if the two approaches could share some code, and also confirmation that

Re: [PATCH 0/4] [RFC] btrfs: offline dedupe

2013-04-16 Thread Mark Fasheh
On Wed, Apr 17, 2013 at 12:50:04AM +0200, Marek Otahal wrote: could you compare (appart from online/offline) your implementation to LiuBo's work?, appeared on ML a while ago: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg23656.html Well that's the primary difference. Liu Bo's

Re: [PATCH] btrfs-progs: a copy of superblock is zero may not mean btrfs is not there

2013-04-16 Thread Anand Jain
On 04/16/2013 07:57 PM, David Sterba wrote: On Fri, Apr 12, 2013 at 03:55:06PM +0800, Anand Jain wrote: 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

Re: [PATCH 0/4] [RFC] btrfs: offline dedupe

2013-04-16 Thread Liu Bo
On Tue, Apr 16, 2013 at 04:17:15PM -0700, Mark Fasheh wrote: On Wed, Apr 17, 2013 at 12:50:04AM +0200, Marek Otahal wrote: could you compare (appart from online/offline) your implementation to LiuBo's work?, appeared on ML a while ago: