Removing bad hdd from btrfs volume

2015-08-06 Thread Peter Foley
Hi, I have an btrfs volume that spans multiple disks (no raid, just single), and earlier this morning I hit some hardware problems with one of the disks. I tried btrfs dev del /dev/sda1 /, but btrfs was unable to migrate the 1gb that appears to be causing the read errors. See

[PATCH 04/11] Btrfs: fallocate: Work with sectorsized blocks

2015-08-06 Thread Chandan Rajendra
While at it, this commit changes btrfs_truncate_page() to truncate sectorsized blocks instead of pages. Hence the function has been renamed to btrfs_truncate_block(). Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 47

[PATCH 08/11] Btrfs: btrfs_submit_direct_hook: Handle map_length bio vector length

2015-08-06 Thread Chandan Rajendra
In subpagesize-blocksize scenario, map_length can be less than the length of a bio vector. Such a condition may cause btrfs_submit_direct_hook() to submit a zero length bio. Fix this by comparing map_length against block size rather than with bv_len. Signed-off-by: Chandan Rajendra

FW: btrfs-progs: android build

2015-08-06 Thread 강상우
Hi, I made btrfs-progs android build script and test it.\ And need some help on btrfs_wipe_existing_sb().\ On the test it looks work well.\ But I’m not sure it’s ok. 0001-btrfs-progs-Add-Android-build-mk-file.patch Description: Binary data

[PATCH 09/11] Btrfs: Limit inline extents to root-sectorsize

2015-08-06 Thread Chandan Rajendra
cow_file_range_inline() limits the size of an inline extent to PAGE_CACHE_SIZE. This breaks in subpagesize-blocksize scenarios. Fix this by comparing against root-sectorsize. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 02/11] Btrfs: Compute and look up csums based on sectorsized blocks

2015-08-06 Thread Chandan Rajendra
Checksums are applicable to sectorsize units. The current code uses bio-bv_len units to compute and look up checksums. This works on machines where sectorsize == PAGE_SIZE. This patch makes the checksum computation and look up code to work with sectorsize units. Reviewed-by: Liu Bo

[PATCH 03/11] Btrfs: Direct I/O read: Work on sectorsized blocks

2015-08-06 Thread Chandan Rajendra
The direct I/O read's endio and corresponding repair functions work on page sized blocks. This commit adds the ability for direct I/O read to work on subpagesized blocks. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/inode.c | 96

[PATCH 05/11] Btrfs: btrfs_page_mkwrite: Reserve space in sectorsized units

2015-08-06 Thread Chandan Rajendra
In subpagesize-blocksize scenario, if i_size occurs in a block which is not the last block in the page, then the space to be reserved should be calculated appropriately. Reviewed-by: Liu Bo bo.li@oracle.com Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/inode.c | 36

[PATCH 11/11] Btrfs: Clean pte corresponding to page straddling i_size

2015-08-06 Thread Chandan Rajendra
When extending a file by either truncate up or by writing beyond i_size, the page which had i_size needs to be marked read only so that future writes to the page via mmap interface causes btrfs_page_mkwrite() to be invoked. If not, a write performed after extending the file via the mmap interface

[PATCH 10/11] Btrfs: Fix block size returned to user space

2015-08-06 Thread Chandan Rajendra
btrfs_getattr() returns PAGE_CACHE_SIZE as the block size. Since generic_fillattr() already does the right thing (by obtaining block size from inode-i_blkbits), just remove the statement from btrfs_getattr. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/inode.c | 1 - 1

[PATCH 00/11] Btrfs: Pre subpagesize-blocksize cleanups

2015-08-06 Thread Chandan Rajendra
Hello all, The patches posted along with this cover letter are cleanups made during the developement of subpagesize-blocksize patchset. I believe that they can be integrated with the mainline kernel. Hence I have posted them separately from the subpagesize-blocksize patchset. I have testsed the

[PATCH 06/11] Btrfs: Search for all ordered extents that could span across a page

2015-08-06 Thread Chandan Rajendra
In subpagesize-blocksize scenario it is not sufficient to search using the first byte of the page to make sure that there are no ordered extents present across the page. Fix this. Signed-off-by: Chandan Rajendra chan...@linux.vnet.ibm.com --- fs/btrfs/extent_io.c | 3 ++- fs/btrfs/inode.c |

[PATCH] Btrfs: fix stale dir entries after removing a link and fsync

2015-08-06 Thread fdmanana
From: Filipe Manana fdman...@suse.com We have one more case where after a log tree is replayed we get inconsistent metadata leading to stale directory entries, due to some directories having entries pointing to some inode while the inode does not have a matching BTRFS_INODE_[REF|EXTREF]_KEY item.

[PATCH] fstests: generic test for fsync of file with multiple links

2015-08-06 Thread fdmanana
From: Filipe Manana fdman...@suse.com Test that when we have a file with multiple hard links belonging to different parent directories, if we remove one of those links, fsync the file using one of its other links (that has a parent directory different from the one we removed a link from), power

Re: Data single *and* raid?

2015-08-06 Thread Hendrik Friedel
Hello Quo, thanks for your reply. But then: root@homeserver:/mnt/__Complete_Disk# btrfs fi df /mnt/__Complete_Disk/ Data, RAID5: total=3.83TiB, used=3.78TiB System, RAID5: total=32.00MiB, used=576.00KiB Metadata, RAID5: total=6.46GiB, used=4.84GiB GlobalReserve, single: total=512.00MiB,

Re: Lockup in BTRFS_IOC_CLONE/Kernel 4.2.0-rc5

2015-08-06 Thread Liu Bo
Hi, On Wed, Aug 05, 2015 at 10:28:05AM +0200, Elias Probst wrote: I can reproduce a hard btrfs lockup (process issuing the ioctl() is in D-state, same goes for btrfs-transacti process) on Kernel 4.2.0-rc5. I had the same issue on 4.1, so it's unlikely a regression introduced in 4.2. ##

Re: [PATCH 01/11] Btrfs: __btrfs_buffered_write: Reserve/release extents aligned to block size

2015-08-06 Thread Qu Wenruo
Hi Chanda, Thanks for your effort to implement sub pagesize block size. These cleanups look quite good, but still some small readablity recommendation inlined below. Chandan Rajendra wrote on 2015/08/06 15:40 +0530: Currently, the code reserves/releases extents in multiples of

Re: [PATCH 01/11] Btrfs: __btrfs_buffered_write: Reserve/release extents aligned to block size

2015-08-06 Thread Chandan Rajendra
On Friday 07 Aug 2015 11:08:30 Qu Wenruo wrote: Hi Chanda, Thanks for your effort to implement sub pagesize block size. These cleanups look quite good, but still some small readablity recommendation inlined below. Chandan Rajendra wrote on 2015/08/06 15:40 +0530: Currently, the code

RE: [PATCH V2] btrfs-progs: add newline to some error messages

2015-08-06 Thread Zhao Lei
Reviewed-by: Zhao Lei zhao...@cn.fujitsu.com Thanks Zhaolei -Original Message- From: Tsutomu Itoh [mailto:t-i...@jp.fujitsu.com] Sent: Friday, August 07, 2015 8:20 AM To: linux-btrfs@vger.kernel.org Cc: Zhao Lei Subject: [PATCH V2] btrfs-progs: add newline to some error messages

Re: Removing bad hdd from btrfs volume

2015-08-06 Thread Duncan
Peter Foley posted on Thu, 06 Aug 2015 15:17:04 -0700 as excerpted: I have an btrfs volume that spans multiple disks (no raid, just single), and earlier this morning I hit some hardware problems with one of the disks. I tried btrfs dev del /dev/sda1 /, but btrfs was unable to migrate the 1gb

[PATCH V2] btrfs-progs: add newline to some error messages

2015-08-06 Thread Tsutomu Itoh
Added a missing newline to some error messages. Also printf() was changed to fprintf(stderr) for error message. Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com --- btrfs-corrupt-block.c | 2 +- cmds-check.c | 4 ++-- cmds-send.c | 4 ++-- dir-item.c| 6 +++---

Re: Data single *and* raid?

2015-08-06 Thread Qu Wenruo
Hendrik Friedel wrote on 2015/08/06 20:57 +0200: Hello Hugo, hello Chris, thanks for your advice. Now I am here: btrfs balance start -dprofiles=single -mprofiles=raid1 /mnt/__Complete_Disk/ Done, had to relocate 0 out of 3939 chunks root@homeserver:/mnt/__Complete_Disk# btrfs fi show Label:

Re: [PATCH] btrfs-progs: add newline to some error messages

2015-08-06 Thread Tsutomu Itoh
On 2015/08/06 15:07, Zhao Lei wrote: Hi, Itho-san -Original Message- From: Tsutomu Itoh [mailto:t-i...@jp.fujitsu.com] Sent: Thursday, August 06, 2015 12:01 PM To: Zhao Lei; linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs-progs: add newline to some error messages On 2015/08/06

[PATCH] btrfs: Remove unnecessary variants in relocation.c

2015-08-06 Thread Zhao Lei
These arguments are not used in functions, remove them for cleanup and make kernel stack happy. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/ctree.h | 3 +-- fs/btrfs/relocation.c | 13 + fs/btrfs/transaction.c | 2 +- 3 files changed, 7 insertions(+), 11

Re: bedup --defrag freezing

2015-08-06 Thread Austin S Hemmelgarn
On 2015-08-05 17:45, Konstantin Svist wrote: Hi, I've been running btrfs on Fedora for a while now, with bedup --defrag running in a night-time cronjob. Last few runs seem to have gotten stuck, without possibility of even killing the process (kill -9 doesn't work) -- all I could do is hard

Re: [PATCH] fstests: generic test for fsync of file with multiple links

2015-08-06 Thread Eryu Guan
On Thu, Aug 06, 2015 at 05:11:30AM +0100, fdman...@kernel.org wrote: From: Filipe Manana fdman...@suse.com Test that when we have a file with multiple hard links belonging to different parent directories, if we remove one of those links, fsync the file using one of its other links (that has

Re: [PATCH] fstests: generic test for fsync of file with multiple links

2015-08-06 Thread Filipe Manana
On Thu, Aug 6, 2015 at 12:46 PM, Eryu Guan eg...@redhat.com wrote: On Thu, Aug 06, 2015 at 05:11:30AM +0100, fdman...@kernel.org wrote: From: Filipe Manana fdman...@suse.com Test that when we have a file with multiple hard links belonging to different parent directories, if we remove one of

Re: BTRFS disaster (of my own making). Is this recoverable?

2015-08-06 Thread Austin S Hemmelgarn
On 2015-08-05 22:13, Chris Murphy wrote: On Wed, Aug 5, 2015 at 6:45 PM, Paul Jones p...@pauljones.id.au wrote: Would it be possible to store this type of critical information twice on each disk, at the beginning and end? I thought BTRFS already did that, but I might be thinking of some other

Re: Why subvolume and not just volume?

2015-08-06 Thread Austin S Hemmelgarn
On 2015-08-06 03:23, Duncan wrote: Martin posted on Wed, 05 Aug 2015 09:06:40 +0200 as excerpted: [W]hat is the penalty of a subvolume compared to a directory? From a design perspective, couldn't all directories just be subvolumes? In addition to the performance issues mentioned by others,

Re: [PATCH 0/6] sysfs-part2 Add seed device representation on the sysfs

2015-08-06 Thread David Sterba
On Thu, Aug 06, 2015 at 05:51:16AM +0800, Anand Jain wrote: ... these can go in. Btrfs: sysfs: support seed devices in the sysfs layout Sorry for late reply, the patches look good. I'm going to prepare a branch for pull into 4.3. Thanks. I suggested if this can wait. on the 2nd

Re: Data single *and* raid?

2015-08-06 Thread Hendrik Friedel
Hello Hugo, hello Chris, thanks for your advice. Now I am here: btrfs balance start -dprofiles=single -mprofiles=raid1 /mnt/__Complete_Disk/ Done, had to relocate 0 out of 3939 chunks root@homeserver:/mnt/__Complete_Disk# btrfs fi show Label: none uuid: a8af3832-48c7-4568-861f-e80380dd7e0b

[PATCH 1/2] btrfs: Fix wrong comment of btrfs_alloc_tree_block()

2015-08-06 Thread Zhao Lei
These wrong comment was copyed from another function(expired) from init, this patch fixed them. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a436bd5..792247f

[PATCH] btrfs: abort transaction on btrfs_reloc_cow_block()

2015-08-06 Thread Zhao Lei
When btrfs_reloc_cow_block() failed in __btrfs_cow_block(), current code just return a err-value to caller, but leave new_created extent buffer exist and locked. Then subsequent code (in relocate) try to lock above eb again, and caused deadlock without any dmesg. (eb lock use wait_event(), so no

[PATCH 2/2] btrfs: Remove root argument in extent_data_ref_count()

2015-08-06 Thread Zhao Lei
Because it is never used. Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com --- fs/btrfs/extent-tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 792247f..5f7cbd7 100644 --- a/fs/btrfs/extent-tree.c +++

Re: Why subvolume and not just volume?

2015-08-06 Thread Duncan
Martin posted on Wed, 05 Aug 2015 09:06:40 +0200 as excerpted: [W]hat is the penalty of a subvolume compared to a directory? From a design perspective, couldn't all directories just be subvolumes? In addition to the performance issues mentioned by others, there's at least one further

Re: [RFC 0/8] Allow GFP_NOFS allocation to fail

2015-08-06 Thread Michal Hocko
On Wed 05-08-15 20:58:25, Andreas Dilger wrote: On Aug 5, 2015, at 3:51 AM, mho...@kernel.org wrote: [...] The rest are the FS specific patches to fortify allocations requests which are really needed to finish transactions without RO remounts. There might be more needed but my test case

Re: [PATCH] btrfs: qgroup: Fix a regression in qgroup reserved space.

2015-08-06 Thread Chris Mason
On Thu, Aug 06, 2015 at 04:42:41PM +0800, Qu Wenruo wrote: Hi Chris, Would you please consider including this patch into v4.2 if it is still possible? Although the fix is still not perfect and just a hotfix, as qgroup reserve parts still have a lot of problems from design and a lot of

Re: FW: btrfs-progs: android build

2015-08-06 Thread David Sterba
Hi, On Thu, Aug 06, 2015 at 06:45:11PM +0900, �� wrote: Hi, I made btrfs-progs android build script and test it.\ Thanks. The changes as they stand are too intrusive to be added but give me an idea what's needed. The makefile part shares some variables with current make and adds some

[PATCH] btrfs: Add WARN_ON() for double lock in btrfs_tree_lock()

2015-08-06 Thread Zhao Lei
When a task trying to double lock a extent buffer, there are no lockdep warning about it because this lock may be in blocking_lock state, and make us hard to debug. This patch add a WARN_ON() for above condition, it can not report all deadlock cases(as lock between tasks), but at least helps us