diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-09 08:27:30 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-09 09:14:11 -0900 |
commit | ac1b32acb4ca8c59c0e4911a8d3b27fd72dc54af (patch) | |
tree | e73a6ea5ddb6f3ece6a3e6c069ffa9ecc5e1ee44 /libbcache/extents.c | |
parent | a17f7bcec7ed810a247c24e56229af8f43a9a6ae (diff) |
cmd_device_fail
Add a comamnd for setting a device as failed, update bcache sources
Diffstat (limited to 'libbcache/extents.c')
-rw-r--r-- | libbcache/extents.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libbcache/extents.c b/libbcache/extents.c index c5e0e375..af3d031a 100644 --- a/libbcache/extents.c +++ b/libbcache/extents.c @@ -622,6 +622,9 @@ bch_btree_pick_ptr(struct cache_set *c, const struct btree *b) PTR_BUCKET_NR(ca, ptr))) continue; + if (ca->mi.state == BCH_MEMBER_STATE_FAILED) + continue; + if (pick.ca && pick.ca->mi.tier < ca->mi.tier) continue; @@ -938,7 +941,7 @@ struct extent_insert_state { struct btree_insert *trans; struct btree_insert_entry *insert; struct bpos committed; - struct bucket_stats_cache_set stats; + struct bch_fs_usage stats; /* for deleting: */ struct bkey_i whiteout; @@ -2202,6 +2205,9 @@ void bch_extent_pick_ptr_avoiding(struct cache_set *c, struct bkey_s_c k, if (ptr_stale(ca, ptr)) continue; + if (ca->mi.state == BCH_MEMBER_STATE_FAILED) + continue; + if (ret->ca && (ca == avoid || ret->ca->mi.tier < ca->mi.tier)) |