| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
In a similar code, it's used for a message. Not used in this code since
the beggingin, safe to remove.
Resolves-coverity-id: 1364085
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
We don't need to conserve stack space too much unlike kernel, also
remove one error condition.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
The structure size went from 56 bytes to 48, which could save some bytes
in larger scale.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Kernel clear_cache mount option will only rebuild free space cache if
the used space of that chunk has changed.
So it won't ensure any corrupted free space cache get cleared.
So add a new option "--clear-space-cache v1|v2" to btrfsck, to
completely wipe out free space cache.
So kernel won't complain again.
Reported-by: Ivan P <chrnosphered@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ adjusted error messages, doc wording changes ]
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
| |
While performing an fsck, an assertion failure occurs because of reusing path in a loop.
ctree.c:1112: btrfs_search_slot: Warning: assertion `p->nodes[0] != NULL` failed, value 0
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 854437ca(btrfs-progs: extent-tree: avoid allocating tree block
that crosses stripe boundary) introduces check for logical bytenr not
crossing stripe boundary.
However that check is not completely correct.
It only checks if the logical bytenr and length agaist absolute logical
offset.
That's to say, it only check if a tree block lies in 64K logical stripe.
But in fact, it's possible a block group starts at bytenr unaligned with
64K, just like the following case.
Then btrfsck will give false alert.
0 32K 64K 96K 128K 160K ...
|--------------- Block group A ---------------------
|<-----TB 32K------>|
|/Scrub stripe unit/|
| WRONG UNIT |
In that case, TB(tree block) at bytenr 32K in fact fits into the kernel
scrub stripe unit.
But doesn't fit into the pure logical 64K stripe.
Fix check_crossing_stripes() to compare bytenr to block group start, not
to absolute logical bytenr.
Reported-by: Jussi Kansanen <jussi.kansanen@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
| |
Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
| |
Signed-off-by: Domagoj Tršan <domagoj.trsan@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
| |
Cleanup the rb_tree.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
Switch the messages that do not come from the actual image checking,
more like the parameter verification.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
| |
All callers handle errors.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
| |
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 31d8235410985e0b64487354c9ba67d40c4bdfe3.
False report of backref mismatches, lots of messages similar to:
Incorrect local backref count on 12713984 root 5 owner 257 offset 12845056 found 1 wanted 0 back 0x7b3ed0
backpointer mismatch on [12713984 131072]
Repairing will make things worse. A fix has been proposed, but is not
finalized so we go with a revert.
Reported-by: Chris Murphy <bugzilla@colorremedies.com>
References: https://bugzilla.kernel.org/show_bug.cgi?id=155791
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
| |
This reverts commit bbebe814c0e335745cfa773df966418e754b50e3.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add_tree_backref() can cause BUG_ON() and abort() in quite a lot of
cases, from the ENOMEM to existing tree backref records.
Change all these BUG_ON() and abort() to return proper values.
And modify all callers to handle such problems.
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
Check bytenr alignment for extent item to filter invalid items early.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Exposed by fuzzed image from Lukas, which contains invalid drop level
(16), causing segfault when accessing path->nodes[drop_level].
This patch will check drop level against fs tree level and
BTRFS_MAX_LEVEL to avoid such problem.
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current we only do chunk validation check at mount time.
It's good for most case, but for fuzzed or manually crafted images, we
can insert a CHUNK_ITEM key into root tree.
Since mount time check will only check chunk tree, it will not check
CHUNK_ITEM in root tree.
Even with previous key type check against leaf owner, it is still
possible to modify the leaf owner to by-pass it.
So we still need to check chunk validation before processing it.
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Btrfs tree implies a lot of restriction on which key types are allowed
in specific roots.
Like CHUNK_ITEM keys are only valid in chunk root.
This patch will add such check at run_next_block() for original mode.
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
| |
As we're passing a set of flags, the enum type is not appropriate.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
| |
Change the single-purpose option --low-memory to a generic option that
takes the mode. Currently supported are the original mode and the
low-memory in the same way.
Signed-off-by: David Sterba <dsterba@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new fsck mode: low memory mode.
Old btrfsck is working efficiently but uses some memory for each extent
item. This method will ensure extents are only iterated once at
extent/chunk tree check process.
But since it uses some memory for each extent item, for a large fs with
several TB metadata, this can easily eat up memory and cause OOM.
To handle such limitation and improve scalability, the new low-memory
mode will not use any heap memory to record which extent is checked.
Instead it will use extent backref to avoid most of uneeded checks on
shared fs/subvolume tree blocks.
And with the use forward and backward reference cross check, we can also
ensure every tree block is at least checked once.
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
|