Commit 69d46f90 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: fix an rcu usage bug

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a36d3685
...@@ -967,6 +967,7 @@ void bch2_write(struct closure *cl) ...@@ -967,6 +967,7 @@ void bch2_write(struct closure *cl)
struct promote_op { struct promote_op {
struct closure cl; struct closure cl;
struct rcu_head rcu;
u64 start_time; u64 start_time;
struct rhash_head hash; struct rhash_head hash;
...@@ -1020,7 +1021,7 @@ static void promote_free(struct bch_fs *c, struct promote_op *op) ...@@ -1020,7 +1021,7 @@ static void promote_free(struct bch_fs *c, struct promote_op *op)
bch_promote_params); bch_promote_params);
BUG_ON(ret); BUG_ON(ret);
percpu_ref_put(&c->writes); percpu_ref_put(&c->writes);
kfree(op); kfree_rcu(op, rcu);
} }
static void promote_done(struct closure *cl) static void promote_done(struct closure *cl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment