summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/extents.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-10-28 23:43:16 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-12-21 01:36:17 -0500
commit61f854da4cba9708dd54f45b0e19ded6ffd10d01 (patch)
tree1e2ac3c0e1fc64f62c1f847f032d7ad4c430ab0a /fs/bcachefs/extents.c
parentbcachefs: Kill FSCK_NEED_FSCK (diff)
downloadlinux-61f854da4cba9708dd54f45b0e19ded6ffd10d01.tar.gz
linux-61f854da4cba9708dd54f45b0e19ded6ffd10d01.zip
bcachefs: Reserve 8 bits in bch_reflink_p
Better repair for reflink pointers, as well as propagating new inode options to indirect extents, are going to require a few extra bits bch_reflink_p: so claim a few from the high end of the destination index. Also add some missing bounds checking. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r--fs/bcachefs/extents.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index bc7cfdb66687..98bb680b3860 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1495,7 +1495,7 @@ int bch2_cut_front_s(struct bpos where, struct bkey_s k)
case KEY_TYPE_reflink_p: {
struct bkey_s_reflink_p p = bkey_s_to_reflink_p(k);
- le64_add_cpu(&p.v->idx, sub);
+ SET_REFLINK_P_IDX(p.v, REFLINK_P_IDX(p.v) + sub);
break;
}
case KEY_TYPE_inline_data: