Skip to content

Commit 6ceb634

Browse files
committed
Merge tag 'for-6.14-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/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()
2 parents 381af8d + 35d99c6 commit 6ceb634

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

fs/btrfs/inode.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,13 @@ static noinline int cow_file_range(struct btrfs_inode *inode,
13821382
continue;
13831383
}
13841384
if (done_offset) {
1385-
*done_offset = start - 1;
1386-
return 0;
1385+
/*
1386+
* Move @end to the end of the processed range,
1387+
* and exit the loop to unlock the processed extents.
1388+
*/
1389+
end = start - 1;
1390+
ret = 0;
1391+
break;
13871392
}
13881393
ret = -ENOSPC;
13891394
}

fs/btrfs/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,13 +1330,13 @@ MODULE_PARM_DESC(read_policy,
13301330

13311331
int btrfs_read_policy_to_enum(const char *str, s64 *value_ret)
13321332
{
1333-
char param[32] = { 0 };
1333+
char param[32];
13341334
char __maybe_unused *value_str;
13351335

13361336
if (!str || strlen(str) == 0)
13371337
return 0;
13381338

1339-
strncpy(param, str, sizeof(param) - 1);
1339+
strscpy(param, str);
13401340

13411341
#ifdef CONFIG_BTRFS_EXPERIMENTAL
13421342
/* Separate value from input in policy:value format. */

fs/btrfs/volumes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7155,6 +7155,7 @@ static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf,
71557155
btrfs_err(fs_info,
71567156
"failed to add chunk map, start=%llu len=%llu: %d",
71577157
map->start, map->chunk_len, ret);
7158+
btrfs_free_chunk_map(map);
71587159
}
71597160

71607161
return ret;

0 commit comments

Comments
 (0)