Commit 6ceb6346 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents 381af8d9 35d99c68
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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;
		}
+2 −2
Original line number Diff line number Diff line
@@ -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. */
+1 −0
Original line number Diff line number Diff line
@@ -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;