Re: raid1 on uneven-sized disks

2015-08-09 Thread Duncan
Jim MacBaine posted on Sun, 09 Aug 2015 14:29:53 +0200 as excerpted: > Traditionally I'm using rsync to create hardlinked backups on ext3/4 on > md-raid1. This setup has been working reliably for many years now, > including the survival of two disk failures. But it is quite cumbersome > to reshape

Re: raid1 on uneven-sized disks

2015-08-09 Thread Duncan
Rich Freeman posted on Sun, 09 Aug 2015 22:25:35 -0400 as excerpted: > The key is that btrfs manages "raid" at the chunk level, not the > device level. When btrfs needs more disk space it allocates a new > chunk from unallocated space on a device. If it is in raid1 mode it > will allocate a pair

Re: raid1 on uneven-sized disks

2015-08-09 Thread Rich Freeman
On Sun, Aug 9, 2015 at 8:47 AM, Hugo Mills wrote: > On Sun, Aug 09, 2015 at 02:29:53PM +0200, Jim MacBaine wrote: >> Hi, >> >> How does btrfs handle raid1 on a bunch of uneven sized disks? Can I >> just keep adding arbitrarily sized disks to an existing raid1 and >> expect the file system to conti

[btrfs:integration-4.3 34/35] fs/btrfs/extent_io.c:2734:10: error: 'struct bio' has no member named 'bi_css'

2015-08-09 Thread kbuild test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git integration-4.3 head: 46cd28555ffaa40162290dba203daad0ff6f7abd commit: da2f0f74cf7d074e5a8918c8efdf6aba4a989b4a [34/35] Btrfs: add support for blkio controllers config: i386-randconfig-r0-201532 (attached as .config) re

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

2015-08-09 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 --- fs/btrfs/inode.c | 1 - 1 file changed, 1 deletion(-

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

2015-08-09 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 Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 36 +++- 1 file ch

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

2015-08-09 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 --- fs/btrfs/

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

2015-08-09 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 --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH V3 07/11] Btrfs: Use (eb->start, seq) as search key for tree modification log

2015-08-09 Thread Chandan Rajendra
In subpagesize-blocksize a page can map multiple extent buffers and hence using (page index, seq) as the search key is incorrect. For example, searching through tree modification log tree can return an entry associated with the first extent buffer mapped by the page (if such an entry exists), when

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

2015-08-09 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 interfa

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

2015-08-09 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 Signed-off-by

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

2015-08-09 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 p

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

2015-08-09 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 --- fs/btrfs/extent_io.c | 3 ++- fs/btrfs/inode.c | 25 ++-

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

2015-08-09 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 --- fs/btrfs/inode.c | 96 ++-- 1 file ch

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

2015-08-09 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 --- fs/btrfs/ctree.h | 2 +- fs/btrfs/file.c | 47 +

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

2015-08-09 Thread Chandan Rajendra
Currently, the code reserves/releases extents in multiples of PAGE_CACHE_SIZE units. Fix this by doing reservation/releases in block size units. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 44 +++- 1 file changed, 31 insertions(+), 13 deletions(-

Re: raid1 on uneven-sized disks

2015-08-09 Thread Hugo Mills
On Sun, Aug 09, 2015 at 02:29:53PM +0200, Jim MacBaine wrote: > Hi, > > How does btrfs handle raid1 on a bunch of uneven sized disks? Can I > just keep adding arbitrarily sized disks to an existing raid1 and > expect the file system to continue to keep two copies of everything, > so I could surviv

raid1 on uneven-sized disks

2015-08-09 Thread Jim MacBaine
Hi, How does btrfs handle raid1 on a bunch of uneven sized disks? Can I just keep adding arbitrarily sized disks to an existing raid1 and expect the file system to continue to keep two copies of everything, so I could survive the loss of any single disk without data loss? Does btrfs work this way?

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

2015-08-09 Thread Chandan Rajendra
On Friday 07 Aug 2015 14:30:21 Josef Bacik wrote: > On 08/07/2015 03:05 AM, Chandan Rajendra wrote: > > 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 ma