[PATCH v3 3/5] btrfs: check verity for reads of inline extents and holes

2021-04-08 Thread Boris Burkov
The majority of reads receive a verity check after the bio is complete as the page is marked uptodate. However, there is a class of reads which are handled with btrfs logic in readpage, rather than by submitting a bio. Specifically, these are inline extents, preallocated extents, and holes. Tweak

[PATCH v2 3/5] btrfs: check verity for reads of inline extents and holes

2021-03-05 Thread Boris Burkov
The majority of reads receive a verity check after the bio is complete as the page is marked uptodate. However, there is a class of reads which are handled with btrfs logic in readpage, rather than by submitting a bio. Specifically, these are inline extents, preallocated extents, and holes. Tweak

[PATCH 3/5] btrfs: check verity for reads of inline extents and holes

2021-02-04 Thread Boris Burkov
The majority of reads receive a verity check after the bio is complete as the page is marked uptodate. However, there is a class of reads which are handled with btrfs logic in readpage, rather than by submitting a bio. Specifically, these are inline extents, preallocated extents, and holes. Tweak

Re: [PATCH 4/6] btrfs: Streamline code in run_delalloc_nocow in case of inline extents

2019-08-21 Thread David Sterba
> explictly dealing with inlines extents. What's more, the nested > 'if (nocow)' can never be true because for inline extents we always do > CoW and there is no chance 'noco' can be true, just remove that check. > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba

[PATCH 4/6] btrfs: Streamline code in run_delalloc_nocow in case of inline extents

2019-08-05 Thread Nikolay Borisov
nocow)' can never be true because for inline extents we always do CoW and there is no chance 'noco' can be true, just remove that check. Signed-off-by: Nikolay Borisov --- fs/btrfs/inode.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/btr

[RFC PATCH 10/19] btrfs: allow reading encrypted inline extents

2019-01-08 Thread Mark Harmstone
Signed-off-by: Mark Harmstone --- fs/btrfs/encryption.c | 305 ++ fs/btrfs/encryption.h | 3 + fs/btrfs/inode.c | 72 +- 3 files changed, 379 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/encryption.c b/fs/btrfs/encryption.c index 0803

[RFC PATCH 11/19] btrfs: allow writing encrypted inline extents

2019-01-08 Thread Mark Harmstone
Signed-off-by: Mark Harmstone --- fs/btrfs/ctree.h | 5 +- fs/btrfs/encryption.c | 156 +- fs/btrfs/encryption.h | 9 +++ fs/btrfs/inode.c | 99 +++ fs/btrfs/ioctl.c | 2 +- 5 files changed, 254 insertions(+), 1

[RFC PATCH 15/19] btrfs: allow writing compressed, encrypted, inline extents

2019-01-08 Thread Mark Harmstone
Signed-off-by: Mark Harmstone --- fs/btrfs/inode.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 61481833f5e4..f8bc7174f7e3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -219,6 +219,22 @@ static int insert_inline_extent(s

Re: inline extents

2018-09-20 Thread Theodore Y. Ts'o
On Wed, Sep 19, 2018 at 09:18:16PM -0600, Chris Murphy wrote: > > ext4 has inline data, too, so there's every chance grub will corrupt > > ext4 filesystems with tit's wonderful new feature. I'm not sure if > > the ext4 metadata cksums cover the entire inode and inline data, but > > if they do it's

Re: inline extents

2018-09-19 Thread Chris Murphy
Adding fsdevel@, linux-ext4, and btrfs@ (which has a separate subject on this same issue) On Wed, Sep 19, 2018 at 7:45 PM, Dave Chinner wrote: >On Wed, Sep 19, 2018 at 10:23:38AM -0600, Chris Murphy wrote: >> Fedora 29 has a new feature to test if boot+startup fails, so the >> bootloader can do

Re: [PATCH v2] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-25 Thread Nikolay Borisov
On 20.06.2018 12:02, fdman...@kernel.org wrote: > From: Filipe Manana > > So fix this by ensuring the physical offset is always set to 0 when we > are processing an extent with a special block_start value. > > Fixes: 9d311e11fc1f ("Btrfs: fiemap: pass correct bytenr when fm_extent_count >

[PATCH v2] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-20 Thread fdmanana
From: Filipe Manana Commit 9d311e11fc1f ("Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero") introduced a regression where we no longer report 0 as the physical offset for inline extents (and other extents with a special block_start value). This is because it alway

Re: [PATCH] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-20 Thread Filipe Manana
onger >> report 0 as the physical offset for inline extents. This is because it >> always sets the variable used to report the physical offset ("disko") >> as em->block_start plus some offset, and em->block_start has the value >> 18446744073709551614 ((u64) -2)

Re: [PATCH] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-19 Thread robbieko
fdman...@kernel.org 於 2018-06-19 19:31 寫到: From: Filipe Manana Commit 9d311e11fc1f ("Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero") introduced a regression where we no longer report 0 as the physical offset for inline extents. This is because it always sets the var

Re: [PATCH] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-19 Thread David Sterba
On Tue, Jun 19, 2018 at 12:31:42PM +0100, fdman...@kernel.org wrote: > From: Filipe Manana > So fix this by ensuring the physical offset is always set to 0 when we > are processing an inline extent. > > Fixes: 9d311e11fc1f ("Btrfs: fiemap: pass correct bytenr when fm_extent_count > is zero") > S

[PATCH] Btrfs: fix physical offset reported by fiemap for inline extents

2018-06-19 Thread fdmanana
From: Filipe Manana Commit 9d311e11fc1f ("Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero") introduced a regression where we no longer report 0 as the physical offset for inline extents. This is because it always sets the variable used to report the physical offset (&

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-04-07 Thread Filipe Manana
>>> From: Zygo Blaxell >>>>>> >>>>>> This is a story about 4 distinct (and very old) btrfs bugs. >>>>>> >>>>>> Commit c8b978188c ("Btrfs: Add zlib compression support") added >>>>>> three

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-04-06 Thread Qu Wenruo
a story about 4 distinct (and very old) btrfs bugs. Commit c8b978188c ("Btrfs: Add zlib compression support") added three data corruption bugs for inline extents (bugs #1-3). Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") fixed bug #1: uncompressed inline

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-04-06 Thread Filipe Manana
; >>>> From: Zygo Blaxell >>>> >>>> This is a story about 4 distinct (and very old) btrfs bugs. >>>> >>>> Commit c8b978188c ("Btrfs: Add zlib compression support") added >>>> three data corruption bugs for inli

Re: [v4] btrfs: add missing memset while reading compressed inline extents

2017-03-30 Thread Ismael Luceno
On 10/Mar/2017 16:45, Zygo Blaxell wrote: > This is a story about 4 distinct (and very old) btrfs bugs. > <...> Tested-by: Ismael Luceno I encountered the issue in the wild; it caused frequent segfaults at ld.so after some hours of operation, as well as integrity check failures. A quick inspect

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-03-21 Thread Qu Wenruo
ssion support") added three data corruption bugs for inline extents (bugs #1-3). Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") fixed bug #1: uncompressed inline extents followed by a hole and more extents could get non-zero data in the hole as they were read.

[PATCH v4] btrfs: add missing memset while reading compressed inline extents

2017-03-10 Thread Zygo Blaxell
This is a story about 4 distinct (and very old) btrfs bugs. Commit c8b978188c ("Btrfs: Add zlib compression support") added three data corruption bugs for inline extents (bugs #1-3). Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") fixed bug #1: uncompr

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-10 Thread Zygo Blaxell
the math reflect any possible > >>>>pg_offset? I do agree it shouldn't be happening, but its easy to correct > >>>>for and the WARN is likely to get lost. > >>> > >>>I'm not sure how to do that. It looks like I'd have to pass pg_offset > >

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-10 Thread Chris Mason
corners allowing inline extents followed by more data, there are a few wacky corners allowing inline extents at the end of the file. Lets not mix that change in with this one though. For now, just get the memset right and we can pass pg_offset down in a later patch. Are you saying "fix the mem

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-10 Thread Zygo Blaxell
> > > ret = btrfs_decompress(compress_type, tmp, page, > > extent_offset, inline_size, max_size, pg_offset); > > > >and in the compression functions get pg_offset from the argument list > >instead of hardcoding zero. > > Yeah, it's a good poi

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-10 Thread Chris Mason
get pg_offset from the argument list instead of hardcoding zero. Yeah, it's a good point. Both zlib and lzo are assuming a zero pg_offset right now, but just like there are wacky corners allowing inline extents followed by more data, there are a few wacky corners allowing inline extents

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-09 Thread Zygo Blaxell
On Thu, Mar 09, 2017 at 10:39:49AM -0500, Chris Mason wrote: > > > On 03/08/2017 09:12 PM, Zygo Blaxell wrote: > >This is a story about 4 distinct (and very old) btrfs bugs. > > > > Really great write up. > > [ ... ] > > > > >diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > >index 25ac2cf..4

Re: [PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-09 Thread Chris Mason
On 03/08/2017 09:12 PM, Zygo Blaxell wrote: This is a story about 4 distinct (and very old) btrfs bugs. Really great write up. [ ... ] diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 25ac2cf..4d41a31 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6805,6 +6805,12 @@ stati

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-03-08 Thread Zygo Blaxell
ompression support") added > > three data corruption bugs for inline extents (bugs #1-3). > > > > Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") > > fixed bug #1: uncompressed inline extents followed by a hole and more > > extents c

[PATCH v3] btrfs: add missing memset while reading compressed inline extents

2017-03-08 Thread Zygo Blaxell
This is a story about 4 distinct (and very old) btrfs bugs. Commit c8b978188c ("Btrfs: Add zlib compression support") added three data corruption bugs for inline extents (bugs #1-3). Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") fixed bug #1: uncompr

Re: [PATCH] btrfs: add missing memset while reading compressed inline extents

2017-03-08 Thread Filipe Manana
On Wed, Mar 8, 2017 at 3:18 AM, Zygo Blaxell wrote: > From: Zygo Blaxell > > This is a story about 4 distinct (and very old) btrfs bugs. > > Commit c8b978188c ("Btrfs: Add zlib compression support") added > three data corruption bugs for inline extents (bugs #1-3). &

[PATCH] btrfs: add missing memset while reading compressed inline extents

2017-03-07 Thread Zygo Blaxell
From: Zygo Blaxell This is a story about 4 distinct (and very old) btrfs bugs. Commit c8b978188c ("Btrfs: Add zlib compression support") added three data corruption bugs for inline extents (bugs #1-3). Commit 93c82d5750 ("Btrfs: zero page past end of inline file items

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2017-03-07 Thread Liu Bo
Hi Zygo, On Tue, Dec 13, 2016 at 01:40:13AM -0500, Zygo Blaxell wrote: > On Sun, Dec 11, 2016 at 10:56:59PM +0100, Xin Zhou wrote: > >Hi Zygo, > >  > >Since the corruption happens after I/O and checksum, > >could it be possible to add some bug catcher code in debug build, to help >

Re: [PATCH] Btrfs: fix file corruption after cloning inline extents

2017-03-06 Thread Filipe Manana
t;> > the source file into a non-zero offset of the destination file. This is >> >> > something not expected and that the btrfs code is not prepared to deal >> >> > with - all inline extents must be at a file offset equals to 0. >> >> > >

Re: [PATCH] Btrfs: fix file corruption after cloning inline extents

2017-03-03 Thread Liu Bo
> >> > something not expected and that the btrfs code is not prepared to deal > >> > with - all inline extents must be at a file offset equals to 0. > >> > > >> > >> Somehow I failed to reproduce the BUG_ON with this case. > >> > &g

Re: [PATCH] Btrfs: fix file corruption after cloning inline extents

2017-03-03 Thread Filipe Manana
e ioctl, which calls the same extent >> > cloning function as well) we end up allowing copy an inline extent from >> > the source file into a non-zero offset of the destination file. This is >> > something not expected and that the btrfs code is not prepared to deal >

Re: [PATCH] Btrfs: fix file corruption after cloning inline extents

2017-03-02 Thread Liu Bo
up allowing copy an inline extent from > > the source file into a non-zero offset of the destination file. This is > > something not expected and that the btrfs code is not prepared to deal > > with - all inline extents must be at a file offset equals to 0. > > > >

Re: [PATCH] Btrfs: fix file corruption after cloning inline extents

2017-03-02 Thread Liu Bo
o offset of the destination file. This is > something not expected and that the btrfs code is not prepared to deal > with - all inline extents must be at a file offset equals to 0. > Somehow I failed to reproduce the BUG_ON with this case. > For example, the following excerpt of a test ca

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2017-02-18 Thread Zygo Blaxell
_extent will return uninitialized kernel memory > instead of zero bytes in the hole. > > Commit 93c82d5750 ("Btrfs: zero page past end of inline file items") > fills the hole by memset to zero after *uncompressed* inline extents. > > This patch provides the missing memse

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-12-12 Thread Zygo Blaxell
/ata/.pata_sis.o.cmd: 9 extents found Note that corruption can only occur if the first extent (the inline extent at offset 0) is compressed (encoded). Uncompressed inline extents (like the one above) will not be corrupted due to the fix in commit 93c82d5750. If commit 93c82d5750 is reverted, yo

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-12-11 Thread Xin Zhou
ot; , "Filipe Manana" Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents Ping? I know at least two people have read this patch, but it hasn't appeared in the usual integration branches yet, and I've seen no a

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-12-10 Thread Zygo Blaxell
gt; + char *map = kmap(page); > > + memset(map + max_size, 0, PAGE_SIZE - max_size); > > + kunmap(page); > > + } > > kfree(tmp); > > return ret; > > } > > Wasn't this already posted as: > > btrfs: fix silent data corruption

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-11-28 Thread Zygo Blaxell
p); > > return ret; > > } > > Wasn't this already posted as: > > btrfs: fix silent data corruption while reading compressed inline extents > https://patchwork.kernel.org/patch/9371971/ > > but you don't indicate that's a V2 or something, and in

Re: [PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-11-28 Thread Roman Mamedov
{ > + char *map = kmap(page); > + memset(map + max_size, 0, PAGE_SIZE - max_size); > + kunmap(page); > + } > kfree(tmp); > return ret; > } Wasn't this already posted as: btrfs: fix silent data corruption while reading compressed in

[PATCH] btrfs: fix hole read corruption for compressed inline extents

2016-11-27 Thread Zygo Blaxell
age past end of inline file items") fills the hole by memset to zero after *uncompressed* inline extents. This patch provides the missing memset for holes after *compressed* inline extents. The offending holes appear in the wild and will appear during routine data integrity audits (e.g. comparing b

Re: [PATCH] btrfs: fix silent data corruption while reading compressed inline extents

2016-10-12 Thread Zygo Blaxell
ug is at least as old as 3.5.7 (the oldest kernel I can conveniently > > test), and possibly much older. > > > > The code may not be correct if the extent is larger than a page, so add > > a WARN_ON for that case. > > > > To reproduce the bug, run this on a 3072M

Re: [PATCH] btrfs: fix silent data corruption while reading compressed inline extents

2016-10-12 Thread Filipe Manana
# Use your favorite block device here > blk=/dev/vdc > > # Create test filesystem and mount point > mkdir -p /try > mkfs.btrfs -dsingle -mdup -O ^extref,^skinny-metadata,^no-holes -f > "$blk" || exit 1 > mount -ocompress-fo

[PATCH] btrfs: fix silent data corruption while reading compressed inline extents

2016-10-11 Thread Zygo Blaxell
|| exit 1 mount -ocompress-force,flushoncommit,max_inline=8192,noatime "$blk" /try || exit 1 # Create a few inline extents in larger files. # Multiple processes seem to be necessary. y=/usr; for x in $(seq 10 19); do rsync -axHSWI "$y/." "$x";

Re: mixed inline, non-inline extents leading to EIO when reading small files

2016-05-26 Thread Chris Mason
s-force=zlib,flushoncommit,space_cache,skip_balance,commit=300 > > Am I missing anything? I've got this queued up to send out. We hit this with holes instead of extents, and without compression, but its a similar problem: Btrfs: deal with duplciates during extent_map insertion in

mixed inline, non-inline extents leading to EIO when reading small files

2016-05-26 Thread Zygo Blaxell
I frequently see these in /etc/lvm/backup/*. Something that LVM does when it writes these files triggers the problem. This problem occurs in kernels 3.18..4.4.11 (i.e. all the kernels I've tested). btrfs-debug-tree finds this: item 26 key (2702988 INODE_ITEM 0) itemoff 12632 itemsize 16

[PATCH V9 09/12] Btrfs: Limit inline extents to root->sectorsize

2015-11-15 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. Reviewed-by: Josef Bacik Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH V8 09/13] Btrfs: Limit inline extents to root->sectorsize

2015-10-28 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. Reviewed-by: Josef Bacik Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH V7 09/13] Btrfs: Limit inline extents to root->sectorsize

2015-10-27 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. Reviewed-by: Josef Bacik Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH V6 09/13] Btrfs: Limit inline extents to root->sectorsize

2015-10-18 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. Reviewed-by: Josef Bacik Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 1/2] fstests: btrfs test for cloning of inline extents

2015-10-13 Thread fdmanana
From: Filipe Manana Test several cases of cloning inline extents that used to lead to file corruption or data loss. These file corruption and data loss cases are fixed by the linux kernel patch titled: "Btrfs: fix file corruption and data loss after cloning inline extents" Sig

[PATCH] Btrfs: fix file corruption and data loss after cloning inline extents

2015-10-13 Thread fdmanana
..\n" test_cloning_inline_extents "-O no-holes" "-o compress" status=0 exit Signed-off-by: Filipe Manana --- fs/btrfs/ioctl.c | 192 ++----- 1 file changed, 149 insertions(+), 43 deletions(-) diff --git a/fs/btrfs/ioctl

[PATCH V5 09/13] Btrfs: Limit inline extents to root->sectorsize

2015-09-30 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

[RFC PATCH V4 09/13] Btrfs: Limit inline extents to root->sectorsize

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

[PATCH] Btrfs: fix file corruption after cloning inline extents

2015-07-14 Thread fdmanana
prepared to deal with - all inline extents must be at a file offset equals to 0. For example, the following excerpt of a test case for fstests triggers a crash/BUG_ON() on a write operation after an inline extent is cloned into a non-zero offset: _scratch_mkfs >>$seqres.full 2>&1 _

[RFC PATCH V11 20/21] Btrfs: subpagesize-blockssize: Limit inline extents to root->sectorsize.

2015-06-01 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] Btrfs: delete inline extents when we find them during logging

2013-03-01 Thread Josef Bacik
Apparently when we do inline extents we allow the data to overlap the last chunk of the btrfs_file_extent_item, which means that we can possibly have a btrfs_file_extent_item that isn't actually as large as a btrfs_file_extent_item. This messes with us when we try to overwrite the extent

[PATCH] Btrfs: fix decompressing of snappy-compressed inline extents

2012-01-17 Thread Li Zefan
The first four bytes is the length of all data chunks, and the first four bytes of each chunk is the length of compressed chunk data, even when there's only one chunk, which is the case for inline extents. Signed-off-by: Li Zefan --- fs/btrfs/snappy.c |4 1 files changed, 4 inser

Re: clone ioctl bug with inline extents

2011-08-09 Thread Sage Weil
On Tue, 9 Aug 2011, Sage Weil wrote: > Hi all, > > I'm hitting a problem cloning inline extents that I haven't had much > success tracking down. It's simple enough to reproduce: > > echo > src > echo 2 > dst &g

clone ioctl bug with inline extents

2011-08-09 Thread Sage Weil
Hi all, I'm hitting a problem cloning inline extents that I haven't had much success tracking down. It's simple enough to reproduce: echo > src echo 2 > dst clone_range src 0 29 dst 0 cmp src dst # fails! dst is size 29 but

[PATCH] Btrfs: release reservations properly when doing inline extents

2011-08-02 Thread Josef Bacik
We were only releasing our metadata reservations when doing inline extents, which isn't correct since we don't need our data reservation either. So call btrfs_delalloc_release_space() instead of btrfs_delalloc_release_metadata(). This would have been caught earlier but we don&#