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@linux.dev>2023-10-22 17:08:23 -0400
commit3e669816904d45d48ef2183a2ad675c24d9c941a (patch)
tree65c2422eca56b6a7bc0ee17963088b5efbb3a76c /fs/bcachefs/io.c
parent66b095b008ea6526c660fbecfacbd970416f971e (diff)
downloadlwn-3e669816904d45d48ef2183a2ad675c24d9c941a.tar.gz
lwn-3e669816904d45d48ef2183a2ad675c24d9c941a.zip
bcachefs: Fix promoting to cache devices (durability = 0)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
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 11cdaddb1551..9cd9bbc5cce4 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1013,23 +1013,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))