Otherwise the directory {a,m,c} times will be modified by the recursive
copy of the directory tree.
Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The copy_data function takes a start and an end parameter as the range
of bytes to copy, but it was called with a start and a length parameter.
This resulted in incomplete file copies. Fix it by passing the end of
the range instead of the length.
Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This kernel commit: 65bd442397274347e721a89c2c4882a392bae982 removes
BTREE_ITER_cached from bch2_btree_insert_trans, which causes the
update_inode function to take a long time (~20s). Add this flag back in
the update_inode function.
Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Add a new source command line argument which specifies the directory
tree that will be copied onto the newly formatted bcachefs filesystem.
This commit also fixes an issue in copy_link where uninitialized data is
copied into the symlink because of a round_up of the buffer size.
Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
`bch2_sb_is_encrypted_and_locked()` simply does not check if the fs is
locked. The name is misleading.
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
We're still having issues with corrupted dumps when we try to dump only
the live part of btree nodes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The error code is in errno, not the return value.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Without the single char (with ':' if optarg expected) only the long
argument string would successfully parse.
For example, now "-lasdf" parses the same as "--label asdf"
We need to check when stdin has been closed - otherwise we'll spin
because select() will return immediately.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
To avoid expensive version upgrades and downgrades - use the kernel
version of fsck when it's availale and a better match.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Similar to the same option with luks. Ofcourse,
one can simply wrap bcachefs tool with a script and expect,
but this is a nicer way of doing things.
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:
$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command
instead of "./bcachefs command".
Building and installing is still:
$ make && make install
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>