summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-06-10 11:31:07 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-06-10 11:34:21 -0400
commit98ce6c3477743ee65f1816168bd28f0c247b8e26 (patch)
tree8e7ed43505c9e731daa27bcd9876824bd1276ed4 /fs/bcachefs/io.c
parent0dfe3030cb29c317d926350c1b184903f1803680 (diff)
bcachefs: Fix promoting to cache devices (durability = 0)bcachefs-v5.0
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r--fs/bcachefs/io.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index dc922a9140b1..72a7dfe239a8 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1003,23 +1003,23 @@ static inline bool should_promote(struct bch_fs *c, struct bkey_s_c k,
struct bch_io_opts opts,
unsigned flags)
{
- if (!opts.promote_target)
+ if (!bkey_extent_is_data(k.k))
return false;
if (!(flags & BCH_READ_MAY_PROMOTE))
return false;
- if (percpu_ref_is_dying(&c->writes))
- return false;
-
- if (!bkey_extent_is_data(k.k))
+ if (!opts.promote_target)
return false;
- if (bch2_extent_has_target(c, bkey_s_c_to_extent(k), opts.promote_target))
+ if (bch2_extent_has_target(c, bkey_s_c_to_extent(k),
+ opts.promote_target))
return false;
- if (bch2_target_congested(c, opts.promote_target))
+ if (bch2_target_congested(c, opts.promote_target)) {
+ /* XXX trace this */
return false;
+ }
if (rhashtable_lookup_fast(&c->promote_table, &pos,
bch_promote_params))