diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-02 02:43:58 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-04 16:04:55 -0500 |
commit | 131898b0cb4ac6598d3537eeeee2711dec129f51 (patch) | |
tree | b52ac8cdb669b69a467671049f4e9d5ea67e68fb /fs/bcachefs/data_update.c | |
parent | 87b0d8d3d05028c59b64c0287efeca90c28e1152 (diff) | |
download | linux-131898b0cb4ac6598d3537eeeee2711dec129f51.tar.gz linux-131898b0cb4ac6598d3537eeeee2711dec129f51.tar.bz2 linux-131898b0cb4ac6598d3537eeeee2711dec129f51.zip |
bcachefs: Fix bch2_extent_drop_ptrs() call
Also, make bch2_extent_drop_ptrs() safer, so it works with extents and
non-extents iterators.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r-- | fs/bcachefs/data_update.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c index 71aa5e59787b..2418c528c533 100644 --- a/fs/bcachefs/data_update.c +++ b/fs/bcachefs/data_update.c @@ -471,7 +471,7 @@ int bch2_extent_drop_ptrs(struct btree_trans *trans, * we aren't using the extent overwrite path to delete, we're * just using the normal key deletion path: */ - if (bkey_deleted(&n->k)) + if (bkey_deleted(&n->k) && !(iter->flags & BTREE_ITER_IS_EXTENTS)) n->k.size = 0; return bch2_trans_relock(trans) ?: @@ -591,7 +591,7 @@ int bch2_data_update_init(struct btree_trans *trans, m->data_opts.rewrite_ptrs = 0; /* if iter == NULL, it's just a promote */ if (iter) - ret = bch2_extent_drop_ptrs(trans, iter, k, data_opts); + ret = bch2_extent_drop_ptrs(trans, iter, k, m->data_opts); goto done; } |