sendfile(2) not killable on btrfs

2016-01-06 Thread Akihiro Suda
Hi, I have an issue on btrfs, and opened a bugzilla ticket: https://bugzilla.kernel.org/show_bug.cgi?id=110391 = Commit 296291cd should have made sendfile(2) killable. https://github.com/torvalds/linux/commit/296291cd > Currently a simple program below issues a sendfile(2) system call which

Re: Add big device, remove small device, read-only

2016-01-06 Thread Rasmus Abrahamsen
On Wed, Jan 6, 2016, at 07:45 AM, Duncan wrote: > Rasmus Abrahamsen posted on Fri, 01 Jan 2016 21:20:13 +0100 as excerpted: > > > I accidentically sent my messages directly to Duncan, I am copying them > > in here. > > > > Hello Duncan, > > > > Thank you for the amazing response. Wow, you are

[PATCH v3] Btrfs: Check metadata redundancy on balance

2016-01-06 Thread sam tygier
From: Sam Tygier Date: Wed, 6 Jan 2016 08:46:12 + Subject: [PATCH] Btrfs: Check metadata redundancy on balance When converting a filesystem via balance check that metadata mode is at least as redundant as the data mode. For example give warning when: -dconvert=raid1

[PATCH 1/3] btrfs: Continue write in case of can_not_nocow

2016-01-06 Thread Zhao Lei
btrfs failed in xfstests btrfs/080 with -o nodatacow. Can be reproduced by following script: DEV=/dev/vdg MNT=/mnt/tmp umount $DEV &>/dev/null mkfs.btrfs -f $DEV mount -o nodatacow $DEV $MNT dd if=/dev/zero of=$MNT/test bs=1 count=2048 & btrfs subvolume snapshot -r $MNT

[PATCH 2/3] btrfs: delete no_used argument in btrfs_copy_from_user

2016-01-06 Thread Zhao Lei
size_t write_bytes is not necessary for btrfs_copy_from_user(), delete it. Signed-off-by: Zhao Lei --- fs/btrfs/file.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 11fd981..e4f287c 100644 ---

[PATCH 3/3] btrfs: merge functions for wait snapshot creation

2016-01-06 Thread Zhao Lei
wait_for_snapshot_creation() is in same group with oher two: btrfs_start_write_no_snapshoting() btrfs_end_write_no_snapshoting() Rename wait_for_snapshot_creation() and move it into same place with other two. Signed-off-by: Zhao Lei --- fs/btrfs/ctree.h | 1 +

Re: [PATCH] Btrfs: Intialize btrfs_root->highest_objectid when loading tree root and subvolume roots

2016-01-06 Thread Chandan Rajendra
On Tuesday 05 Jan 2016 13:12:34 David Sterba wrote: > Sorry for not answering that. As you're going to resend it, please > use EOVERFLOW in the btrfs_init_fs_root. We should not hit the overflow > error in the mount path. Right. Now I understand that. David, Replacing the following code snippet

Re: cannot repair filesystem

2016-01-06 Thread Patrik Lundquist
On 1 January 2016 at 16:44, Jan Koester wrote: > > Hi, > > if I try to repair filesystem got I'am assert. I use Raid6. > > Linux dibsi 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt4-3~bpo70+1 > (2015-02-12) x86_64 GNU/Linux Raid6 wasn't completed until Linux 3.19 and I

Re: Purposely using btrfs RAID1 in degraded mode ?

2016-01-06 Thread Alphazo
Thanks Chris for the warning. I agree that mounting both drives separately in degraded r/w will lead to very funky results when trying to scrub them when put together. On Mon, Jan 4, 2016 at 6:41 PM, Chris Murphy wrote: > On Mon, Jan 4, 2016 at 10:00 AM, Alphazo

Re: sendfile(2) not killable on btrfs

2016-01-06 Thread Chris Samuel
On Wed, 6 Jan 2016 06:08:46 PM Akihiro Suda wrote: > However, it is still not killable on btrfs. Your bugzilla entry is for the 4.2 kernel in the current Ubuntu, but this patch was only merged into the mainline for at v4.3-rc6-123-g296291c so unless it was backported by Canonical it won't be

Re: [dm-devel] [PATCH 01/35] block/fs/drivers: remove rw argument from submit_bio

2016-01-06 Thread Bart Van Assche
On 01/05/2016 09:53 PM, mchri...@redhat.com wrote: From: Mike Christie This has callers of submit_bio/submit_bio_wait set the bio->bi_rw instead of passing it in. This makes that use the same as generic_make_request and how we set the other bio fields. Reviewed-by: Bart

Re: raid1 vs raid5

2016-01-06 Thread Sean Greenslade
On Tue, Jan 05, 2016 at 05:24:31PM +0100, Psalle wrote: > Hello all and excuse me if this is a silly question. I looked around in the > wiki and list archives but couldn't find any in-depth discussion about this: > > I just realized that, since raid1 in btrfs is special (meaning only two > copies

[PATCH V2] Btrfs: fix output of compression message in btrfs_parse_options()

2016-01-06 Thread Tsutomu Itoh
The compression message might not be correctly output. Fix it. [[before fix]] # mount -o compress /dev/sdb3 /test3 [ 996.874264] BTRFS info (device sdb3): disk space caching is enabled [ 996.874268] BTRFS: has skinny extents # mount | grep /test3 /dev/sdb3 on /test3 type btrfs

Re: Confining scrub to a subvolume

2016-01-06 Thread Duncan
Sree Harsha Totakura posted on Mon, 04 Jan 2016 12:01:58 +0100 as excerpted: > On 12/30/2015 07:26 PM, Duncan wrote: >> David Sterba posted on Wed, 30 Dec 2015 18:39:49 +0100 as excerpted: >> >>> On Wed, Dec 30, 2015 at 01:00:34AM +0100, Sree Harsha Totakura wrote: Is it possible to confine

Re: [PATCH 02/35] block: add REQ_OP definitions and bi_op/op fields

2016-01-06 Thread Martin K. Petersen
> "Mike" == mchristi writes: +enum req_op { + REQ_OP_READ, + REQ_OP_WRITE= REQ_WRITE, + REQ_OP_DISCARD = REQ_DISCARD, + REQ_OP_WRITE_SAME = REQ_WRITE_SAME, +}; + I have been irked by the REQ_ prefix in bios since the

Re: Broken RAID6, segfault on chunk-recover

2016-01-06 Thread Abe
Here is the backtrace. Any chance using chunk-recover will help repair this filesystem? Thanks btrfs-progs# git rev-parse HEAD 7c3394ed9ef2063a7256d4bc078a485b6f826bc5 btrfs-progs# gdb --args ./btrfs rescue chunk-recover -v /dev/sdf1 (gdb) r Starting program: /root/btrfs-progs/btrfs rescue

[PATCH v2] Btrfs: fix regression that makes fitrim ioctl discard a device's MBR

2016-01-06 Thread fdmanana
From: Filipe Manana As of the 4.3 kernel release, the fitrim ioctl can now discard any region of a disk that is not part of a chunk/block group, including the MBR (master boot record). Fix this by not allowing to trim/discard any region in the device starting with an offset

[PATCH] Btrfs: fix regression that makes fitrim ioctl discard a device's MBR

2016-01-06 Thread fdmanana
From: Filipe Manana As of the 4.3 kernel release, the fitrim ioctl can now discard any region of a disk that is not part of a chunk/block group, including the MBR (master boot record). Fix this by not allowing to trim/discard any region in the device starting with an offset

Re: sendfile(2) not killable on btrfs

2016-01-06 Thread Akihiro Suda
>> However, it is still not killable on btrfs. > >Your bugzilla entry is for the 4.2 kernel in the current Ubuntu, but this >patch was only merged into the mainline for at v4.3-rc6-123-g296291c so unless >it was backported by Canonical it won't be present. > >Could you test with the 4.3 kernel

[PATCH v3 01/16] btrfs: dedup: Introduce dedup framework and its header

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Introduce the header for btrfs online(write time) de-duplication framework and needed header. The new de-duplication framework is going to support 2 different dedup method and 1 dedup hash. Signed-off-by: Qu Wenruo

[PATCH v3 02/16] btrfs: dedup: Introduce function to initialize dedup info

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Add generic function to initialize dedup info. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang --- fs/btrfs/Makefile | 2 +- fs/btrfs/dedup.c | 96

[PATCH v3 00/14][For 4.6] Btrfs: Add inband (write time) de-duplication framework

2016-01-06 Thread Qu Wenruo
This updated version of inband de-duplication has the following features: 1) ONE unified dedup framework. Most of its code is hidden quietly in dedup.c and export the minimal interfaces for its caller. Reviewer and further developer would benefit from the unified framework. 2) TWO

[PATCH v3 08/16] btrfs: dedup: Implement btrfs_dedup_calc_hash interface

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Unlike in-memory or on-disk dedup method, only SHA256 hash method is supported yet, so implement btrfs_dedup_calc_hash() interface using SHA256. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang

[PATCH v3 15/16] btrfs: dedup: Add support for adding hash for on-disk backend

2016-01-06 Thread Qu Wenruo
Now on-disk backend can add hash now. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- v3: Fix a bug in writing extent buffer with wrong offset. Add handler for same bytenr different hashes case. --- fs/btrfs/dedup.c | 84

[PATCH v3 05/16] btrfs: delayed-ref: Add support for atomic increasing extent ref

2016-01-06 Thread Qu Wenruo
Slightly modify btrfs_add_delayed_data_ref() to allow it accept GFP_ATOMIC, and allow it to do be called inside a spinlock. This is used by later dedup patches. Signed-off-by: Qu Wenruo --- v3: Newly introduced --- fs/btrfs/ctree.h | 4

[PATCH v3 09/16] btrfs: ordered-extent: Add support for dedup

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Add ordered-extent support for dedup. Note, current ordered-extent support only supports non-compressed source extent. Support for compressed source extent will be added later. Signed-off-by: Qu Wenruo Signed-off-by:

[PATCH v3 07/16] btrfs: dedup: Introduce function to search for an existing hash

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_search() to handle the job for in-memory hash tree. The trick is, we must ensure the delayed ref head is not being run at the time we search the for the hash. With inmem_search(), we can implement the

[PATCH v3 11/16] btrfs: dedup: Add basic tree structure for on-disk dedup method

2016-01-06 Thread Qu Wenruo
Introduce a new tree, dedup tree to record on-disk dedup hash. As a persist hash storage instead of in-memeory only implement. Unlike Liu Bo's implement, in this version we won't do hack for bytenr -> hash search, but add a new type, DEDUP_BYTENR_ITEM for such search case, just like in-memory

[PATCH v3 16/16] btrfs: dedup: Add ioctl for inband deduplication

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Add ioctl interface for inband deduplication, which includes: 1) enable 2) disable 3) status We will later add ioctl to disable inband dedup for given file/dir. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang

Re: [PATCH 00/35 v2] separate operations from flags in the bio/request structs

2016-01-06 Thread Martin K. Petersen
> "Mike" == mchristi writes: Mike> The following patches begin to cleanup the request->cmd_flags and bio-> bi_rw mess. We currently use cmd_flags to specify the operation, Mike> attributes and state of the request. For bi_rw we use it for Mike> similar info and also the

Recovery of a raid1 FS

2016-01-06 Thread Tom Hunt
I've got a two-disk RAID1 btrfs volume, which crashed for no apparent reason and was corrupt on next boot. Relevant command runs and outputs: [root@archiso ~]# mount -osubvol=.,ro,recovery /dev/mapper/rootvol_1 mnt mount: wrong fs type, bad option, bad superblock on /dev/mapper/rootvol_1,

[PATCH v2 5/7] btrfs-progs: Add dedup feature for mkfs and convert

2016-01-06 Thread Qu Wenruo
Add new DEDUP ro compat flag and corresponding mkfs/convert flag 'dedup'. Since dedup tree is completely isolated from fs tree, so even old kernel could do read mount. So add it to RO compat flag instead of common incompat flags Signed-off-by: Qu Wenruo ---

[PATCH v2 2/7] btrfs-progs: dedup: Add enable command for dedup command group

2016-01-06 Thread Qu Wenruo
Add enable subcommand for dedup commmand group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 62 ++- cmds-dedup.c | 120 + ioctl.h| 2 +

[PATCH v2 7/7] btrfs-progs: dedup-tree: Add dedup tree support

2016-01-06 Thread Qu Wenruo
Add dedup tree support for btrfs-debug-tree. Signed-off-by: Qu Wenruo --- v2: Add support to print hex objectid/offset for dedup hash. Add support to print hex hash. --- btrfs-debug-tree.c | 4 +++ ctree.h| 7 + print-tree.c | 75

[PATCH v2 1/7] btrfs-progs: Basic framework for dedup command group

2016-01-06 Thread Qu Wenruo
Add basic ioctl header and command group framework for later use. Alone with basic man page doc. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 37 + Makefile.in| 2 +- btrfs.c

[PATCH v2 3/7] btrfs-progs: dedup: Add disable support for inban deduplication

2016-01-06 Thread Qu Wenruo
Add disable subcommand for dedup command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 5 + cmds-dedup.c | 42 ++ 2 files changed, 47 insertions(+) diff --git

[PATCH v2 4/7] btrfs-progs: dedup: Add status subcommand

2016-01-06 Thread Qu Wenruo
Add status subcommand for dedup command group. Signed-off-by: Qu Wenruo --- Documentation/btrfs-dedup.asciidoc | 3 ++ cmds-dedup.c | 72 ++ 2 files changed, 75 insertions(+) diff --git

[PATCH v2 0/7] btrfs-progs: Support for in-band de-duplication

2016-01-06 Thread Qu Wenruo
Preparation patchset for in-coming (aimed for 4.6) kernel in-band de-duplication patchset. New kernel dedup will has 2 different dedup backends and a ioctl interface to enable/disable dedup. The ioctl interface and on-disk format (mostly) is determined, so submit this patchset first before

[PATCH v2 6/7] btrfs: dedup: Add show-super support for new DEDUP flag

2016-01-06 Thread Qu Wenruo
Now btrfs-show-super can handle DEDUP ro compat flag. Signed-off-by: Qu Wenruo --- btrfs-show-super.c | 17 + 1 file changed, 17 insertions(+) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index d8ad69e..7c0dfa9 100644 --- a/btrfs-show-super.c

[PATCH v3 04/16] btrfs: dedup: Introduce function to remove hash from in-memory tree

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_del() to remove hash from in-memory dedup tree. And implement btrfs_dedup_del() and btrfs_dedup_destroy() interfaces. Signed-off-by: Qu Wenruo Signed-off-by: Wang Xiaoguang

[PATCH v3 03/16] btrfs: dedup: Introduce function to add hash into in-memory tree

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Introduce static function inmem_add() to add hash into in-memory tree. And now we can implement the btrfs_dedup_add() interface. Sgined-o Signed-off-by: Wang Xiaoguang --- v3: Use specific struct inmem_hash for

Re: [PATCH 00/35 v2] separate operations from flags in the bio/request structs

2016-01-06 Thread Dave Chinner
On Wed, Jan 06, 2016 at 08:40:09PM -0500, Martin K. Petersen wrote: > > "Mike" == mchristi writes: > > Mike> The following patches begin to cleanup the request->cmd_flags and > bio-> bi_rw mess. We currently use cmd_flags to specify the operation, > Mike> attributes and

[PATCH v3 12/16] btrfs: dedup: Introduce interfaces to resume and cleanup dedup info

2016-01-06 Thread Qu Wenruo
Since we will introduce a new on-disk based dedup method, introduce new interfaces to resume previous dedup setup. And since we introduce a new tree for status, also add disable handler for it. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo

[PATCH v3 10/16] btrfs: dedup: Inband in-memory only de-duplication implement

2016-01-06 Thread Qu Wenruo
From: Wang Xiaoguang Core implement for inband de-duplication. It reuse the async_cow_start() facility to calculate dedup hash. And use dedup hash to do inband de-duplication at extent level. The work flow is as below: 1) Run delalloc range for an inode 2) Calculate

[PATCH v3 06/16] btrfs: delayed_ref: Add support for handle dedup hash

2016-01-06 Thread Qu Wenruo
Add support for delayed_ref to handle dedup_hash. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- v3: Newly introduced. --- fs/btrfs/ctree.h | 4 +++- fs/btrfs/delayed-ref.c | 3 ++- fs/btrfs/delayed-ref.h | 9 -

[PATCH v3 13/16] btrfs: dedup: Add support for on-disk hash search

2016-01-06 Thread Qu Wenruo
Now on-disk backend should be able to search hash now. Signed-off-by: Wang Xiaoguang Signed-off-by: Qu Wenruo --- v2: Newly introduced v3: None --- fs/btrfs/dedup.c | 169 ++-

Re: [PATCH 13/35] xfs: set bi_op to REQ_OP

2016-01-06 Thread Dave Chinner
On Tue, Jan 05, 2016 at 02:53:16PM -0600, mchri...@redhat.com wrote: > From: Mike Christie > > This patch has xfs set the bio bi_op to a REQ_OP, and > rq_flag_bits to bi_rw. > > Note: > I have run xfs tests on these btrfs patches. There were some failures > with and without

Re: [PATCH 25/35] target: set bi_op to REQ_OP

2016-01-06 Thread Nicholas A. Bellinger
Hi Mike, On Tue, 2016-01-05 at 14:53 -0600, mchri...@redhat.com wrote: > From: Mike Christie > > This patch has the target modules set the bio bi_op to a REQ_OP, and > rq_flag_bits to bi_rw. > > This patch is compile tested only. > > Signed-off-by: Mike Christie

Re: floating point exception (core dumped) - btrfs rescue chunk-recover

2016-01-06 Thread Henk Slager
On Wed, Jan 6, 2016 at 5:37 AM, P R Shah wrote: > Hello, > > TL;DR == > > btrfs 3x500GB RAID 5 - One device failed. Added a new device (btrfs device > add) and tried to remove the failed device (btrfs device delete). Pity that you used add and delete, especially with already

[PATCH] Btrfs-progs: fix typo in parse_range

2016-01-06 Thread Liu Bo
s/*end/*start. This makes 'btrfs balance start -dvrange=xxx..yyy' really work. Signed-off-by: Liu Bo --- cmds-balance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-balance.c b/cmds-balance.c index c5be6b9..9f647cd 100644 --- a/cmds-balance.c