[PATCH 1/3] btrfs: backref: Don't merge refs which are not for same block.

2015-04-01 Thread Qu Wenruo
Old __merge_refs() in backref.c will even merge refs whose root_id are different, which makes qgroup gives wrong result. Fix it by checking ref_for_same_block() before any mode specific works. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- fs/btrfs/backref.c | 6 +++--- 1 file changed, 3

[PATCH 0/3] Use list to replace rb_tree in btrfs_delayed_ref_head-ref_roots.

2015-04-01 Thread Qu Wenruo
The old rbtree implement of ref_head-ref_root sacrificed the insert order to do better delayed_ref_node merging. However the out of order behavior makes btrfs_find_all_roots() unable to find correct root, since it needs the insert order to skip later delayed_nodes. Without such ability, qgroup

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Timo Kokkonen
Hi, On 01.04.2015 10:03, Omar Sandoval wrote: On Tue, Mar 31, 2015 at 10:54:55PM -0500, Eric W. Biederman wrote: Omar Sandoval osan...@osandov.com writes: On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: Before

[PATCH 2/3] btrfs: delayed-ref: Use list to replace the ref_root in ref_head.

2015-04-01 Thread Qu Wenruo
This patch replace the rbtree used in ref_head to list. This has the following two advantages: 1) Qgroup codes now get an accurate view on the delayed_ref order. This is the basis for the improved qgroup codes. 2) Easier merge logic. With the new list implement, we only need to care merging the

[PATCH] btrfs-progs doc: emphasis that only mounted device works for btrfs device stats

2015-04-01 Thread Chen Hanxiao
We provided format path|device in command line. But btrfs device stats doesn't work if device is not mounted. Also fix some tailing whitespace. Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com --- Documentation/btrfs-device.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

Re: Is rbtree really needed to restore ref_root in btrfs_delayed_ref_head?

2015-04-01 Thread Qu Wenruo
If no one disagree, I'll try to implement it using list. In fact, after an easy patch and some tests, it doesn't bring much performance regression, and delayed_ref_nodes are still mergeable. Thanks, Qu Original Message Subject: Is rbtree really needed to restore ref_root

Re: ERROR: error removing the device '/dev/sdXN' - Inappropriate ioctl for device

2015-04-01 Thread Anand Jain
btrfs device delete /dev/sdf5 /mnt/data2 ERROR: error removing the device '/dev/sdf5' - Inappropriate ioctl for device very strange. 'btrfs fi show -m' shows btrfs fs(s) that are mounted. - Anand -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a

Re: [PATCH v2] Btrfs: add debugfs file to test transaction aborts

2015-04-01 Thread Anand Jain
+bool debugfs_abort_transaction(struct btrfs_fs_info *fs_info) +{ + if (!btrfs_debugfs_label_trans_abort[0]) + return false; + return strcmp(fs_info-super_copy-label, + btrfs_debugfs_label_trans_abort) == 0; +} + label is not mandatory to be

Re: [PATCH v2] Btrfs: add debugfs file to test transaction aborts

2015-04-01 Thread Filipe David Manana
On Wed, Apr 1, 2015 at 7:41 AM, Anand Jain anand.j...@oracle.com wrote: +bool debugfs_abort_transaction(struct btrfs_fs_info *fs_info) +{ + if (!btrfs_debugfs_label_trans_abort[0]) + return false; + return strcmp(fs_info-super_copy-label, +

[PATCH] Btrfs: avoid syncing log in the fast fsync path when not necessary

2015-04-01 Thread Filipe Manana
Commit 3a8b36f37806 (Btrfs: fix data loss in the fast fsync path) added a performance regression for that causes an unnecessary sync of the log trees (fs/subvol and root log trees) when 2 consecutive fsyncs are done against a file, without no writes or any metadata updates to the inode in between

How to avoid certain file being defragmented?

2015-04-01 Thread Wang, Zhiye
Hello, I have some files which I hope their on-disk data can be on fixed location of disk. My understanding is that defragmentation operation can potentially move data blocks of a file. So, can I avoid certain file being defragmented in btrfs?  Thanks Mike​

Re: Upgrade to 3.19.2 Kernel fails to boot

2015-04-01 Thread Anand Jain
Eric found something like this and has a fix with in the email. Sub: I think btrfs: fix leak of path in btrfs_find_item broke stable trees ... Anand On 03/24/2015 06:40 PM, Rich Freeman wrote: On Tue, Mar 24, 2015 at 2:31 AM, Anand Jain anand.j...@oracle.com wrote: Do you have this fix ..

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Tue, Mar 31, 2015 at 10:54:55PM -0500, Eric W. Biederman wrote: Omar Sandoval osan...@osandov.com writes: On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: Before commit bafc9b754f75 (vfs: More precise tests in

[PATCH 3/3] btrfs: delayed-ref: Cleanup the unneeded functions.

2015-04-01 Thread Qu Wenruo
Cleanup the rb_tree merge/insert/update functions, since now we use list instead of rb_tree now. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- fs/btrfs/delayed-ref.c | 174 - 1 file changed, 174 deletions(-) diff --git

Re: ERROR: error removing the device '/dev/sdXN' - Inappropriate ioctl for device

2015-04-01 Thread Martin
On 01/04/15 08:06, Anand Jain wrote: btrfs device delete /dev/sdf5 /mnt/data2 ERROR: error removing the device '/dev/sdf5' - Inappropriate ioctl for device very strange. 'btrfs fi show -m' shows btrfs fs(s) that are mounted. Looks like my /dev/sdf isn't responding with anything useful

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread David Sterba
On Wed, Apr 01, 2015 at 12:03:28AM -0700, Omar Sandoval wrote: --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1024,6 +1024,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) struct btrfs_root *root = info-tree_root; char *compress_type; +

Re: How to avoid certain file being defragmented?

2015-04-01 Thread Hugo Mills
On Wed, Apr 01, 2015 at 12:42:04PM +, Wang, Zhiye wrote: Hello, I have some files which I hope their on-disk data can be on fixed location of disk. My understanding is that defragmentation operation can potentially move data blocks of a file. So, can I avoid certain file being

Re: ERROR: error removing the device '/dev/sdXN' - Inappropriate ioctl for device

2015-04-01 Thread Anand Jain
Looks like an option to use devid to delete a device would have mitigated the issue. Also the error reported is no where near the reality. Will fix them. Thanks for reporting. Anand On 04/01/2015 06:54 PM, Martin wrote: On 01/04/15 08:06, Anand Jain wrote: btrfs device delete

Re: WARNING at fs/btrfs/super.c:260 __btrfs_abort_transaction (error -17)

2015-04-01 Thread Chris Mason
On Tue, Mar 24, 2015 at 6:23 PM, Sophie just4pleis...@gmail.com wrote: On 24/03/15 17:34, Chris Mason wrote: On Tue, Mar 24, 2015 at 9:43 AM, Sophie Dexter just4pleis...@gmail.com wrote: On 20/03/2015 15:19, Sophie Dexter wrote: I'm given to understand that this is the right place to

Is this normal? Should I use scrub?

2015-04-01 Thread Andy Smith
Hello, I have a 6 device RAID-1 filesystem: $ sudo btrfs fi df /srv/tank Data, RAID1: total=1.24TiB, used=1.24TiB System, RAID1: total=32.00MiB, used=184.00KiB Metadata, RAID1: total=3.00GiB, used=1.65GiB unknown, single: total=512.00MiB, used=0.00 $ sudo btrfs fi sh /srv/tank Label: 'tank'

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Tue, Mar 31, 2015 at 4:09 PM, Chris Murphy li...@colorremedies.com wrote: A failure of the HDD cannot be ruled out, low power conditions, cheap consumer part... Well you have to rule that out before anyone on this list can really help. Try booting Fedora 21 install media, and using smartctl

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
Hi Chris, list, thanks for your debugging ideas so far. Now this gets interesting. I booted off a LiveUSB disk, and it just mounted sysroot. WTH? See below. Perhaps the newer kernel (in latest F21) has regressed in handling some kinds of errors during mount, or the dracut/systemd mounting

Re: Is this normal? Should I use scrub?

2015-04-01 Thread Hugo Mills
Hi, Andy, On Wed, Apr 01, 2015 at 03:11:14PM +, Andy Smith wrote: I have a 6 device RAID-1 filesystem: [snip tale of a filesystem with out of data data on one copy of the RAID] I have now got a new enclosure and put this system back together with all six devices. I was not expecting

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Wed, Apr 1, 2015 at 11:42 AM, Martin Langhoff martin.langh...@gmail.com wrote: See below. Perhaps the newer kernel (in latest F21) has regressed in handling some kinds of errors during mount, or the dracut/systemd mounting process is less resilient than mounting under a fully booted system?

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
Whenever I have these boot problems, I'm noticing that sometimes the device, /dev/sda5, is showing up with lsblk (libblkid) as /dev/block/8:5 while everything else (not-Btrfs) on that device shows up as /dev/sdaX. Does anyone know what that might mean? Chris Murphy -- To unsubscribe from this

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Wed, Apr 01, 2015 at 01:22:42PM +0200, David Sterba wrote: On Wed, Apr 01, 2015 at 12:03:28AM -0700, Omar Sandoval wrote: --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1024,6 +1024,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) struct

[PATCH] Btrfs: RENAME_EXCHANGE semantic for renameat2()

2015-04-01 Thread Davide Italiano
Signed-off-by: Davide Italiano dccitali...@gmail.com --- fs/btrfs/inode.c | 190 ++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d2e732d..49b0867 100644 --- a/fs/btrfs/inode.c +++

[PATCH] Btrfs: implement RENAME_EXCHANGE semantic

2015-04-01 Thread Davide Italiano
This is an attempt to implement RENAME_EXCHANGE in btrfs. It survived basic testing and I think it's ready for others' feedback. I'll stress test {and, or} rewrite it depending on people's comments. Davide Italiano (1): Btrfs: RENAME_EXCHANGE semantic for renameat2() fs/btrfs/inode.c | 190

[PATCH 1/2] btrfs-progs: convert: Make ext*_image file obey datacsum setting.

2015-04-01 Thread Qu Wenruo
Before this patch, ext*_image is always set NODATACSUM inode flag. However btrfs-convert will set normal file with DATACUSM flag by default, and generate checksum for regular file extent. Now, a regular file extent is shared by a btrfs file inode with DATACSUM and ext*_image with NODATACSUM, and

[PATCH 2/2] btrfs-progs: convert-test: Add test for converting ext* with regular file extent.

2015-04-01 Thread Qu Wenruo
Before previous patch, btrfs-convert will result fsck complain if there is any regular file extent in newly converted btrfs. Add test case for it. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- tests/convert-tests.sh | 85 -- 1 file changed,

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Wed, Apr 1, 2015 at 2:04 PM, Chris Murphy li...@colorremedies.com wrote: When I had this same btrfs check error, it was the exact inode number and same /etc/shadow file. I didn't diff the two shadow files, but I That's too bizarre for words. Two folks, on two different systems, getting btrfs

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 12:16 PM, Martin Langhoff martin.langh...@gmail.com wrote: On Wed, Apr 1, 2015 at 2:04 PM, Chris Murphy li...@colorremedies.com wrote: When I had this same btrfs check error, it was the exact inode number and same /etc/shadow file. I didn't diff the two shadow files, but

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Wed, Apr 1, 2015 at 2:20 PM, Chris Murphy li...@colorremedies.com wrote: That won't fix it. Once errors 400 appears, at this point you have to replace the affected file. Interesting. Right now I am booting without problems. I have no evidence of continued problems. What would I do to check

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 9:42 AM, Martin Langhoff martin.langh...@gmail.com wrote: # mount /dev/sda6 /mysysroot Apr 01 11:26:51 localhost kernel: BTRFS info (device sda6): disk space caching is enabled Apr 01 11:26:56 localhost kernel: BTRFS: checking UUID tree Apr 01 11:26:56 localhost kernel:

Re: ERROR: error removing the device '/dev/sdXN' - Inappropriate ioctl for device

2015-04-01 Thread Martin
Anand, Thanks for picking up. The devid option sounds good. Thanks, Martin On 01/04/15 14:15, Anand Jain wrote: Looks like an option to use devid to delete a device would have mitigated the issue. Also the error reported is no where near the reality. Will fix them. Thanks for

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 10:15 AM, Martin Langhoff martin.langh...@gmail.com wrote: On Wed, Apr 1, 2015 at 11:42 AM, Martin Langhoff martin.langh...@gmail.com wrote: See below. Perhaps the newer kernel (in latest F21) has regressed in handling some kinds of errors during mount, or the

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Wed, Apr 1, 2015 at 1:03 PM, Chris Murphy li...@colorremedies.com wrote: mount /dev/sda6 /mnt btrfs inspect-internal inode-resolve 39841 /mnt on the booted system... # uname -a Linux tp-martin.remote-learner.net 3.18.9-200.fc21.x86_64 #1 SMP Mon Mar 9 15:10:50 UTC 2015 x86_64 x86_64 x86_64

Re: [PATCH] fs: btrfs: Add missing include file

2015-04-01 Thread Chris Mason
On Sun, Mar 29, 2015 at 11:24 PM, Guenter Roeck li...@roeck-us.net wrote: On Fri, Mar 13, 2015 at 01:58:46AM -0700, Guenter Roeck wrote: Building alpha:allmodconfig fails with fs/btrfs/inode.c: In function 'check_direct_IO': fs/btrfs/inode.c:8050:2: error: implicit declaration of function

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 12:29 PM, Martin Langhoff martin.langh...@gmail.com wrote: On Wed, Apr 1, 2015 at 2:20 PM, Chris Murphy li...@colorremedies.com wrote: That won't fix it. Once errors 400 appears, at this point you have to replace the affected file. Interesting. Right now I am booting

Re: [PATCH] xfstests: generic: test for discard properly discarding unused extents

2015-04-01 Thread Brian Foster
On Mon, Mar 30, 2015 at 03:11:06PM -0400, Jeff Mahoney wrote: This tests tests four conditions where discard can potentially not discard unused extents completely. We test, with -o discard and with fstrim, scenarios of removing many relatively small files and removing several large files.

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Martin Langhoff
On Wed, Apr 1, 2015 at 2:54 PM, Chris Murphy li...@colorremedies.com wrote: Re-run the btrfs check. The error is still there even after a --repair. Bingo! You are right the error persists. It has no effect on my use of the system right now. Is anyone interested in debugging this further?

Re: [PATCH] xfstests: generic: test for discard properly discarding unused extents

2015-04-01 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4/1/15 2:44 PM, Brian Foster wrote: On Mon, Mar 30, 2015 at 03:11:06PM -0400, Jeff Mahoney wrote: This tests tests four conditions where discard can potentially not discard unused extents completely. We test, with -o discard and with fstrim,

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 11:26 AM, Martin Langhoff martin.langh...@gmail.com wrote: On Wed, Apr 1, 2015 at 1:03 PM, Chris Murphy li...@colorremedies.com wrote: mount /dev/sda6 /mnt btrfs inspect-internal inode-resolve 39841 /mnt on the booted system... # uname -a Linux

Re: [PATCH] xfstests: generic: test for discard properly discarding unused extents

2015-04-01 Thread Dave Chinner
On Wed, Apr 01, 2015 at 03:01:07PM -0400, Jeff Mahoney wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4/1/15 2:44 PM, Brian Foster wrote: On Mon, Mar 30, 2015 at 03:11:06PM -0400, Jeff Mahoney wrote: This tests tests four conditions where discard can potentially not discard

Re: Upgrade to 3.19.2 Kernel fails to boot

2015-04-01 Thread Rich Freeman
On Wed, Apr 1, 2015 at 2:50 AM, Anand Jain anand.j...@oracle.com wrote: Eric found something like this and has a fix with in the email. Sub: I think btrfs: fix leak of path in btrfs_find_item broke stable trees ... I don't mind trying this patch if the maintainers recommend it. I'm still

Test message...

2015-04-01 Thread Jim Mills
I am attempting to see if this message goes through. My first one got returned as I didn't know gmail defaulted to HTML. My second and third never seemed distributed. Are attachments allowed? According to this, https://btrfs.wiki.kernel.org/index.php/Btrfs_mailing_list, they are, but other

Re: [PATCH] fs: btrfs: Add missing include file

2015-04-01 Thread Guenter Roeck
On 04/01/2015 12:28 PM, Chris Mason wrote: On Sun, Mar 29, 2015 at 11:24 PM, Guenter Roeck li...@roeck-us.net wrote: On Fri, Mar 13, 2015 at 01:58:46AM -0700, Guenter Roeck wrote: Building alpha:allmodconfig fails with fs/btrfs/inode.c: In function 'check_direct_Excellent idea. Done,IO':

Re: [PATCH] fs: btrfs: Add missing include file

2015-04-01 Thread Chris Mason
On Wed, Apr 1, 2015 at 3:58 PM, Guenter Roeck li...@roeck-us.net wrote: On 04/01/2015 12:28 PM, Chris Mason wrote: On Sun, Mar 29, 2015 at 11:24 PM, Guenter Roeck li...@roeck-us.net wrote: On Fri, Mar 13, 2015 at 01:58:46AM -0700, Guenter Roeck wrote: Building alpha:allmodconfig fails with

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
Related bugs: https://bugzilla.kernel.org/show_bug.cgi?id=68411 https://bugzilla.redhat.com/show_bug.cgi?id=1037963 The RHBZ one also mentioned the shadow file. Anyway, it seems to be a somewhat known problem, but it's just not known yet what causes it. Chris Murphy -- To unsubscribe from this

Re: F21 fails to mount root part, btrfs check: Couldn't open file system

2015-04-01 Thread Chris Murphy
On Wed, Apr 1, 2015 at 1:23 PM, Martin Langhoff martin.langh...@gmail.com wrote: On Wed, Apr 1, 2015 at 2:54 PM, Chris Murphy li...@colorremedies.com wrote: Re-run the btrfs check. The error is still there even after a --repair. Bingo! You are right the error persists. It has no effect on my