summaryrefslogtreecommitdiff
path: root/fs/bcachefs/extents.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-09-07 23:13:20 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:26 +0300
commit8d84260ec1b11c20a7f01797b34fcbc12b33fd70 (patch)
tree6d49bf909d600e0f4ad8feaa52407c3c4083925c /fs/bcachefs/extents.h
parentb50dd7920d1cd7b37016929faa175578de12dd27 (diff)
downloadlinux-8d84260ec1b11c20a7f01797b34fcbc12b33fd70.tar.xz
bcachefs: data move path should not be trying to move reflink_p keys
This was spotted when the move_extent() path tried to allocate a bio for a reflink_p extent, but adding pages to the bio failed because we overflowed bi_max_vecs. Oops. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.h')
-rw-r--r--fs/bcachefs/extents.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 4c4a7945a751..766584939304 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -455,12 +455,11 @@ unsigned bch2_extent_is_compressed(struct bkey_s_c);
bool bch2_bkey_matches_ptr(struct bch_fs *, struct bkey_s_c,
struct bch_extent_ptr, u64);
-static inline bool bkey_extent_is_data(const struct bkey *k)
+static inline bool bkey_extent_is_direct_data(const struct bkey *k)
{
switch (k->type) {
case KEY_TYPE_btree_ptr:
case KEY_TYPE_extent:
- case KEY_TYPE_reflink_p:
case KEY_TYPE_reflink_v:
return true;
default:
@@ -468,6 +467,12 @@ static inline bool bkey_extent_is_data(const struct bkey *k)
}
}
+static inline bool bkey_extent_is_data(const struct bkey *k)
+{
+ return bkey_extent_is_direct_data(k) ||
+ k->type == KEY_TYPE_reflink_p;
+}
+
/*
* Should extent be counted under inode->i_sectors?
*/