Re: Can I get a checksum for a file from btrfs (without reading the whole file)?

2015-02-05 Thread Qu Wenruo
Original Message Subject: Can I get a checksum for a file from btrfs (without reading the whole file)? From: Lutz Vieweg l...@5t9.de To: linux-btrfs@vger.kernel.org Date: 2015年02月05日 18:40 Hi, use case: You have two huge files on a btrfs, you assume they contain the same

[PATCH v7 7/9] btrfs: Move btrfs_sysfs_remove_one(fs_info) before transcation thread cleanup.

2015-02-05 Thread Qu Wenruo
Since btrfs sysfs interfaces can start new transaction, we need to do it before transaction thread cleanup. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Reviewed-by: David Sterba dste...@suse.cz --- v5: Newly introduced. v6: Change comment to use the full length of a line. v7: None ---

[PATCH v7 2/9] Revert btrfs: add support for processing pending changes related commits

2015-02-05 Thread Qu Wenruo
This reverts commit 572d9ab7845 ~ a6f69dc8018. This pending commits patches introduce deadlock with freeze, and fix for it will introduce extra checks on freeze and read only case. For mount option change, later patches will introduce per-transaction mount option to keep mount options consistent

[PATCH RFC v7 1/9] vfs: Add sb_want_write() function to grant write access to sb without the struct file/vfsmount.

2015-02-05 Thread Qu Wenruo
There are sysfs interfaces in some fs, only btrfs yet, which will modify on-disk data. Unlike normal file operation routine we can use mnt_want_write_file() to protect the operation, change through sysfs won't to be binded to any file in the filesystem. So introduce new sb_want_write() to do the

[PATCH v7 8/9] btrfs: Use sb_want_write() to protect label change.

2015-02-05 Thread Qu Wenruo
Use the new vfs API sb_want_write() to do the write protection of the label change transaction. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- v4: Newly introduced. v5: Change to use sb_want_write(). v6: Move sb_want_write() at the beginning of the function. v7: None ---

[PATCH v7 5/9] btrfs: Use btrfs_test_trans_opt() to handle SPACE_CACHE if it's under transaction protect.

2015-02-05 Thread Qu Wenruo
Convert btrfs_test_opt() to btrfs_test_trans_opt() if it's called under transaction protection. This will ensure SPACE_CACHE bit is consistent during transaction. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Reviewed-by: David Sterba dste...@suse.cz --- changelog: v3: Newly introduced.

[PATCH v7 6/9] btrfs: Use btrfs_test_trans_opt() to handle INODE_CACHE if it's under transaction protect.

2015-02-05 Thread Qu Wenruo
Convert btrfs_test_opt() to btrfs_test_trans_opt() if it's called under transaction protection. This will ensure SPACE_CACHE bit is consistent during transaction. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com Reviewed-by: David Sterba dste...@suse.cz --- Changelog: v3: Newly introduced.

[PATCH v7 9/9] btrfs: Use sb_want_write() to protect sysfs feature change.

2015-02-05 Thread Qu Wenruo
Just like label change, use sb_want_write() to do a correct protection. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- v4: Newly introduced. v5: Change to sb_want_write(). v6: Move sb_want_write() to the beginning of the function. v7: None --- fs/btrfs/sysfs.c | 31

[PATCH v7 4/9] btrfs: Introduce per-transaction mount_opt to keep mount option consistent during transaction.

2015-02-05 Thread Qu Wenruo
Before this patch, mount_opt is not consistent during a transaction. btrfs_parse_options() can race with transaction. Now each transaction will keep a copy of fs_info-mount_opt upon creation, and new btrfs_test_trans_opt() macro is introduced to get the mount_opt in the transaction.

[PATCH v7 0/9] btrfs/vfs: Fix freeze/sysfs deadlock in better method

2015-02-05 Thread Qu Wenruo
Patchset to solve the previous found freeze/sysfs deadlock. Unlike previous pending_changes, which uses transaction commits to ensure mount option doesn't change during transaction. This idea is great in concept, but will introduce extra and somewhat duplicated ro/freeze check, and the original

[PATCH v7 3/9] btrfs: Make btrfs_parse_options() parse mount option in a atomic way

2015-02-05 Thread Qu Wenruo
Current btrfs_parse_options() is not atomic, which can set and clear a bit, especially for nospace_cache case. For example, if a fs is mounted with nospace_cache, btrfs_parse_options() will set SPACE_CACHE bit first(since cache_generation is non-zeo) and clear the SPACE_CACHE bit due to

Re: Deadlock on 3.18.5

2015-02-05 Thread Austin S Hemmelgarn
On 2015-02-05 06:04, Juergen Fitschen wrote: Hey, It’s me again. First of all: Thanks for the reply, Duncan :) After detecting the deadlock und posting the stack trace yesterday evening, I left the machine alone and didn’t rebooted it. The monitoring told me that the whole server (including

Re: Btrfs subvolume question

2015-02-05 Thread Chris Murphy
On Thu, Feb 5, 2015 at 1:28 PM, Markus Moeller hua...@moeller.plus.com wrote: Thank you for looking at this. I did post the fstab in the original post. Yep! No aware for my observation skills on this thread... Here it is again: Hmm, it's using UUIDs for the Btrfs volumes rather than using

Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode.

2015-02-05 Thread Qu Wenruo
Original Message Subject: Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode. From: Martin Steigerwald mar...@lichtvoll.de To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月05日 16:31 Am Donnerstag, 5. Februar 2015, 09:35:26 schrieb Qu

Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode.

2015-02-05 Thread Martin Steigerwald
Am Donnerstag, 5. Februar 2015, 09:35:26 schrieb Qu Wenruo: Original Message Subject: Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode. From: Martin Steigerwald mar...@lichtvoll.de To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月04日

BTRFS wiki: page about recovery (was: Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode.)

2015-02-05 Thread Martin Steigerwald
Am Donnerstag, 5. Februar 2015, 16:45:17 schrieb Qu Wenruo: Original Message Subject: Re: [PATCH 0/7] Allow btrfsck to reset csum of all tree blocks, AKA dangerous mode. From: Martin Steigerwald mar...@lichtvoll.de To: Qu Wenruo quwen...@cn.fujitsu.com Date: 2015年02月05日

Re: Deadlock on 3.18.5

2015-02-05 Thread Juergen Fitschen
On 05 Feb 2015, at 13:47, Austin S Hemmelgarn ahferro...@gmail.com wrote: I've actually seen similar behavior without the virtualization when doing large filesystem intensive operations with compression enabled. I don't know if this is significant, but it seems to be worse with lzo

Re: Btrfs subvolume question

2015-02-05 Thread Markus Moeller
It seems systemd creates the subvolumes. cat /run/systemd/generator/local-fs.target.requires/var-opt.mount # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab Before=local-fs.target [Mount] What=/dev/disk/by-uuid/7a681ad4-5b82-4e78-9b20-1d719c89fe6f

Re: BTRFS EFI Boot question

2015-02-05 Thread Zia Nayamuth
Unless you're putting the EFI System Partition (ESP) on the RAID10, you should be fine. Note that the ESP also needs ot be FAT32, so you can't have it as a part of your btrfs RAID10 array, so if that's what you are asking, it can't be done. An ESP located somewhere else should still be able

Re: __might_sleep() warnings on v3.19-rc6

2015-02-05 Thread Chris Mason
On Sat, Jan 31, 2015 at 07:43:15PM -0800, Fengguang Wu wrote: Hi all, I see 2 __might_sleep() warnings on when running LKP tests on v3.19-rc6, one related to raid5 and another related to btrfs. They might be exposed by this patch. FSUse%Count SizeFiles/sec App

Re: Deadlock on 3.18.5

2015-02-05 Thread Austin S Hemmelgarn
On 2015-02-05 10:24, Juergen Fitschen wrote: On 05 Feb 2015, at 13:47, Austin S Hemmelgarn ahferro...@gmail.com wrote: I've actually seen similar behavior without the virtualization when doing large filesystem intensive operations with compression enabled. I don't know if this is

Re: [PATCH][RFC] dm: log writes target

2015-02-05 Thread Josef Bacik
On 02/04/2015 01:41 PM, Mike Snitzer wrote: On Mon, Dec 08 2014 at 5:32P -0500, Josef Bacik jba...@fb.com wrote: This is my latest attempt at a target for testing power fail and fs consistency. This is based on the idea Zach Brown had where we could just walk through all the operations done

Re: BTRFS EFI Boot question

2015-02-05 Thread Kai Krakow
Lucas Smith vedal...@lksmith.net schrieb: Hey folks! Having a confusing question brought up to me by my Debian Testing installer and am unsure what the implications are for it. I want to run btrfs in RAID10 on 4x1TB WD RE3 drives. Apparently, my system is set up to boot using EFI. Are

Re: [PATCH] Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group

2015-02-05 Thread Filipe David Manana
On Wed, Feb 4, 2015 at 12:28 PM, Forrest Liu forre...@synology.com wrote: Kernel BUG_ON when running following script on kernel 3.19-rc7 mntpath=/btrfs loopdev=/dev/loop0 filepath=/volume2/100g_image umount $mntpath losetup -d $loopdev truncate --size 1000g $filepath losetup $loopdev

Can I get a checksum for a file from btrfs (without reading the whole file)?

2015-02-05 Thread Lutz Vieweg
Hi, use case: You have two huge files on a btrfs, you assume they contain the same bytes, but you do not know for sure. Is there a way to get a checksum of both files from btrfs with less effort than reading the whole of both files and computing a hash sum? (I was thinking that the

Re: Deadlock on 3.18.5

2015-02-05 Thread Juergen Fitschen
Hey, It’s me again. First of all: Thanks for the reply, Duncan :) After detecting the deadlock und posting the stack trace yesterday evening, I left the machine alone and didn’t rebooted it. The monitoring told me that the whole server (including the hypervisor) became unreachable a few

Re: Btrfs subvolume question

2015-02-05 Thread Chris Murphy
On Thu, Feb 5, 2015 at 3:49 PM, Markus Moeller hua...@moeller.plus.com wrote: It seems systemd creates the subvolumes. cat /run/systemd/generator/local-fs.target.requires/var-opt.mount # Automatically generated by systemd-fstab-generator Nope, the job of systemd-fstab-generator is to read

Re: Btrfs subvolume question

2015-02-05 Thread Markus Moeller
Thank you for looking at this. I did post the fstab in the original post. Here it is again: # cat /etc/fstab UUID=d300b5ad-372b-4f86-b952-4aa4fc62a84e swap swap defaults 0 0 UUID=7a681ad4-5b82-4e78-9b20-1d719c89fe6f / btrfs defaults 0 0 UUID=fd14684f-1950-4f33-95b5-b54f069b4fe0 /boot ext4

[PATCH] btrfs-progs: allow CFLAGS specification in new build

2015-02-05 Thread Eric Sandeen
Disclaimer: I am not an auto$FOO expert by any means. But I could find no way to specify additional CFLAGS, and I think that this is because they are hard-coded in configure.ac. The below works for me, but I don't know if it's the right solution... Signed-off-by: Eric Sandeen sand...@redhat.com