Skip to content
17 changes: 16 additions & 1 deletion Documentation/Feature-by-version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ features see :doc:`Status<Status>` page.
6.12 (stable)
-------------

-6.12 - cancellable discard/TRIM
6.12 - cancellable discard/TRIM
Add more points where the discard can be interrupted by signals before
it finishes the whole operation.

Expand Down Expand Up @@ -237,6 +237,9 @@ features see :doc:`Status<Status>` page.
The defrag ioctl also accepts the negative zstd levels that can be set as
mount option.

6.16 - *standalone mount option nologreplay removed*
Deprecated in 5.9 and replaced with *rescue=nologreplay*.

6.17 (latest)
-------------

Expand All @@ -261,6 +264,18 @@ features see :doc:`Status<Status>` page.
File holes, ranges not representing data, were emulated by a zero
filled data. This is less efficient than puching holes.

6.18 - *move rev-verify feature under CONFIG_BTRFS_DEBUG*
Config option CONFIG_BTRFS_FS_REF_VERIFY has been removed and the
debugging functionality of *ref-verify* moved under CONFIG_BTRFS_DEBUG.

6.18 - *new mount option ref_tracker for reference tracking*
A debugging feature to track references (now implemented for delayed
refs) and report leaks eventually.

6.18 - *experimental* enable block size > page size support
Initial support for *bs > ps* with limitations (no direct IO, raid56,
encoded read/write).

5.x
---

Expand Down
12 changes: 12 additions & 0 deletions Documentation/btrfs-replace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ start [options] <srcdev>|<devid> <targetdev> <path>
larger target device; this can be achieved with
``btrfs filesystem resize <devid>:max /path``

.. note::
Device replace can be interrupted by various events after v6.19 kernel,
including but not limited to power management suspend/hibernate,
filesystem freezing, cgroup freezing (utilized by systemd for slice freezing)
and pending signals.

The running device replace will be cancelled after such interruption, and
the end user needs to restart the device replace from the beginning.

Thus it's recommended to inhibit suspend/hiberate before executing the
device replace operation.

``Options``

-r
Expand Down
8 changes: 8 additions & 0 deletions Documentation/ch-scrub-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ read-write mounted filesystem.
To avoid any writes from scrub, one has to run read-only scrub on read-only
filesystem.

.. note::
Scrub can be interrupted by various events after v6.19 kernel, including
but not limited to power management suspend/hibernate, filesystem freezing,
cgroup freezing (utilized by systemd for slice freezing) and pending signals.

The running scrub will be cancelled after such interruption, and can be resumed
by :command:`btrfs scrub resume` command.

The user is supposed to run it manually or via a periodic system service. The
recommended period is a month but it could be less. The estimated device bandwidth
utilization is about 80% on an idle filesystem.
Expand Down
2 changes: 1 addition & 1 deletion btrfs-find-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void print_find_root_result(struct cache_tree *result,
}

static const char * const btrfs_find_root_usage[] = {
"btrfs-find-usage [options] <device>",
"btrfs-find-root [options] <device>",
"Attempt to find tree roots on the device",
"",
OPTLINE("-a", "search through all metadata even if the root has been found"),
Expand Down
13 changes: 3 additions & 10 deletions check/qgroup-verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void qgroup_set_item_count_ptr(u64 *item_count_ptr)
qgroup_item_count = item_count_ptr;
}

/*#define QGROUP_VERIFY_DEBUG*/
static unsigned long tot_extents_scanned = 0;

static struct qgroup_count *find_count(u64 qgroupid);
Expand Down Expand Up @@ -157,15 +156,14 @@ struct ref {
struct rb_node bytenr_node;
};

#ifdef QGROUP_VERIFY_DEBUG
static void print_ref(struct ref *ref)
{
printf("bytenr: %llu\t\tnum_bytes: %llu\t\t parent: %llu\t\t"
"root: %llu\n", ref->bytenr, ref->num_bytes,
ref->parent, ref->root);
}

static void print_all_refs(void)
static void __maybe_unused print_all_refs(void)
{
unsigned long count = 0;
struct ref *ref;
Expand All @@ -184,7 +182,6 @@ static void print_all_refs(void)
printf("%lu extents scanned with %lu refs in total.\n",
tot_extents_scanned, count);
}
#endif

/*
* Store by bytenr in rbtree
Expand Down Expand Up @@ -490,14 +487,12 @@ static int account_one_extent(struct ulist *roots, u64 bytenr, u64 num_bytes)
count->info.exclusive_compressed += num_bytes;
}
}
#ifdef QGROUP_VERIFY_DEBUG
printf("account (%llu, %llu), qgroup %llu/%llu, rfer %llu,"
pr_verbose(LOG_DEBUG, "account (%llu, %llu), qgroup %u/%llu, rfer %llu,"
" excl %llu, refs %llu, roots %llu\n", bytenr, num_bytes,
btrfs_qgroup_level(count->qgroupid),
btrfs_qgroup_subvolid(count->qgroupid),
count->info.referenced, count->info.exclusive, nr_refs,
nr_roots);
#endif
}

inc_qgroup_seq(roots->nnodes);
Expand Down Expand Up @@ -636,7 +631,6 @@ static void free_tree_blocks(void)
tree_blocks = NULL;
}

#ifdef QGROUP_VERIFY_DEBUG
static void print_tree_block(u64 bytenr, struct tree_block *block)
{
struct ref *ref;
Expand All @@ -656,7 +650,7 @@ static void print_tree_block(u64 bytenr, struct tree_block *block)
printf("\n");
}

static void print_all_tree_blocks(void)
static void __maybe_unused print_all_tree_blocks(void)
{
struct ulist_iterator uiter;
struct ulist_node *unode;
Expand All @@ -670,7 +664,6 @@ static void print_all_tree_blocks(void)
while ((unode = ulist_next(tree_blocks, &uiter)))
print_tree_block(unode_bytenr(unode), unode_tree_block(unode));
}
#endif

static int add_refs_for_leaf_items(struct extent_buffer *eb, u64 ref_parent)
{
Expand Down
6 changes: 3 additions & 3 deletions common/parse-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int parse_u64(const char *str, u64 *result)
* Returned values are u64, value validation and interpretation should be done
* by the caller.
*/
int parse_range(const char *range, u64 *start, u64 *end)
int parse_range_u64(const char *range, u64 *start, u64 *end)
{
char *dots;
char *endptr;
Expand Down Expand Up @@ -135,7 +135,7 @@ int parse_range_u32(const char *range, u32 *start, u32 *end)
u64 tmp_start;
u64 tmp_end;

if (parse_range(range, &tmp_start, &tmp_end))
if (parse_range_u64(range, &tmp_start, &tmp_end))
return 1;

if (range_to_u32(tmp_start, tmp_end, start, end))
Expand All @@ -150,7 +150,7 @@ int parse_range_u32(const char *range, u32 *start, u32 *end)
*/
int parse_range_strict(const char *range, u64 *start, u64 *end)
{
if (parse_range(range, start, end) == 0) {
if (parse_range_u64(range, start, end) == 0) {
if (*start >= *end) {
error("range %llu..%llu not allowed", *start, *end);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion common/parse-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum btrfs_csum_type parse_csum_type(const char *s);
int parse_u64(const char *str, u64 *result);
int parse_u64_with_suffix(const char *s, u64 *value_ret);
int parse_range_u32(const char *range, u32 *start, u32 *end);
int parse_range(const char *range, u64 *start, u64 *end);
int parse_range_u64(const char *range, u64 *start, u64 *end);
int parse_range_strict(const char *range, u64 *start, u64 *end);
int parse_bg_profile(const char *profile, u64 *flags);
int parse_compress_type(const char *type);
Expand Down
3 changes: 1 addition & 2 deletions convert/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,7 @@ static int make_convert_data_block_groups(struct btrfs_trans_handle *trans,
u64 cur_backup = cur;

len = min(max_chunk_size,
round_up(cache->start + cache->size,
BTRFS_STRIPE_LEN) - cur);
cache->start + cache->size - cur);
ret = btrfs_alloc_data_chunk(trans, fs_info, &cur_backup, len);
if (ret < 0)
break;
Expand Down
Loading