diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-28 16:32:53 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-28 16:32:53 -0400 |
commit | fd249e130f2c7f1e8e13b8d240f8c4ad9a43ed0a (patch) | |
tree | 901988996a3b6fde6a1997a31f07b88cbae29ef5 /libbcachefs/util.h | |
parent | c5183ea57fc75205ea9d363cac4c5d6e4bb7cf38 (diff) |
Update bcachefs sources to bba7493dda bcachefs: Fix error path in bch2_snapshot_set_equiv()
Diffstat (limited to 'libbcachefs/util.h')
-rw-r--r-- | libbcachefs/util.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbcachefs/util.h b/libbcachefs/util.h index d6d7f1bc..88869370 100644 --- a/libbcachefs/util.h +++ b/libbcachefs/util.h @@ -210,9 +210,11 @@ do { \ \ BUG_ON(_i >= (h)->used); \ (h)->used--; \ - heap_swap(h, _i, (h)->used, set_backpointer); \ - heap_sift_up(h, _i, cmp, set_backpointer); \ - heap_sift_down(h, _i, cmp, set_backpointer); \ + if ((_i) < (h)->used) { \ + heap_swap(h, _i, (h)->used, set_backpointer); \ + heap_sift_up(h, _i, cmp, set_backpointer); \ + heap_sift_down(h, _i, cmp, set_backpointer); \ + } \ } while (0) #define heap_pop(h, d, cmp, set_backpointer) \ @@ -282,7 +284,8 @@ static inline size_t printbuf_linelen(struct printbuf *buf) return buf->pos - buf->last_newline; } -void bch2_pr_buf(struct printbuf *out, const char *fmt, ...); +void bch2_pr_buf(struct printbuf *out, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); #define pr_buf(_out, ...) bch2_pr_buf(_out, __VA_ARGS__) |