Skip to content

Commit

Permalink
Merge tag 'for-6.14-rc5-tag' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/kdave/linux

Pull btrfs fixes from David Sterba:

 - fix leaked extent map after error when reading chunks

 - replace use of deprecated strncpy

 - in zoned mode, fixed range when ulocking extent range, causing a hang

* tag 'for-6.14-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: fix a leaked chunk map issue in read_one_chunk()
  btrfs: replace deprecated strncpy() with strscpy()
  btrfs: zoned: fix extent range end unlock in cow_file_range()
  • Loading branch information
Linus Torvalds committed Mar 7, 2025
2 parents 381af8d + 35d99c6 commit 6ceb634
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,8 +1382,13 @@ static noinline int cow_file_range(struct btrfs_inode *inode,
continue;
}
if (done_offset) {
*done_offset = start - 1;
return 0;
/*
* Move @end to the end of the processed range,
* and exit the loop to unlock the processed extents.
*/
end = start - 1;
ret = 0;
break;
}
ret = -ENOSPC;
}
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,13 +1330,13 @@ MODULE_PARM_DESC(read_policy,

int btrfs_read_policy_to_enum(const char *str, s64 *value_ret)
{
char param[32] = { 0 };
char param[32];
char __maybe_unused *value_str;

if (!str || strlen(str) == 0)
return 0;

strncpy(param, str, sizeof(param) - 1);
strscpy(param, str);

#ifdef CONFIG_BTRFS_EXPERIMENTAL
/* Separate value from input in policy:value format. */
Expand Down
1 change: 1 addition & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -7155,6 +7155,7 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf,
btrfs_err(fs_info,
"failed to add chunk map, start=%llu len=%llu: %d",
map->start, map->chunk_len, ret);
btrfs_free_chunk_map(map);
}

return ret;
Expand Down

0 comments on commit 6ceb634

Please sign in to comment.