diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-11-20 13:27:20 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:40:55 -0900 |
commit | 3b7e1e76b21a624c8819513c89df4b48e74e6dcd (patch) | |
tree | b4fd5e6b1eca8a84258a749659a7999627b9ef4a | |
parent | b592adae93add7b0339a8dfd193cbb9cfe87bfb4 (diff) |
bcache: fix an integer conversion issue
this was found when deleting a large persistent reservation - U32_MAX
(max key size) doesn't fit in a signed int
-rw-r--r-- | drivers/md/bcache/buckets.c | 12 | ||||
-rw-r--r-- | drivers/md/bcache/buckets.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/bcache/buckets.c b/drivers/md/bcache/buckets.c index 18ce58934f9e..254349450f13 100644 --- a/drivers/md/bcache/buckets.c +++ b/drivers/md/bcache/buckets.c @@ -395,7 +395,7 @@ static void bch_mark_pointer(struct cache_set *c, struct cache *ca, const union bch_extent_crc *crc, const struct bch_extent_ptr *ptr, - int sectors, enum s_alloc type, + s64 sectors, enum s_alloc type, bool may_make_unavailable, struct bucket_stats_cache_set *stats, bool is_gc, struct gc_pos gc_pos) @@ -497,7 +497,7 @@ out: } static void bch_mark_extent(struct cache_set *c, struct bkey_s_c_extent e, - int sectors, bool metadata, + s64 sectors, bool metadata, bool may_make_unavailable, struct bucket_stats_cache_set *stats, bool is_gc, struct gc_pos gc_pos) @@ -525,7 +525,7 @@ static void bch_mark_extent(struct cache_set *c, struct bkey_s_c_extent e, } static void __bch_mark_key(struct cache_set *c, struct bkey_s_c k, - int sectors, bool metadata, + s64 sectors, bool metadata, bool may_make_unavailable, struct bucket_stats_cache_set *stats, bool is_gc, struct gc_pos gc_pos) @@ -543,14 +543,14 @@ static void __bch_mark_key(struct cache_set *c, struct bkey_s_c k, } void __bch_gc_mark_key(struct cache_set *c, struct bkey_s_c k, - int sectors, bool metadata, + s64 sectors, bool metadata, struct bucket_stats_cache_set *stats) { __bch_mark_key(c, k, sectors, metadata, true, stats, true, GC_POS_MIN); } void bch_gc_mark_key(struct cache_set *c, struct bkey_s_c k, - int sectors, bool metadata) + s64 sectors, bool metadata) { struct bucket_stats_cache_set stats = { 0 }; @@ -562,7 +562,7 @@ void bch_gc_mark_key(struct cache_set *c, struct bkey_s_c k, } void bch_mark_key(struct cache_set *c, struct bkey_s_c k, - int sectors, bool metadata, struct gc_pos gc_pos, + s64 sectors, bool metadata, struct gc_pos gc_pos, struct bucket_stats_cache_set *stats) { lg_local_lock(&c->bucket_stats_lock); diff --git a/drivers/md/bcache/buckets.h b/drivers/md/bcache/buckets.h index 0219c5c07487..277085e152eb 100644 --- a/drivers/md/bcache/buckets.h +++ b/drivers/md/bcache/buckets.h @@ -236,10 +236,10 @@ void bch_mark_alloc_bucket(struct cache *, struct bucket *); void bch_mark_metadata_bucket(struct cache *, struct bucket *, bool); void bch_unmark_open_bucket(struct cache *, struct bucket *); -void __bch_gc_mark_key(struct cache_set *, struct bkey_s_c, int, bool, +void __bch_gc_mark_key(struct cache_set *, struct bkey_s_c, s64, bool, struct bucket_stats_cache_set *); -void bch_gc_mark_key(struct cache_set *, struct bkey_s_c, int, bool); -void bch_mark_key(struct cache_set *, struct bkey_s_c, int, bool, +void bch_gc_mark_key(struct cache_set *, struct bkey_s_c, s64, bool); +void bch_mark_key(struct cache_set *, struct bkey_s_c, s64, bool, struct gc_pos, struct bucket_stats_cache_set *); void bch_recalc_sectors_available(struct cache_set *); |