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

2015-08-07 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 V2 04/11] Btrfs: fallocate: Work with sectorsized blocks

2015-08-07 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 V2 01/11] Btrfs: __btrfs_buffered_write: Reserve/release extents aligned to block size

2015-08-07 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(-

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

2015-08-07 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 V2 02/11] Btrfs: Compute and look up csums based on sectorsized blocks

2015-08-07 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 V2 03/11] Btrfs: Direct I/O read: Work on sectorsized blocks

2015-08-07 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 V2 00/11] Btrfs: Pre subpagesize-blocksize cleanups

2015-08-07 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 V2 09/11] Btrfs: Limit inline extents to root->sectorsize

2015-08-07 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 V2 05/11] Btrfs: btrfs_page_mkwrite: Reserve space in sectorsized units

2015-08-07 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 V2 06/11] Btrfs: Search for all ordered extents that could span across a page

2015-08-07 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 V2 11/11] Btrfs: Clean pte corresponding to page straddling i_size

2015-08-07 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 V2 10/11] Btrfs: Fix block size returned to user space

2015-08-07 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(-

Re: Data single *and* raid?

2015-08-07 Thread Hugo Mills
On Fri, Aug 07, 2015 at 07:16:04AM +0200, Hendrik Friedel wrote: > 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 > >>

Missing dedupe/locking patch in integration-4.2 tree?

2015-08-07 Thread Holger Hoffstätte
Mark's patch titled "[PATCH 3/5] btrfs: fix clone / extent-same deadlocks" [1] from his "btrfs: dedupe fixes, features" series is missing from the integration-4.2 tree and 4.2-rc5, where it still applies cleanly (as of 5 mins ago). Any particular reason why this was silently dropped? -h [

[PATCH] Btrfs: fix defrag to merge tail file extent

2015-08-07 Thread Liu Bo
The file layout is [extent 1]...[extent n][4k extent][HOLE][extent x] extent 1~n and 4k extent can be merged during defrag, and the whole defrag bytes is larger than our defrag thresh(256k), 4k extent as a tail is left unmerged since we check if its next extent can be merged (the next one is a ho

btrfs raid1 metadata, single data

2015-08-07 Thread Robert Krig
Hi, I was wondering. What exactly is contained in btrfs metadata? I've read about some users setting up their btrfs volumes as data=single, but metadata=raid1 Is there any actual benefit to that? I mean, if you keep your data as single, but have multiple copies of metadata, does that still allow

Re: [PATCH] Btrfs: fix defrag to merge tail file extent

2015-08-07 Thread Liu Bo
Writing a xfstests case for this, will come soon. Thanks, -liubo On Fri, Aug 07, 2015 at 04:48:41PM +0800, Liu Bo wrote: > The file layout is > > [extent 1]...[extent n][4k extent][HOLE][extent x] > > extent 1~n and 4k extent can be merged during defrag, and the whole > defrag bytes is larger

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Russell Coker
On Fri, 7 Aug 2015 06:49:58 PM Robert Krig wrote: > What exactly is contained in btrfs metadata? Much the same as in metadata for every other filesystem. > I've read about some users setting up their btrfs volumes as > data=single, but metadata=raid1 > > Is there any actual benefit to that? I me

Re: Removing bad hdd from btrfs volume

2015-08-07 Thread Patrik Lundquist
On 7 August 2015 at 00:17, Peter Foley wrote: > 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 appe

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Sjoerd
On Friday 07 August 2015 19:18:02 Russell Coker wrote: > On Fri, 7 Aug 2015 06:49:58 PM Robert Krig wrote: > > What exactly is contained in btrfs metadata? > > Much the same as in metadata for every other filesystem. > > > I've read about some users setting up their btrfs volumes as > > data=sing

Re: [PATCH v4 1/3] xfstests: btrfs: add functions to create dm-error device

2015-08-07 Thread Filipe David Manana
On Wed, Jul 22, 2015 at 11:14 AM, Anand Jain wrote: > From: Anand Jain > > Controlled EIO from the device is achieved using the dm device. > Helper functions are at common/dmerror. > > Broadly steps will include calling _init_dmerror(). > _init_dmerror() will use SCRATCH_DEV to create dm linear d

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Duncan
Robert Krig posted on Fri, 07 Aug 2015 10:49:58 +0200 as excerpted: > Hi, I was wondering. > > What exactly is contained in btrfs metadata? > > I've read about some users setting up their btrfs volumes as > data=single, but metadata=raid1 > > Is there any actual benefit to that? I mean, if you

Re: [PATCH v4 2/3] xfstests: btrfs: test device replace, with EIO on the src dev

2015-08-07 Thread Filipe David Manana
On Wed, Jul 22, 2015 at 11:14 AM, Anand Jain wrote: > From: Anand Jain > > This test case will test to confirm the replace works when > the replacing source device has EIO errors. > > EIO condition is achieved using the DM device. > > Signed-off-by: Anand Jain > --- > v3->v4: rebase on latest xf

Re: [PATCH v2 3/3] xfstests: btrfs: test device delete with EIO on src dev

2015-08-07 Thread Filipe David Manana
On Tue, May 5, 2015 at 8:03 PM, Anand Jain wrote: > This test case tests if the device delete would work when > the source device has failed with EIO errors. > > EIO errors are achieved usign the DM device. > > Also this test needs the latest btrfs-progs and kernel patch Not patch, but patch set

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Mike Fleetwood
On 7 August 2015 at 10:47, Sjoerd wrote: > While we're at it: any idea why the default for SSD's is single for meta data > as described on the wiki? > (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Filesystem_creation) > > I was looking for an answer why my SSD just had

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Duncan
Sjoerd posted on Fri, 07 Aug 2015 11:47:57 +0200 as excerpted: > While we're at it: any idea why the default for SSD's is single for meta > data as described on the wiki? > (https://btrfs.wiki.kernel.org/index.php/ Using_Btrfs_with_Multiple_Devices#Filesystem_creation) > > I was looking for an an

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Austin S Hemmelgarn
On 2015-08-07 06:40, Mike Fleetwood wrote: On 7 August 2015 at 10:47, Sjoerd wrote: While we're at it: any idea why the default for SSD's is single for meta data as described on the wiki? (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Filesystem_creation) I was look

Re: [PATCH 0/3] Fix for infinite loop on non-empty inode but with no file extent

2015-08-07 Thread Robert Munteanu
>> Qu Wenruo (3): >> btrfs-progs: fsck: Print correct file hole >> btrfs-progs: fsck: Fix a infinite loop on discount file extent repair >> btrfs-progs: fsck-tests: Add test case for inode lost all its file >> extent > > Applied, thank you both. I tried to find a git repo with these patc

Re: [PATCH 0/3] Fix for infinite loop on non-empty inode but with no file extent

2015-08-07 Thread David Sterba
On Fri, Aug 07, 2015 at 04:05:44PM +0300, Robert Munteanu wrote: > >> Qu Wenruo (3): > >> btrfs-progs: fsck: Print correct file hole > >> btrfs-progs: fsck: Fix a infinite loop on discount file extent repair > >> btrfs-progs: fsck-tests: Add test case for inode lost all its file > >> exte

Re: [PATCH 0/3] Fix for infinite loop on non-empty inode but with no file extent

2015-08-07 Thread Robert Munteanu
On Fri, Aug 7, 2015 at 5:00 PM, David Sterba wrote: > On Fri, Aug 07, 2015 at 04:05:44PM +0300, Robert Munteanu wrote: >> >> Qu Wenruo (3): >> >> btrfs-progs: fsck: Print correct file hole >> >> btrfs-progs: fsck: Fix a infinite loop on discount file extent repair >> >> btrfs-progs: fsck-tes

Re: [PATCH 0/3] Fix for infinite loop on non-empty inode but with no file extent

2015-08-07 Thread David Sterba
On Fri, Aug 07, 2015 at 05:17:34PM +0300, Robert Munteanu wrote: > Thanks for the update. Reading it looks to me like the patches should be at > > http://repo.or.cz/w/btrfs-progs-unstable/devel.git/shortlog/refs/heads/devel > > but they don't seem to be . Am I long in the wrong place again :-)

Re: [PATCH 0/3] Fix for infinite loop on non-empty inode but with no file extent

2015-08-07 Thread Robert Munteanu
On Fri, Aug 7, 2015 at 5:19 PM, David Sterba wrote: > On Fri, Aug 07, 2015 at 05:17:34PM +0300, Robert Munteanu wrote: >> Thanks for the update. Reading it looks to me like the patches should be at >> >> >> http://repo.or.cz/w/btrfs-progs-unstable/devel.git/shortlog/refs/heads/devel >> >> but t

Re: Removing bad hdd from btrfs volume

2015-08-07 Thread Peter Foley
On Fri, Aug 7, 2015 at 2:30 AM, Patrik Lundquist wrote: > On 7 August 2015 at 00:17, Peter Foley wrote: >> 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

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

2015-08-07 Thread Josef Bacik
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 makes the checksum computation and look up code to work with sec

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

2015-08-07 Thread Josef Bacik
On 08/07/2015 03:05 AM, Chandan Rajendra wrote: 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

Re: btrfs raid1 metadata, single data

2015-08-07 Thread Sjoerd
On Friday 07 August 2015 11:40:24 Mike Fleetwood wrote: > On 7 August 2015 at 10:47, Sjoerd wrote: > > While we're at it: any idea why the default for SSD's is single for meta > > data as described on the wiki? > > (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices > > #Fil

Re: Lockup in BTRFS_IOC_CLONE/Kernel 4.2.0-rc5

2015-08-07 Thread Elias Probst
On 08/07/2015 06:01 AM, Liu Bo wrote: > Could you do 'echo w > /proc/sysrq-trigger' to gather the whole hang call > stack? Thanks a lot for the feedback. Full call stack output is attached (pasting inline makes no sense due to the size of 2423 lines/135k). In case VGER will strip attachments of