On 30.03.2018 05:56, Gu Jinxiang wrote:
> Parameter usagestr is not used, remove it.
>
> Signed-off-by: Gu Jinxiang
Reviewed-by: Nikolay Borisov
> ---
> cmds-filesystem.c | 2 +-
> help.c| 2 +-
> help.h| 3 +--
> 3 files
eb->lru is not initialized in __alloc_extent_buffer(), so in the
following call chain, it could call NULL pointer dereference:
btrfs_clone_extent_buffer()
|- __alloc_extent_buffer()
|- Now eb->lru is NULL (not initialized)
free_extent_buffer_final()
|- list_del_init(>lru)
Thankfully, current
The patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/eb_cleanup
Just like kernel cleanup and refactors, this patchset will embed
btrfs_fs_info structure into extent_buffer.
And fixes several possible NULL pointer dereference (although not
utilized in
Just like kernel cleanup made by David, btrfs_print_leaf() and
btrfs_print_tree() doesn't need btrfs_root parameter at all.
With previous patches as preparation, now we can remove the btrfs_root
parameter.
Signed-off-by: Qu Wenruo
---
cmds-inspect-dump-tree.c | 31
Instead of struct btrfs_root, use struct btrfs_fs_info, since nodesize
is now a per-fs setting, and with the need to pass a @root, caller don't
need to wonder which root should be passed.
Signed-off-by: Qu Wenruo
---
btrfs-corrupt-block.c | 2 +-
check/main.c | 2 +-
Instead of using the internal struct extent_io_tree, use struct fs_info.
This does not only unify the interface between kernel and btrfs-progs,
but also makes later btrfs_print_tree() use less parameters.
Signed-off-by: Qu Wenruo
---
convert/source-reiserfs.c | 3 +--
disk-io.c
In free_extent_buffer_final() we access eb->tree->cache_size in
BUG_ON().
However eb->tree can be NULL if it's a cloned extent buffer.
Currently the cloned extent buffer is only used in backref.c,
paths_from_inode() function.
Thankfully that function is not used yet (but could be pretty useful to
In free_extent_buffer_final() we access eb->tree->cache_size in
BUG_ON().
However eb->tree can be NULL if it's a cloned extent buffer.
Currently the cloned extent buffer is only used in backref.c,
paths_from_inode() function.
Thankfully that function is not used yet (but could be pretty useful to
Instead of using the internal struct extent_io_tree, use struct fs_info.
This does not only unify the interface between kernel and btrfs-progs,
but also makes later btrfs_print_tree() use less parameters.
Signed-off-by: Qu Wenruo
---
disk-io.c | 3 +--
extent_io.c | 14
Instead of struct btrfs_root, use struct btrfs_fs_info, since nodesize
is now a per-fs setting, and with the need to pass a @root, caller don't
need to wonder which root should be passed.
Signed-off-by: Qu Wenruo
---
btrfs-corrupt-block.c | 2 +-
check/main.c | 2 +-
Just like kernel cleanup made by David, btrfs_print_leaf() and
btrfs_print_tree() doesn't need btrfs_root parameter at all.
With previous patches as preparation, now we can remove the btrfs_root
parameter.
Signed-off-by: Qu Wenruo
---
cmds-inspect-dump-tree.c | 31
eb->lru is not initialized in __alloc_extent_buffer(), so in the
following call chain, it could call NULL pointer dereference:
btrfs_clone_extent_buffer()
|- __alloc_extent_buffer()
|- Now eb->lru is NULL (not initialized)
free_extent_buffer_final()
|- list_del_init(>lru)
Thankfully, current
On 2018/03/30 2:35, Goffredo Baroncelli wrote:
> Hi Misono,
Hello,
>
> I tested you patch, and it seems to work. I verified that the output is
> correct and the permission check is performed. However the output of "btrfs
> sub list" in the "root" mode and the "user" mode are a bit different.
Parameter usagestr is not used, remove it.
Signed-off-by: Gu Jinxiang
---
cmds-filesystem.c | 2 +-
help.c| 2 +-
help.h| 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index
We check the %csum_type twice. Drop one. Check for the csum_type and
then for the csum. Which also matches with the progs which have better
logic. This is preparatory patch to get proper error code from
btrfs_check_super_csum().
Signed-off-by: Anand Jain
Reviewed-by:
During the btrfs dev scan make sure that other copies of superblock
contain the same fsid as the primary SB. So that we bring to the
user notice if the superblock has been overwritten.
mkfs.btrfs -fq /dev/sdc
mkfs.btrfs -fq /dev/sdb
dd if=/dev/sdb of=/dev/sdc count=4K skip=64K seek=64K obs=1
v3->v4:
Update changelog and signoff.
Reintroduce explicit check for '-EUCLEAN'
at Patch 2/8 and 5/8.
v2->v3:
Squash
4/8 btrfs: make btrfs_check_super_csum() non static
to
6/8 btrfs: verify superblock checksum during scan
As in the individual patch mentioned
v1->v2:
Various changes
Return the required -EINVAL and -EUCLEAN from the function
btrfs_check_super_csum(). And more the error log into the
parent function.
Signed-off-by: Anand Jain
Reviewed-by: Nikolay Borisov
---
v2->v4:
Check for -EUCLEAN in else if
v1->v2:
Fix commit
The only caller btrfs_scan_one_device() sets -EINVAL for error from
btrfs_read_disk_super(), so this patch returns -EINVAL from the latter
function.
A preparatory patch to add csum check in btrfs_read_disk_super().
Signed-off-by: Anand Jain
Reviewed-by: Nikolay Borisov
@@ -2570,9 +2568,14 @@ int open_ctree(struct super_block *sb,
* We want to check superblock checksum, the type is stored inside.
* Pass the whole disk block of size BTRFS_SUPER_INFO_SIZE (4k).
*/
- if (btrfs_check_super_csum(fs_info, bh->b_data)) {
-
During the scan context, we aren't verifying the superblock-
checksum when read.
This patch fixes it by adding the checksum verification function
btrfs_check_super_csum() in the function btrfs_read_disk_super().
And makes device scan to error fail if the primary superblock csum
is wrong, whereas
During the mkfs.btrfs -b btrfs_prepare_device() zeros all
the superblock bytenr locations only if the bytenr is below the
blockcount. The problem with this is that if the BTRFS is recreated
with a smaller size then we will leave the stale superblock in the disk
which shall confuse the recovery.
During the mount context btrfs_open_devices() calls invalidate_bdev()
for all the devices. So drop the invalidate_bdev() in open_ctree()
which is only for the btrfs_fs_devices::latest_bdev.
The call trace is as shown below.
btrfs_mount_root()
|
|_btrfs_parse_early_options (-o device only)
|
On Wed, Mar 21, 2018 at 09:02:36PM +0100, Christoph Anton Mitterer wrote:
> Hey.
>
> Some things would IMO be nice to get done/clarified (i.e. documented in
> the Wiki and manpages) from users'/admin's POV:
>
> Some basic questions:
I can answer some easy ones:
> - compression+raid?
There
Hi Filipe,
I tried running the xfstest above on kernel 4.15.0 and I haven't been
able to hit the bug. The xfstest passes clean for me. I compared the
btrfs-debug-tree in my case with the one attached by Eryu, and I see I
do not have any xattr as he does. However, for every run of the
xfstest, the
Hi Misono,
I tested you patch, and it seems to work. I verified that the output is correct
and the permission check is performed. However the output of "btrfs sub list"
in the "root" mode and the "user" mode are a bit different.
As reported before, I find your output more consistent, and
On Wed, Mar 28, 2018 at 11:24 PM, Nikolay Borisov wrote:
>
>
> On 29.03.2018 01:11, Liu Bo wrote:
>> When mount fails to read trees like fs tree, checksum tree, extent
>> tree, etc, there is not enough information about where went wrong.
>>
>> With this, messages like
>>
>>
On Wed, Mar 28, 2018 at 11:33 AM, Eryu Guan wrote:
> On Wed, Mar 28, 2018 at 09:48:17AM +0100, Filipe Manana wrote:
>> On Wed, Mar 28, 2018 at 3:17 AM, Eryu Guan wrote:
>> > On Mon, Mar 26, 2018 at 11:59:21PM +0100, fdman...@kernel.org wrote:
>> >> From:
On 29.03.2018 13:37, Anand Jain wrote:
> During the scan context, we aren't verifying the superblock-
> checksum when read.
> This patch fixes it by adding the checksum verification function
> btrfs_check_super_csum() in the function btrfs_read_disk_super().
> And makes device scan to error fail
On 29.03.2018 13:37, Anand Jain wrote:
> During the btrfs dev scan make sure that other copies of superblock
> contain the same fsid as the primary SB. So that we bring to the
> user notice if the superblock has been overwritten.
>
> mkfs.btrfs -fq /dev/sdc
> mkfs.btrfs -fq /dev/sdb
> dd
On 29.03.2018 13:36, Anand Jain wrote:
> Return the required -EINVAL and -EUCLEAN from the function
> btrfs_check_super_csum(). And more the error log into the
> parent function.
>
> Signed-off-by: Anand Jain
> v1->v2:
> Fix commit indent reported by checkpatch.pl
>
During the scan context, we aren't verifying the superblock-
checksum when read.
This patch fixes it by adding the checksum verification function
btrfs_check_super_csum() in the function btrfs_read_disk_super().
And makes device scan to error fail if the primary superblock csum
is wrong, whereas
During mount context, we aren't verifying the superblock checksum
for all the devices, instead, we verify it only for the
struct btrfs_fs_device::latest_bdev. This patch fixes it by moving
the checksum verification code from the function open_ctree() into
the function btrfs_read_dev_one_super().
Return the required -EINVAL and -EUCLEAN from the function
btrfs_check_super_csum(). And more the error log into the
parent function.
Signed-off-by: Anand Jain
v1->v2:
Fix commit indent reported by checkpatch.pl
Fix pr_err split string
---
fs/btrfs/disk-io.c | 25
During the btrfs dev scan make sure that other copies of superblock
contain the same fsid as the primary SB. So that we bring to the
user notice if the superblock has been overwritten.
mkfs.btrfs -fq /dev/sdc
mkfs.btrfs -fq /dev/sdb
dd if=/dev/sdb of=/dev/sdc count=4K skip=64K seek=64K obs=1
During the mkfs.btrfs -b btrfs_prepare_device() zeros all
the superblock bytenr locations only if the bytenr is below the
blockcount. The problem with this is that if the BTRFS is recreated
with a smaller size then we will leave the stale superblock in the disk
which shall confuse the recovery.
During the mount context btrfs_open_devices() calls invalidate_bdev()
for all the devices. So drop the invalidate_bdev() in open_ctree()
which is only for the btrfs_fs_devices::latest_bdev.
The call trace is as shown below.
btrfs_mount_root()
|
|_btrfs_parse_early_options (-o device only)
|
We check the %csum_type twice. Drop one. Check for the csum_type and
then for the csum. Which also matches with the progs which have better
logic. This is preparatory patch to get proper error code from
btrfs_check_super_csum().
Signed-off-by: Anand Jain
Reviewed-by:
v2->v3:
Squash
4/8 btrfs: make btrfs_check_super_csum() non static
to
6/8 btrfs: verify superblock checksum during scan
As in the individual patch mentioned
v1->v2:
Various changes suggested by Nicokay. Thanks. For specific changes
pls ref to the patch.
Patch 1-4/8 are preparatory
The only caller btrfs_scan_one_device() sets -EINVAL for error from
btrfs_read_disk_super(), so this patch returns -EINVAL from the latter
function.
A preparatory patch to add csum check in btrfs_read_disk_super().
Signed-off-by: Anand Jain
Reviewed-by: Nikolay Borisov
Verify if the superblock corruption is handled correctly.
Signed-off-by: Anand Jain
---
tests/btrfs/159 | 142
tests/btrfs/159.out | 35 +
tests/btrfs/group | 1 +
3 files changed, 178 insertions(+)
- btrfs_release_disk_super(page);
-> error_bdev_put:
You need a check whether page_primary is set here and release it,
otherwise you are leaking it. This needs to handle both the primary sb
read failure (where page_primary might not be set) as well as any FSID
mismatch from loop.
On 03/28/2018 03:21 PM, Nikolay Borisov wrote:
On 28.03.2018 02:39, Anand Jain wrote:
During the scan context, we aren't verifying the superblock-
checksum when read.
This patch fixes it by adding the checksum verification function
btrfs_check_super_csum() in the function
Verify if the superblock corruption is handled correctly.
Signed-off-by: Anand Jain
---
tests/btrfs/159 | 142
tests/btrfs/159.out | 35 +
tests/btrfs/group | 1 +
3 files changed, 178 insertions(+)
When use a given path end with a slash like below,
the output of path will have double slash.
Do not add extra slash if there is already one in the given
path.
$ btrfs filesystem du ./test/
output:
Total Exclusive Set shared Filename
0.00B 0.00B -
On 29.03.2018 11:22, Misono Tomohiro wrote:
> "fi usage" shows the warning "RAID5/6 numbers will be incorrect" when
> running without root privilege even if raid5/6 is not used. What
> happens is it cannot get the per device profile usage info, so change
> the message more appropriately.
>
>
Although per device usage cannot be shown without root privilege,
per profile usage can be shown.
To achieve this, we just basically need to remove the check of nullness
of chunkinfo in print_filesystem_usage_by_chunk(), because other
functions except print_unused() properly handles chunkinfo by
From: Omar Sandoval
Deleted free space cache inodes also get an orphan item in the root
tree, but we shouldn't report those as deleted subvolumes. Deleted
subvolumes will still have the root item, so we can just do an extra
tree search.
Reported-by: Tomohiro Misono
From: Omar Sandoval
If we fail to reallocate the ID array, we still need to free it.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/subvolume.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libbtrfsutil/subvolume.c
From: Omar Sandoval
Otherwise, make test-libbtrfsutil from a fresh checkout fails.
Signed-off-by: Omar Sandoval
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 699f864d..fbd6677a 100644
--- a/Makefile
From: Omar Sandoval
Hi, Dave,
This is a handful of minor fixes for libbtrfsutil that would be good to
get in before the release. Patch 1 fixes an issue reported by Tomohiro a
few weeks back. Patch 2 fixes a memory leak I noticed while writing
patch 1. Patch 3 makes us use the
From: Omar Sandoval
Since "btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE",
the top-level subvolume has a non-zero UUID, ctime, and otime. Fix the
subvolume_info() test to not check for zero.
Signed-off-by: Omar Sandoval
---
52 matches
Mail list logo