| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
btrfsck -s 0 uses the defult 0, -s 1 uses copy #1 etc.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
|
|
|
|
| |
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
| |
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
|
|
|
|
| |
compiling btrfs-progs from current git I get an error in btrfsck.c about
undefined references. The attached patch adds an include for sys/stat.h
which fixes the problem for me.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
|
|
|
|
|
| |
As recently discussed on the list, btrfsck should only be run on
unmounted filesystems. This patch adds a short check for the mount
status at the beginning of btrfsck. If the FS is mounted, the
program aborts showing an error message.
Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
|
|
|
|
|
|
|
|
| |
This patch adds semantic checks for links to snapshot/subvolume and
root back/forward references.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new kind of back reference for btrfs metadata.
Once a filesystem has been mounted with this commit, IT WILL NO LONGER
BE MOUNTABLE BY OLDER KERNELS.
The new back ref provides information about pointer's key, level and in which
tree the pointer lives. This information allow us to find the pointer by
searching the tree. The shortcoming of the new back ref is that it only works
for pointers in tree blocks referenced by their owner trees.
This is mostly a problem for snapshots, where resolving one of these fuzzy back
references would be O(number_of_snapshots) and quite slow. The solution used
here is to use the fuzzy back references in the common case where a given tree
block is only referenced by one root, and use the full back references when
multiple roots have a reference
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are still some warnings of the form:
format '%llu' expects type 'long long unsigned int' but argument has type 'u64'
In conjunction with -Werror, this is causing some build failures.
Now they're properly casted, avoiding compiler warnings.
Signed-off-by: Luca Bruno <lucab@debian.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
|
| |
|
|
|
|
|
| |
Signed-off-by: WANG Cong <wangcong@zeuux.org>
|
|
|
|
|
|
| |
If btrfsck is not able to open a device, it segfaults. This fixes it and
prints an error message too.
|
|
|
|
|
|
|
| |
Make several functions static, and make one argument const.
Signed-off-by: WANG Cong <wangcong@zeuux.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes btrfsck check more things, including
directory items, file extents, checksumming, inode link
counts etc.
The code for these checks is similar to the code verifies
extent back references. The main difference is that
shared tree blocks are treated specially. The partial
checking results(unresolved references and/or errors)
of shared sub-trees are cached. This avoids scanning
the shared blocks several times. Thank you,
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
|
|
|
| |
This patch updates btrfs-progs for fallocate support.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The offset field in struct btrfs_extent_ref records the position
inside file that file extent is referenced by. In the new back
reference system, tree leaves holding reference to file extent
are recorded explicitly. We can quickly scan these tree leaves, so the
offset field is not required.
This patch also makes the back reference system check the objectid
when extents are being deleted
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
|
|
|
|
|
|
|
|
| |
This patch makes the back reference system to explicit record the
location of parent node for all types of extents. The location of
parent node is placed into the offset field of backref key. Every
time a tree block is balanced, the back references for the affected
lower level extents are updated.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
btrfsck fails to check if it actually received a dev argument though, so if you
don't pass a device, we get a nice segfault.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is done by doing a two-step conversion (rather than a one-step).
First, the variable goes from type * to void *, and then to
implicitly to void **.
(Not sure if this is "good practice", but it shuts up the compiler,
so it seems the compiler takes into account that we are actually punning
it this way.)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|