Personally, I think it would be cleaner to do something like:
if (mod == 0) {
new_size = diff;
} else if (mod < 0) {
// >0 check
new_size = old_size - diff
} else {
// overflow check
new_size = old_size + diff
}
At this point, new_size is set correctly in all cases and we can do the
print. I tested this version on some simple cases, and it seems to work
ok as well.
Thanks for the fix,
Boris
> --
> 2.30.1
>
On Mon, Apr 19, 2021 at 02:45:12PM +0800, Qu Wenruo wrote:
> Currently mkfs.btrfs will output a warning message if the sectorsize is
> not the same as page size:
> WARNING: the filesystem may not be mountable, sectorsize 4096 doesn't match
> page size 65536
>
> But since btrfs subpage support f
On Fri, Apr 16, 2021 at 10:07:09PM +0200, David Sterba wrote:
> On Fri, Apr 16, 2021 at 11:14:08AM -0700, Boris Burkov wrote:
> > On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote:
> > > +/*
> > > + * The buffer size if strlen("4096 8192 16384 32768 6553
On Thu, Apr 15, 2021 at 01:30:11PM +0800, Qu Wenruo wrote:
> Currently mkfs.btrfs will output a warning message if the sectorsize is
> not the same as page size:
> WARNING: the filesystem may not be mountable, sectorsize 4096 doesn't match
> page size 65536
>
> But since btrfs subpage support f
> &
> +test_run_commands
> +wait
> +
> +run_check_umount_test_dev "$TEST_MNT"
> +cleanup_loopdevs
> --
> 2.26.2
>
I applied this patch to progs v5.11.1 and ran it on a vm running a
kernel built from e5ff2239e143 (kdave/misc-next rebased today) and each
of the enqueued commands fails without any useful diagnostic
information, nor anything interesting in dmesg as far as I can tell.
e.g.:
"failed: /home/vmuser/btrfs-progs/btrfs filesystem resize --enqueue
-100M /home/vmuser/btrfs-progs/tests/mnt"
I am able to pass other misc tests on this setup.
Is there anything else I need to do to be able to run this test?
Thanks,
Boris
On Tue, Nov 24, 2020 at 04:44:13PM +0200, Nikolay Borisov wrote:
> btrfs_transaction::state is protected by btrfs_fs_info::trans_lock and
> all accesses to this variable should be synchornized by it. However,
> there are 2 exceptions, namely checking if currently running transaction
> has entered i
On Tue, Apr 13, 2021 at 02:06:04PM +0100, Khaled ROMDHANI wrote:
> The variable zone is not initialized. It
> may causes a failed assertion.
>
> Addresses-Coverity: ("Uninitialized variables")
>
> Signed-off-by: Khaled ROMDHANI
Reviewed-by: Boris Burkov
> ---
On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote:
> On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote:
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index f7a4ad86adee..e5282a8f566a 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/b
On Fri, Apr 09, 2021 at 07:40:44AM +0800, Anand Jain wrote:
> On 09/04/2021 02:33, Boris Burkov wrote:
> > The tree checker currently rejects unrecognized flags when it reads
> > btrfs_inode_item. Practically, this means that adding a new flag makes
> > the change backward
On Thu, Apr 08, 2021 at 03:50:08PM -0700, Eric Biggers wrote:
> On Thu, Apr 08, 2021 at 11:33:53AM -0700, Boris Burkov wrote:
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index f7a4ad86adee..e5282a8f566a 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/b
On Thu, Apr 08, 2021 at 04:16:28PM -0700, Eric Biggers wrote:
> On Thu, Apr 08, 2021 at 11:49:37AM -0700, Boris Burkov wrote:
> > On Thu, Apr 08, 2021 at 11:41:42AM -0700, Eric Biggers wrote:
> > > On Thu, Apr 08, 2021 at 11:30:12AM -0700, Boris Burkov wrote:
> > > >
way.
This relies on the following kernel patch for btrfs verity support:
And the following btrfs-progs patch for btrfs_corrupt_block support:
Signed-off-by: Boris Burkov
---
common/verity | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/common/verity b/com
k for corruption, with the patches:
Signed-off-by: Boris Burkov
---
common/config | 1 +
common/verity | 7 ++
tests/btrfs/290 | 190
tests/btrfs/290.out | 17
tests/btrfs/group | 1 +
5 files changed, 216 insertions(+)
c
UNKNOWN.36/37.
Signed-off-by: Boris Burkov
---
tests/btrfs/291 | 156
tests/btrfs/291.out | 2 +
tests/btrfs/group | 1 +
3 files changed, 159 insertions(+)
create mode 100755 tests/btrfs/291
create mode 100644 tests/btrfs/291.out
diff --git a
This patchset provides tests for fsverity support in btrfs.
It includes modifications for generic tests to pass with btrfs as well
as new btrfs specific tests.
--
v3: rebase onto xfstests master branch
v2: pass generic tests, add logwrites test
Boris Burkov (3):
btrfs: test btrfs specific
On Thu, Apr 08, 2021 at 11:41:42AM -0700, Eric Biggers wrote:
> On Thu, Apr 08, 2021 at 11:30:12AM -0700, Boris Burkov wrote:
> >
> > Note that there is a bit of a kludge here: since btrfs_corrupt_block
> > doesn't handle streaming corruption bytes from stdin (I cou
On Thu, Apr 08, 2021 at 11:36:30AM -0700, Eric Biggers wrote:
> On Thu, Apr 08, 2021 at 11:30:10AM -0700, Boris Burkov wrote:
> > This patchset provides tests for fsverity support in btrfs.
> >
> > It includes modifications for generic tests to pass with btrfs as well
>
From: Chris Mason
Add support for fsverity in btrfs. To support the generic interface in
fs/verity, we add two new item types in the fs tree for inodes with
verity enabled. One stores the per-file verity descriptor and the other
stores the Merkle tree data itself.
Verity checking is done at the
ore it.
Signed-off-by: Boris Burkov
---
fs/btrfs/extent_io.c | 26 +++---
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index bf784c10040b..a15f289e29e6 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_i
Reading the contents with direct IO would circumvent verity checks, so
fallback to buffered reads. For what it's worth, this is how ext4
handles it as well.
Signed-off-by: Boris Burkov
---
fs/btrfs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/f
that this is a resurrection of using orphans to
signal orphaned metadata that isn't the inode itself. This makes the
comment discussing deprecating that concept a bit messy in full context.
Signed-off-by: Boris Burkov
---
fs/btrfs/inode.c | 15 ++--
fs/btrfs/ver
patch that handles orphaned
verity data.
Boris Burkov (4):
btrfs: add compat_flags to btrfs_inode_item
btrfs: check verity for reads of inline extents and holes
btrfs: fallback to buffered io for verity files
btrfs: verity metadata orphan items
Chris Mason (1):
btrfs: initial fsverity su
flags". These flags are zero on inode creation in btrfs and
mkfs and are ignored by an older kernel, so it should be safe to use
them in this way.
Signed-off-by: Boris Burkov
---
fs/btrfs/btrfs_inode.h | 1 +
fs/btrfs/ctree.h| 2 ++
fs/btrfs/delayed-inode.c
relies on btrfs-corrupt-block for corruption, with the
following btrfs-progs patches:
btrfs-progs: corrupt generic item data with btrfs-corrupt-block
btrfs-progs: expand corrupt_file_extent in btrfs-corrupt-block
Signed-off-by: Boris Burkov
---
tests/btrfs/291 | 156
block
btrfs-progs: expand corrupt_file_extent in btrfs-corrupt-block
Signed-off-by: Boris Burkov
---
common/config | 1 +
common/verity | 7 ++
tests/btrfs/290 | 190
tests/btrfs/290.out | 17
tests/btrfs/group | 1 +
5
fs: return whole extents in fiemap
and it relies on btrfs-corrupt-block for corruption, with the
following btrfs-progs patches:
btrfs-progs: corrupt generic item data with btrfs-corrupt-block
btrfs-progs: expand corrupt_file_extent in btrfs-corrupt-block
Signed-off-by: Boris Burkov
---
common/v
This patchset provides tests for fsverity support in btrfs.
It includes modifications for generic tests to pass with btrfs as well
as new btrfs specific tests.
Boris Burkov (3):
btrfs: test btrfs specific fsverity corruption
generic/574: corrupt btrfs merkle tree data
btrfs: test verity
On Wed, Apr 07, 2021 at 09:10:46AM -0700, Darrick J. Wong wrote:
> On Tue, Apr 06, 2021 at 03:54:29PM -0700, Boris Burkov wrote:
> > btrfs trims fiemap extents to the inputted offset, which leads to
> > inconsistent results for most inputs, and downright bizarre outputs like
>
btrfs by:
btrfs: return whole extents in fiemap
(https://lore.kernel.org/linux-btrfs/274e5bcebdb05a8969fc300b4802f33da2fbf218.1617746680.git.bo...@bur.io/)
Signed-off-by: Boris Burkov
---
v3: make the block size more generic, use test dev instead of scratch,
cleanup style issues.
v2: fill out copy
btrfs by:
btrfs: return whole extents in fiemap
(https://lore.kernel.org/linux-btrfs/274e5bcebdb05a8969fc300b4802f33da2fbf218.1617746680.git.bo...@bur.io/)
Signed-off-by: Boris Burkov
--
v2: fill out copyright and test description
---
tests/generic/623
btrfs by:
btrfs: return whole extents in fiemap
(https://lore.kernel.org/linux-btrfs/274e5bcebdb05a8969fc300b4802f33da2fbf218.1617746680.git.bo...@bur.io/)
Signed-off-by: Boris Burkov
---
tests/generic/623 | 93 +++
tests/generic/623.out | 2 +
tests/ge
en a new xfstest for checking we don't have backwards or
zero-length fiemaps for cases like those above.
Signed-off-by: Boris Burkov
---
fs/btrfs/extent_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7ad2169e7487..
On Mon, Mar 15, 2021 at 04:17:17PM -0700, Eric Biggers wrote:
> On Fri, Mar 05, 2021 at 11:26:30AM -0800, Boris Burkov wrote:
> > +static int end_page_read(struct page *page, bool uptodate, u64 start, u32
> > len)
> > {
> > - struct btrfs_fs_info *fs_info = btrfs_s
On Mon, Mar 15, 2021 at 04:09:41PM -0700, Eric Biggers wrote:
> On Fri, Mar 05, 2021 at 11:26:28AM -0800, Boris Burkov wrote:
> > This patchset provides support for fsverity in btrfs.
> >
> > At a high level, we store the verity descriptor and Merkle tree data
> > in
On Mon, Mar 15, 2021 at 04:07:24PM -0700, Eric Biggers wrote:
> On Fri, Mar 05, 2021 at 11:26:29AM -0800, Boris Burkov wrote:
> > The tree checker currently rejects unrecognized flags when it reads
> > btrfs_inode_item. Practically, this means that adding a new flag makes
> >
ore it.
Signed-off-by: Boris Burkov
---
fs/btrfs/extent_io.c | 26 +++---
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 0d6f8b33830f..653b066f3043 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_i
makes the
comment discussing deprecating that concept a bit messy in full context.
Signed-off-by: Boris Burkov
---
fs/btrfs/inode.c | 15 +++--
fs/btrfs/verity.c | 80 +--
2 files changed, 83 insertions(+), 12 deletions(-)
diff --git a/fs/btrfs/in
Reading the contents with direct IO would circumvent verity checks, so
fallback to buffered reads. For what it's worth, this is how ext4
handles it as well.
Signed-off-by: Boris Burkov
---
fs/btrfs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/f
From: Chris Mason
Add support for fsverity in btrfs. To support the generic interface in
fs/verity, we add two new item types in the fs tree for inodes with
verity enabled. One stores the per-file verity descriptor and the other
stores the Merkle tree data itself.
Verity checking is done at the
flags". These flags are zero on inode creation in btrfs and
mkfs and are ignored by an older kernel, so it should be safe to use
them in this way.
Signed-off-by: Boris Burkov
---
fs/btrfs/btrfs_inode.h | 1 +
fs/btrfs/ctree.h| 2 ++
fs/btrfs/delayed-inode.c
a new patch that handles orphaned
verity data.
Boris Burkov (4):
btrfs: add compat_flags to btrfs_inode_item
btrfs: check verity for reads of inline extents and holes
btrfs: fallback to buffered io for verity files
btrfs: verity metadata orphan items
Chris Mason (1):
btrfs: initial fsv
remount,ro mnt
(no warning, no fst change)
sudo mount -o remount,rw,space_cache=v2 mnt
(no warning, no fst change)
Reported-by: Chris Murphy
Signed-off-by: Boris Burkov
---
fs/btrfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
inde
mnt
At first I assumed I just completely ignored this case, but reading the
code now, it looks like it should have handled it. I assume I messed
up the value of the mount option during a remount when it isn't set by
the mount command.
Apologies for the noise, and I should hopefully have a fix soon.
Boris
n if sb cache_generation is 0 in
> validate_free_space_cache() as it's valid now since the kernel commit
> mentioned above.
Sorry that I didn't notice the fsck issue.
The fix looks good to me.
>
> Link: https://github.com/kdave/btrfs-progs/issues/338
> Signed-off-by: Su Yue
On Thu, Feb 11, 2021 at 08:19:45PM -0500, Zygo Blaxell wrote:
> On Thu, Feb 04, 2021 at 10:58:19PM -0800, Boris Burkov wrote:
> > On Thu, Feb 04, 2021 at 10:13:54PM -0800, Eric Biggers wrote:
> > > On Thu, Feb 04, 2021 at 03:21:36PM -0800, Boris Burkov wrote:
> > > >
On Tue, Feb 09, 2021 at 06:22:47AM +, Sidong Yang wrote:
> On Thu, Feb 04, 2021 at 12:09:31PM -0800, Boris Burkov wrote:
>
> Hi Boris, I have a question for this code.
>
> > btrfs-corrupt-block already has a mix of generic and specific corruption
> > options, but curr
On Fri, Feb 05, 2021 at 10:06:07AM +0200, Nikolay Borisov wrote:
>
>
> On 5.02.21 г. 1:21 ч., Boris Burkov wrote:
> > From: Chris Mason
> >
> > Add support for fsverity in btrfs. To support the generic interface in
> > fs/verity, we add two new item typ
On Thu, Feb 04, 2021 at 10:13:54PM -0800, Eric Biggers wrote:
> On Thu, Feb 04, 2021 at 03:21:36PM -0800, Boris Burkov wrote:
> > This patchset provides support for fsverity in btrfs.
>
> Very interested to see this! It generally looks good, but I have some
> comments.
>
Thu, Feb 04, 2021 at 10:04:07PM -0800, Eric Biggers wrote:
> Thanks for writing a test for this!
>
> On Thu, Feb 04, 2021 at 03:24:26PM -0800, Boris Burkov wrote:
> > There are some btrfs specific fsverity scenarios that don't map
> > neatly onto the tests in gener
iles
btrfs: add sysfs feature for fsverity
and it relies on btrfs-corrupt-block for corruption, with the patches:
btrfs-progs: corrupt generic item data with btrfs-corrupt-block
btrfs-progs: expand corrupt_file_extent in btrfs-corrupt-block
Signed-off-by: Boris Burkov
---
common/config
Now that we support fsverity, enable a feature flag for it in sysfs.
Signed-off-by: Boris Burkov
---
fs/btrfs/sysfs.c | 6 ++
include/uapi/linux/btrfs.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 19b9fffa2c9c..40e780724c03
From: Chris Mason
Add support for fsverity in btrfs. To support the generic interface in
fs/verity, we add two new item types in the fs tree for inodes with
verity enabled. One stores the per-file verity descriptor and the other
stores the Merkle tree data itself.
Verity checking is done at the
ore it.
Signed-off-by: Boris Burkov
---
fs/btrfs/extent_io.c | 24 +---
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7254387200a2..16e3f4304d2e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1
flags". These flags are zero on inode creation in btrfs and
mkfs and are ignored by an older kernel, so it should be safe to use
them in this way.
Signed-off-by: Boris Burkov
---
fs/btrfs/btrfs_inode.h | 1 +
fs/btrfs/ctree.h| 2 ++
fs/btrfs/delayed-inode.c
le by falling back to
buffered io.
The fifth patch adds a feature file in sysfs for verity.
Boris Burkov (4):
btrfs: add compat_flags to btrfs_inode_item
btrfs: check verity for reads of inline extents and holes
btrfs: fallback to buffered io for verity files
btrfs: add sysfs feature for fsv
Reading the contents with direct IO would circumvent verity checks, so
fallback to buffered reads. For what it's worth, this is how ext4
handles it as well.
Signed-off-by: Boris Burkov
---
fs/btrfs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/f
--metadata item data which
is an opaque blob to btrfs.
Signed-off-by: Boris Burkov
---
btrfs-corrupt-block.c | 71 +--
1 file changed, 68 insertions(+), 3 deletions(-)
diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c
index 0c022a8e..bf1ce9c5 100644
corrupting holes and prealloc in extent data.
Boris Burkov (2):
btrfs-progs: corrupt generic item data with btrfs-corrupt-block
btrfs-progs: expand corrupt_file_extent in btrfs-corrupt-block
btrfs-corrupt-block.c | 93 +++
1 file changed, 85 insertions(+), 8
To corrupt holes/prealloc/inline extents, we need to mess with
extent data items. This patch makes it possible to modify
disk_bytenr with a specific value (useful for hole corruptions)
and to modify the type field (useful for prealloc corruptions)
Signed-off-by: Boris Burkov
---
btrfs-corrupt
I wondered whether you had elimated fragmentation, or any other known gotchas,
as a cause?
Out of curiosity, what is/was the utilisation of the disk? Were the snapshots
read-only or read-write?
Apropos Nada: quick shout out to Qu to wish him luck for the 4.6 merge.
[Also, damn you autocorrecti
Hi,
Setup: btrfs root but Ubuntu style: /@/
with root=@ as a kernel boot option. Been using it happily for years; not
even sure if Ubuntu still uses this system for btrfs installs.
btrfs fs is a partition on my GPT HDD.
My fstab contains subvol=@ as option on the btrfs line, and
adding/subtracting
Since nobody had any other suggestions, I decided to attempt to run
modified btrfsck with --repair option (without BUG_ON(rec->is_root)
assertion).
Surprisingly modified btrfsck --repair fixed all errors but one
(according to btrfsck), but btrfsck asked me to run btrfsck --repair one
In attempt to get more information, I have commented out
BUG_ON(rec->is_root) in cmds-check.c to let btrfsck check my file system
without failing on this assertion. Below you can see the output. I would
appreciate any help or ideas...
# btrfsck /dev/sdb1 # Full log can be downloaded her
On 2014-11-24 02:46, Duncan wrote
> if you were using gmane's web service, that explains things as
weaverd, the process
> that does the threading on the web side, was down for some days
Yes, I have used gmane blog. Good to know it is not down anymore.
Back on topic. Even after updating
Hi all,
I was looking for a quick method of testing whether a working directory is a
subvolume.
Couldn't see an obvious one, so tried 'btrfs show http://tldp.org/LDP/abs/html/fto.html .
The letter v (for volume, both upper and lower case forms; one for subvol,
other for snapshots) is unused af
> I suggest upgrading and just posting the results from 'btrfs check
'
> without any options and see what you get.
OK, I have upgraded to 3.17.0 kernel and I also have upgraded
btrfs-tools:
# btrfs --version
Btrfs v3.17
# btrfs check /dev/sdb1
Checking filesystem on /dev/sdb1
UUID: 787e3
On 2014-11-21 04:35, Roman Mamedov wrote:
On Fri, 21 Nov 2014 01:27:17 +
Boris Chernov wrote:
I have changed file system label few times in total. When I tried
to mount it after that, it became not mountable:
# mount /dev/sdb1 /mnt
mount: Not a directory
I'd say that im
I have changed file system label few times in total. When I tried
to mount it after that, it became not mountable:
# mount /dev/sdb1 /mnt
mount: Not a directory
In dmesg I see the following after above command:
[ 5198.413202] BTRFS info (device sdb1): disk space caching is enabled
[
Swâmi Petaramesh petaramesh.org> writes:
> Actually deduplication WAS the reason why I recently made the move to BTRFS
> again, for deduplication in ZFS is working, but *SO* memory hungry and
> performance killer unless you have *lots* of RAM...
>
If you think about what dedup is has to do i
69 matches
Mail list logo