diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-06 20:47:31 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:10:16 +0300 |
commit | 88d39fd544d44e1243668eb192ff1cc5cdc2d770 (patch) | |
tree | 4dedce1097cff7f9a5ca0b9534ec5c7b86d43d65 /fs/bcachefs/extents.h | |
parent | c2d81c24123361e5092c88e67d790097308c5b95 (diff) | |
download | linux-88d39fd544d44e1243668eb192ff1cc5cdc2d770.tar.xz |
bcachefs: Switch to unsafe_memcpy() in a few places
The new fortify checking doesn't work for us in all places; this
switches to unsafe_memcpy() where appropriate to silence a few
warnings/errors.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.h')
-rw-r--r-- | fs/bcachefs/extents.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h index 7ee8d031bb6c..db1863165d62 100644 --- a/fs/bcachefs/extents.h +++ b/fs/bcachefs/extents.h @@ -642,9 +642,11 @@ static inline void bch2_bkey_append_ptr(struct bkey_i *k, struct bch_extent_ptr ptr.type = 1 << BCH_EXTENT_ENTRY_ptr; - memcpy((void *) &k->v + bkey_val_bytes(&k->k), - &ptr, - sizeof(ptr)); + unsafe_memcpy((void *) &k->v + bkey_val_bytes(&k->k), + &ptr, + sizeof(ptr), + "Our memcpy target is relative to a zero size array ," + "compiler bounds checking doesn't work here"); k->k.u64s++; break; default: |