id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
3826ee0b17557e85813378be5a5a695baf607c1c | Analyze and fix the following issue in the Linux kernel code: bcachefs: Add a lock to bch_page_state | Problem Details:
We can't use the page lock to protect it, because on writeback IO error
we need to access the page state before calling end_page_writeback() and
the page lock semantics are completely insane so that deadlocks.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 90587a556cee..0756b11ae3e4 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -468,6 +468,7 @@ struct bch_page_sector {
};
struct bch_page_state {
+ spinlock_t lock;
atomic_t write_count;
struct bch_page_sector s[PAGE_SECTORS];
}... |
43de7376f36c236255b7daf88e8286720426568b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix erasure coding disk space accounting | Problem Details:
Disk space accounting for erasure coding + compression was completely
broken - we need to calculate the parity sectors delta the same way we
calculate disk_sectors, by calculating the old and new usage and
subtracting to get the difference.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index dc184de053ee..d4d66d78d2a3 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -807,28 +807,44 @@ void bch2_mark_metadata_bucket(struct bch_fs *c, struct bch_dev *ca,
preempt_enable();
}
-static s64 ptr_disk_sectors_delta(struct... |
9ec211b0ff4019407d029c49099f24dfedbc4db1 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix ec_stripes_read() | Problem Details:
The bkey_s_c returned by btree_iter_(peek|next) points into the btree
iter type, so advancing the iterator and then using the one previously
returned is a bug...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index eb6d712e7844..6ba830583846 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -1510,14 +1510,14 @@ LE32_BITMASK(JSET_BIG_ENDIAN, struct jset, flags, 4, 5);
/* Btree: */
-#define BCH_BTREE_IDS() ... |
9ef6068c4dce124235b335847570ae8f2bf2911d | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_extent_ptr_durability() | Problem Details:
We were looking up the wrong entry in the stripes radix tree.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 41a2b36f1d2f..a8c2081cdd25 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -79,7 +79,7 @@ static unsigned bch2_extent_ptr_durability(struct bch_fs *c,
for (i = 0; i < p.ec_nr; i++) {
struct stripe *s =
- genradix_ptr(&c-... |
332c6e5370717fe28776b7427806043c22a81f69 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_mark_extent() | Problem Details:
If an extent only contained cached or erasure coded pointers, there
won't be any devices in the normal dirty replicas list or an entry to
update.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 5e0e699c679a..9beb4d4cf85d 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1063,7 +1063,8 @@ static int bch2_mark_extent(struct bch_fs *c, struct bkey_s_c k,
}
}
- update_replicas(c, fs_usage, &r.e, dirty_sectors);
+ if (... |
f7c0fcdd396ff4bd3175000eb3911f75edbc85c5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix uninitialized data in bch2_gc_btree() | Problem Details:
Running the filesystem under valgrind exposed a path where the max_stale
variable in bch2_gc_btree() might not be initialized before use in a
rare case when there are no btree nodes in a transaction.
Signed-off-by: Justin Husted <sigstop@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux... | ```diff
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index f8485fba55e2..f7d9abfdb3de 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -218,7 +218,7 @@ static int bch2_gc_btree(struct bch_fs *c, enum btree_id btree_id,
: expensive_debug_checks(c) ? 0
: !btree_node_type_needs_gc... |
a40d97a771387362dd272608ed2df0a1fd39343e | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix incorrect use of bch2_extent_atomic_end() | Problem Details:
bch2_extent_atomic_end counts the number of iterators requried for
marking overwrites - but journal replay never marks overwrites, so that
part was incorrect. And counting iterators for the key being inserted
should be unnecessary because we did that prior to the key being
inserted before it was first ... | ```diff
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 97c0d7d1fe77..095eef3828ce 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -268,10 +268,12 @@ retry:
BTREE_ITER_INTENT);
do {
- ret = bch2_extent_atomic_end(iter, k, &atomic_end);
+ ret = bch2_btree_iter_travers... |
137b0ed907f1c0a5036288fa340685f55fb37754 | Analyze and fix the following issue in the Linux kernel code: bcachefs: bch2_extent_atomic_end() now traverses iter | Problem Details:
This fixes a bug in io.c bch2_write_index_default() - it was missing the
traverse call, but bch2_extent_atomic_end returns an error now and can
just call it itself.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index db32d9eaa3dc..41a2b36f1d2f 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1010,13 +1010,19 @@ int bch2_extent_atomic_end(struct btree_iter *iter,
struct bpos *end)
{
struct btree_trans *trans = iter->trans;
- struct b... |
d65a8551c822030e1214bcffbcb181d4878414b5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix deref of error pointer | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h
index 31e55acbbead..a81fc3596fc1 100644
--- a/fs/bcachefs/str_hash.h
+++ b/fs/bcachefs/str_hash.h
@@ -251,9 +251,10 @@ int bch2_hash_set(struct btree_trans *trans,
if (!ret)
ret = -ENOSPC;
out:
- if (slot)
+ if (!IS_ERR_OR_NULL(slot))
bch2_tr... |
618b9e575b40c862a62764043c961646f3ebc6dc | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix undefined behaviour | Problem Details:
roundup_pow_of_two(0) is undefined
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 155e7c9bd89f..424d5cf48893 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -1351,6 +1351,9 @@ int bch2_ec_mem_alloc(struct bch_fs *c, bool gc)
if (ret)
return ret;
+ if (!idx)
+ return 0;
+
if (!gc &&
!init_heap(&c->ec_stripes_heap, ... |
ab9ff73322aad5cf6ea774047e47ef724077399b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix an error path | Problem Details:
It's possible to get -EIO in __btree_iter_traverse_all() after looping,
with orig_iter NULL.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 8e9164aee409..78bc82c7b9c3 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1010,8 +1010,11 @@ retry_all:
if (unlikely(ret == -EIO)) {
trans->error = true;
- orig_iter->flags |= BTREE_ITER_ERROR;
- orig_iter-... |
8de819f83446dcdedae572ccc7449e3fa90b2c20 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix __bch2_buffered_write() returning -ENOMEM | Problem Details:
When grab_cache_page_write_begin() fails but we did pin some pages, we
shouldn't return -ENOMEM, we should do a partial write.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 13e7b7842367..be121b755fc7 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -1606,8 +1606,13 @@ static int __bch2_buffered_write(struct bch_inode_info *inode,
pages[i] = grab_cache_page_write_begin(mapping, index + i);
if (!pages[i]... |
21ad9ddee8d1ffc1e12ab7e6b2ec18f0897fe567 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix counting iterators for reflink pointers | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 35abcde4bca2..db32d9eaa3dc 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -952,7 +952,7 @@ static int count_iters_for_insert(struct btree_trans *trans,
if (*nr_iters >= max_iters) {
*end = bpos_min(*end, k.k->p);
- re... |
64bc00115335450c4178fea04c5b664cf73a9729 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Rework btree iterator lifetimes | Problem Details:
The btree_trans struct needs to memoize/cache btree iterators, so that
on transaction restart we don't have to completely redo btree lookups,
and so that we can do them all at once in the correct order when the
transaction had to restart to avoid a deadlock.
This switches the btree iterator lookups to... | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 0439c5b07f61..8e9164aee409 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1730,15 +1730,6 @@ static inline void bch2_btree_iter_init(struct btree_trans *trans,
/* new transactional stuff: */
-int bch2_trans_ite... |
877dfb348d90abc3d7464ee37240f21d9bdff630 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix for partial buffered writes | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 791e72ce1c29..18356cbe0794 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -756,8 +756,8 @@ static void bch2_set_page_dirty(struct bch_fs *c,
struct bch_page_state *s = bch2_page_state(page);
unsigned i, dirty_sectors = 0;
- WARN_O... |
fb472ac52811e8a50e035807b94e1c29ec1f3395 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Convert a BUG_ON() to a warning | Problem Details:
We shouldn't ever be writing past i_size - but, apparently there's still
a bug to track down.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 2d7bab51b320..e3f1d1dd06ae 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -757,6 +757,9 @@ static void bch2_set_page_dirty(struct bch_fs *c,
struct bch_page_state *s = bch2_page_state(page);
unsigned i, dirty_sectors = 0;
+ WARN_O... |
eab32c8e4e8a3addcea0884acdb5bbe4cdb66c5a | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix validation of replicas entries | Problem Details:
When an extent is erasure coded, we need to record a replicas entry to
indicate that data is present on the devices that extent has pointers to
- but nr_required should be 0, because it's erasure coded.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/replicas.c b/fs/bcachefs/replicas.c
index 64024ce01665..afd226f3c8e7 100644
--- a/fs/bcachefs/replicas.c
+++ b/fs/bcachefs/replicas.c
@@ -16,11 +16,16 @@ static inline int u8_cmp(u8 l, u8 r)
return cmp_int(l, r);
}
-static void verify_replicas_entry_sorted(struct bch_replicas_entry... |
059e4134d26a3ada46dc29a849c8cfa5e0b7fd42 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Debug assertion improvements | Problem Details:
Call bch2_btree_iter_verify from bch2_btree_node_iter_fix(); also verify
in btree_iter_peek_uptodate() that iter->k matches what's in the btree.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index b5dace40534c..f64cf78d68fa 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -542,14 +542,14 @@ static void __bch2_btree_node_iter_fix(struct btree_iter *iter,
goto fixup_done;
} else {
/* Iterator is after key ... |
554d219ebb3420d21b395e1ca018ed74524b5480 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Add missing bch2_btree_node_iter_fix() call | Problem Details:
Any time we're modifying what's in the btree, iterators potentially have
to be updated - this one was exposed by the reflink code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 007d772d6e8f..d97d80859d1b 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -183,9 +183,8 @@ bool bch2_btree_bset_insert_key(struct btree_iter *iter,
clobber_u64s = 0;
overwrite:
bch2_b... |
4d13e818f5c00ae064aefba8349383cc2d79bf6d | Analyze and fix the following issue in the Linux kernel code: bcachefs: Avoid deadlocking on the allocator | Problem Details:
The allocator needs to make sure there's buckets available on the
RESERVE_NONE freelist if at all possible - otherwise foreground IO will
get stuck.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 54051161eba7..85795b580892 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1164,7 +1164,7 @@ static int bch2_allocator_thread(void *arg)
*/
if (!nr ||
(nr < ALLOC_SCAN_BATCH(c... |
a9d1f9101832fa1f495ab4b5b083d60eef55bd55 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Debug code improvements | Problem Details:
.key_debugcheck no longer needs to take a pointer to the btree node
Also, try to make sure wherever we're inserting or modifying keys in the
btree.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c
index 6fa6ac1fadc1..f01405dd502b 100644
--- a/fs/bcachefs/bkey_methods.c
+++ b/fs/bcachefs/bkey_methods.c
@@ -145,7 +145,7 @@ void bch2_bkey_debugcheck(struct bch_fs *c, struct btree *b, struct bkey_s_c k)
}
if (ops->key_debugcheck)
- o... |
4cac0bf2c25d9056c4cc24c27948774fa2591c5a | Analyze and fix the following issue in the Linux kernel code: bcachefs: Add missing bch2_btree_node_iter_fix() calls | Problem Details:
With multiple iterators, if another iterator points to the key being
modified, we need to call bch2_btree_node_iter_fix() to re-unpack the
key into the iter->k
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 1d400808d842..2cf97df6b85b 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1138,6 +1138,8 @@ extent_squash(struct bch_fs *c, struct btree_iter *iter,
__bch2_cut_front(insert->k.p, k);
BUG_ON(bkey_deleted(k.k));
extent_s... |
5a8a52d6107328d49b1fb9850ed53607cf41e583 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a typo | Problem Details:
_iter, not iter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 657359059a08..007d772d6e8f 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -34,7 +34,7 @@ static inline bool same_leaf_as_prev(struct btree_trans *trans,
}
#define trans_for_each_update... |
c0fc30dad5820b9e7d27355ec8a507f61d27a299 | Analyze and fix the following issue in the Linux kernel code: bcachefs: __bch2_btree_node_iter_fix() improvements | Problem Details:
Being more rigorous about noting when the key the iterator currently
poins to has changed - which should also give us a nice performance
improvement due to not having to check if we have to skip other bsets
backwards as much.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 17596aee23cc..44aa5231edd4 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -526,6 +526,10 @@ static void __bch2_btree_node_iter_fix(struct btree_iter *iter,
unsigned offset = __btree_node_key_to_offset(b, where);
... |
8d84260ec1b11c20a7f01797b34fcbc12b33fd70 | Analyze and fix the following issue in the Linux kernel code: bcachefs: data move path should not be trying to move reflink_p keys | Problem Details:
This was spotted when the move_extent() path tried to allocate a bio for
a reflink_p extent, but adding pages to the bio failed because we
overflowed bi_max_vecs. Oops.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 4c4a7945a751..766584939304 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -455,12 +455,11 @@ unsigned bch2_extent_is_compressed(struct bkey_s_c);
bool bch2_bkey_matches_ptr(struct bch_fs *, struct bkey_s_c,
struct bch_ex... |
b50dd7920d1cd7b37016929faa175578de12dd27 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a null ptr deref | Problem Details:
rbio->c wasn't being initialized in the move path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 844ae46cd7eb..b0bff54a18e2 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1218,10 +1218,15 @@ static inline struct bch_read_bio *bch2_rbio_free(struct bch_read_bio *rbio)
return rbio;
}
+/*
+ * Only called on a top level bch_read_bio to compl... |
78854fca28e4e789c99a812acda2ac04c20d2dac | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix BTREE_INSERT_NOMARK_OVERWRITES | Problem Details:
bch2_mark_update() was correct, but bch2_trans_mark_update() wasn't
respecting BTREE_INSERT_NOMARK_OVERWRITES - key marking/triggers really
need to be cleaned up.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index d732ec77e281..774201a1c0c5 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1762,6 +1762,9 @@ int bch2_trans_mark_update(struct btree_trans *trans,
if (ret)
return ret;
+ if (unlikely(trans->flags & BTREE_INSERT_NOMARK_OVE... |
05cf02b5a10ae9b60aad4b1fe4049eb4e7603b4f | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix fiemap (again) | Problem Details:
when iterating over reflink pointers, we use the key we just emitted to
set the iterator position - which means we have to be setting the key's
inode field as well
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index ffd9b386a14d..0ba498505b07 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1249,7 +1249,8 @@ retry:
offset_into_extent),
&cur.k);
bch2_key_resize(&cur.k.k, sectors);
- cur.k.k.p.offset = iter->pos.offset + cur.k.k.size;
+ ... |
9940a791ea24876d09116ac503045fb3390aebd2 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix error message on bucket overflow | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 189c475c973a..61df32cf9f5b 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1415,6 +1415,7 @@ static int bch2_trans_mark_pointer(struct btree_trans *trans,
struct bkey_s_c k;
struct bkey_alloc_unpacked u;
struct bkey_i_allo... |
df5d4dae0b667f93616d6e47da09ad916dcb7102 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fixes for replicas tracking | Problem Details:
The continue statement in bch2_trans_mark_extent() was wrong - by
bailing out early, we'd be constructing the wrong replicas list to
update. Also, the assertion in update_replicas() was wrong - due to
rounding with compressed extents, it is possible for sectors to be 0
sometimes.
Also, change extent_t... | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 625c6c5f7963..189c475c973a 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -520,7 +520,6 @@ static inline void update_replicas(struct bch_fs *c,
int idx = bch2_replicas_entry_idx(c, r);
BUG_ON(idx < 0);
- BUG_ON(!sectors);
... |
67163cded330c1d952ae440b21752f4b609585fd | Analyze and fix the following issue in the Linux kernel code: bcachefs: Trust in memory bucket mark | Problem Details:
This fixes a bug in the journal replay -> extent_replay_key ->
split_compressed path, when we do an update that changes alloc info but
the alloc info in the btree isn't up to date yet.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 5619dccdc011..c1158ce154c5 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -205,20 +205,6 @@ void bch2_alloc_to_text(struct printbuf *out, struct bch_fs *c,
get_alloc_field(a.v, &d, ... |
d9b022fee69e7f1eea45317c882c65582481a263 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a spurious gcc warning | Problem Details:
*i is used as an output parameter, but gcc isn't noticing that. Oh well.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 1e631dc8ff7c..66b12e55d946 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -857,7 +857,7 @@ int bch2_trans_commit(struct btree_trans *trans,
unsigned flags)
{
struct bch_fs *c =... |
4b0a66d508d7bfcd2dd2513d4f41a0f3a20f64d5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Check alignment in write path | Problem Details:
Also - fix alignment in bch2_set_page_dirty()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 771fb111550d..1873bbb9afda 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -684,8 +684,8 @@ static int bch2_page_reservation_get(struct bch_fs *c,
if (!s)
return -ENOMEM;
- for (i = offset / 512;
- i < DIV_ROUND_UP(offset + l... |
41fcd6215093b0c40fb4072e04a2b34f09eb4235 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix faulty assertion | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 3d243f2d1095..78d43830d0a7 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1483,8 +1483,6 @@ static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans,
s64 parity_sectors;
int ret = 0;
- BUG_ON(!sectors);
-
ret = t... |
f698a957979bfff266a65a2080a224cca7ccc962 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_bkey_narrow_crcs() | Problem Details:
We have to reinitialize ptrs whenever we do something that changes them.
Regression from when the code was converted to be generic across all
keys with pointers.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 779ee42350ad..f097bed684e5 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -454,6 +454,8 @@ found:
BUG_ON(n.live_size != k->k.size);
restart_narrow_pointers:
+ ptrs = bch2_bkey_ptrs(bkey_i_to_s(k));
+
bkey_for_each_ptr_dec... |
e42951b0aa50bb67b29da1af1099013c1aeb1d9d | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_sort_repack_merge() | Problem Details:
bch2_bkey_normalize() modifies the value, and we were modifying the
original value in the src btree node - but, we're called without a write
lock held on the src node. Oops...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bkey_sort.c b/fs/bcachefs/bkey_sort.c
index 9f5d9b4bf1c9..e32fad5a91ac 100644
--- a/fs/bcachefs/bkey_sort.c
+++ b/fs/bcachefs/bkey_sort.c
@@ -415,25 +415,22 @@ bch2_sort_repack_merge(struct bch_fs *c,
struct bkey_format *out_f,
bool filter_whiteouts)
{
- struct bkey... |
23bbd2bb8f2cbe2679b404f730cbfd6bf42bd878 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_btree_node_iter_fix() | Problem Details:
bch2_btree_node_iter_prev_all() depends on an invariant that wasn't
being maintained for extent leaf nodes - specifically, the node iterator
may not have advanced past any keys that compare after the key the node
iterator points to.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 52932bbdb832..a278921d3e6f 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -496,6 +496,23 @@ static inline void __bch2_btree_iter_verify(struct btree_iter *iter,
#endif
+static void btree_node_iter_set_set_pos(st... |
e67ab0450cca7dc1673e4cd00eecf9d896b15889 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_btree_node_iter_prev_filter() | Problem Details:
bch2_btree_node_iter_prev_filter() tried to be smart about iterating
backwards when skipping over whiteouts/discards - but unfortunately,
doing so can leave the node iterator in an inconsistent state; the sane
solution is to just always iterate backwards one key at a time.
But we compact btree nodes w... | ```diff
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c
index 78e6fd3f1306..1dd2bcc69c35 100644
--- a/fs/bcachefs/bset.c
+++ b/fs/bcachefs/bset.c
@@ -1682,12 +1682,10 @@ void bch2_btree_node_iter_advance(struct btree_node_iter *iter,
/*
* Expensive:
*/
-struct bkey_packed *bch2_btree_node_iter_prev_filter(str... |
9df279407a2daaf8e6586be483632fe9aaca6ef3 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix __bch2_btree_iter_peek_slot_extents() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index a702eb3bbefb..52932bbdb832 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1436,8 +1436,7 @@ __bch2_btree_iter_peek_slot_extents(struct btree_iter *iter)
recheck:
while ((k = __btree_iter_peek_all(iter, l, &iter... |
63f1a59847522b5218d1116c12afd9c9ce6c6645 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Improved debug checks | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c
index 68442a26756f..78e6fd3f1306 100644
--- a/fs/bcachefs/bset.c
+++ b/fs/bcachefs/bset.c
@@ -21,6 +21,16 @@
static inline void __bch2_btree_node_iter_advance(struct btree_node_iter *,
struct btree *);
+static inline unsigned __btree_node_iter_use... |
c8b18c37b2e52a3743be9d235c7f6136fa7940b9 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix for_each_btree_key() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h
index 710ed70ec807..b54351073231 100644
--- a/fs/bcachefs/btree_iter.h
+++ b/fs/bcachefs/btree_iter.h
@@ -242,7 +242,7 @@ static inline struct bkey_s_c __bch2_btree_iter_next(struct btree_iter *iter,
(_start), (_flags))) ?: \
PT... |
e10d309471c54dbcb0dfc2c780672c07d4805495 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_seek_data() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 474535aa3fc2..de0159dde1bd 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -2798,7 +2798,7 @@ static loff_t bch2_next_pagecache_data(struct inode *vinode,
end_offset =
min(end_offset,
max(start_offset,
- ((loff_... |
0c04f5eb0d49c92e5223dd98bb8e2577b9ce6f49 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Don't overflow trans with iters from triggers | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index d71de5c776bb..b1914fba1f7f 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1359,6 +1359,8 @@ static int trans_get_key(struct btree_trans *trans,
if (IS_ERR(*iter))
return PTR_ERR(*iter);
+ bch2_trans_iter_free_on_commit(t... |
e222d206f298dc2c689d8f8787c929451d4f909b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix ec_stripes_read() | Problem Details:
Change it to not mark keys that will be overwritten by keys in the
journal - this fixes a bug where we pop an assertion in
bucket_set_stripe() because of a stale pointer - because the stripe that
has the stale pointer has been deleted.
This code could be factored out and used elsewhere, at some point.... | ```diff
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 42bca2b413e3..de31ea6c20de 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -1267,10 +1267,10 @@ int bch2_stripes_write(struct bch_fs *c, unsigned flags, bool *wrote)
int bch2_stripes_read(struct bch_fs *c, struct journal_keys *journal_keys)
{
- ... |
f516c87272c98186f12768e9589664ce7a910bf4 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix stripe_idx_to_delete() | Problem Details:
There was a null ptr deref when there wasn't a stripes heap allocated
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 6d59631b8259..42bca2b413e3 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -575,7 +575,8 @@ static ssize_t stripe_idx_to_delete(struct bch_fs *c)
{
ec_stripes_heap *h = &c->ec_stripes_heap;
- return h->data[0].blocks_nonempty == 0 ? h->data[0].... |
a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix moving compressed data | Problem Details:
bio_uncompress_inplace() used to potentially need to extend the bio to
be big enough for the uncompressed data, which has become problematic
with multipage bvecs - but, the move extent path actually already
allocated the bios to be big enough for the uncompressed data.
The promote path needed to be fi... | ```diff
diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c
index 1a51a8c3e95c..d350d917a8d4 100644
--- a/fs/bcachefs/compress.c
+++ b/fs/bcachefs/compress.c
@@ -241,19 +241,10 @@ int bch2_bio_uncompress_inplace(struct bch_fs *c, struct bio *bio,
}
/*
- * might have to free existing pages and retry allo... |
d74dfe02881bdf8df99a320857f38540315989cd | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix for building with old gcc | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index c2b5c11a87c5..b8aafd2e283a 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -852,7 +852,7 @@ static const unsigned BKEY_ALLOC_VAL_U64s_MAX =
BCH_ALLOC_FIELDS(), sizeof(u64));
#undef x
-st... |
2ded276b7e20084842225b47100f3391e00f540f | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix array overrun with unknown btree roots | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 2b7133e376e3..e0df2c0a4fdf 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -379,7 +379,15 @@ static int journal_replay_entry_early(struct bch_fs *c,
switch (entry->type) {
case BCH_JSET_ENTRY_btree_root: {
- struct btr... |
f707e3d8f41e77aff94941168ab30da2314a5984 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix kasan splat | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index dc9222b1a196..2b7133e376e3 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -721,10 +721,12 @@ int bch2_fs_recovery(struct bch_fs *c)
ret = bch2_blacklist_table_initialize(c);
- ret = verify_journal_entries_not_blacklist... |
2a488aaac1d4a7f5b48bce687adf430d24e0beb5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix __bch2_xattr_bcachefs_get() | Problem Details:
We were returning -ERANGE when the size of the buffer passed in was
exactly the size of the xattr val
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c
index 2ccf64db8147..5aeff1012f8b 100644
--- a/fs/bcachefs/xattr.c
+++ b/fs/bcachefs/xattr.c
@@ -387,6 +387,9 @@ static int __bch2_xattr_bcachefs_get(const struct xattr_handler *handler,
bch2_inode_opts_to_opts(bch2_inode_opts_get(&inode->ei_inode));
co... |
3e669816904d45d48ef2183a2ad675c24d9c941a | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix promoting to cache devices (durability = 0) | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 334bc6576b3a..e3e9383c94ee 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -377,6 +377,25 @@ void bch2_dev_stripe_increment(struct bch_fs *c, struct bch_dev *ca,
#define BUCKET_MAY_ALLOC_PARTI... |
66b095b008ea6526c660fbecfacbd970416f971e | Analyze and fix the following issue in the Linux kernel code: bcachefs: Don't allow bkey vals that are too big in extents btree | Problem Details:
Make sure we don't overflow BKEY_PADDED keys
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c
index 547f5b301ad4..09ee958c5568 100644
--- a/fs/bcachefs/bkey_methods.c
+++ b/fs/bcachefs/bkey_methods.c
@@ -82,6 +82,11 @@ const char *__bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
if (k.k->u64s < BKEY_U64s)
return "u64s too ... |
1ae973345626fcd9cdb81fe856cabf7808a33140 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Don't overflow stack in bch2_extent_merge_inline() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bkey.h b/fs/bcachefs/bkey.h
index 45de61d492a4..ba08d95aae6f 100644
--- a/fs/bcachefs/bkey.h
+++ b/fs/bcachefs/bkey.h
@@ -41,10 +41,7 @@ struct bkey_s {
#define bkey_next(_k) vstruct_next(_k)
-static inline unsigned bkey_val_u64s(const struct bkey *k)
-{
- return k->u64s - BKEY_U6... |
5884fddfe732183aa2be4d11444543dfae6e044b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix starting copygc when already started | Problem Details:
We can sometimes call bch2_dev_read_write() when the device is already
RW (in error paths).
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index d97be76da58f..44e235ef3de0 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -283,7 +283,8 @@ int bch2_copygc_start(struct bch_fs *c, struct bch_dev *ca)
{
struct task_struct *t;
- BUG_ON(ca->copygc_thread);
+ if (ca->copy... |
37dd783474d07f8aa210ecf5cc82fd900417eb8b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix an error path in bch2_btree_iter_traverse() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 2579944bb8c1..9e6faf7e2830 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -959,9 +959,10 @@ static void btree_iter_up(struct btree_iter *iter)
int __must_check __bch2_btree_iter_traverse(struct btree_iter *);
sta... |
572ad769f59519fad80ed7241c44d7330bc379b4 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix cached sectors not being updated on invalidate | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 7475d5c4420b..feaefb00ef71 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -620,11 +620,12 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
!update_triggers_transac... |
cdeeb75ea9e329b6e02e7956f741de7c9ddfbb3b | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix a mount error path | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index defd35d04750..afe930532224 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1597,7 +1597,7 @@ static struct bch_fs *__bch2_open_as_blockdevs(const char *dev_name, char * cons
*/
c1 = bch2_path_to_fs(devs[0]);
- if (!c1)
+ if (IS_ERR(c1))
... |
a62c78a794c2cf6ed08a1a7b25887a1935e87835 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_extent_merge() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index d8d128cae5b4..c5a0d6c8e63a 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1529,6 +1529,9 @@ enum merge_result bch2_extent_merge(struct bch_fs *c,
union bch_extent_entry *en_r = er.v->start;
struct bch_extent_crc_unpacked cr... |
87c3beb4a589312f2c150129309a48b5518385e7 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a bug with spinning on the journal | Problem Details:
Transactional triggers meant that when we failed to get a journal
reservation, then bailed out into the error path to block on a journal
reservation, the second blocking call into the journal code was asking
for less space, which is not what we want.
Signed-off-by: Kent Overstreet <kent.overstreet@lin... | ```diff
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index d88f1c911d04..9bab213fd65b 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -301,6 +301,7 @@ struct btree_trans {
u64 *journal_seq;
struct disk_reservation *disk_res;
unsigned flags;
+ unsigned journal_u6... |
6fb076e60d65e574756cd1a4262c1c05b750ec21 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix spurious inconsistency in recovery | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 25c18b8cd3a6..61991d898d99 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -232,7 +232,9 @@ int bch2_alloc_read(struct bch_fs *c, struct journal_keys *journal_keys)
bch2_trans_init(&trans, c)... |
42c7d748e4983be1b7fdf3ff58920eab92c8833d | Analyze and fix the following issue in the Linux kernel code: bcachefs: stripe creation fixes | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c
index 07245717ca4e..56939428a21a 100644
--- a/fs/bcachefs/ec.c
+++ b/fs/bcachefs/ec.c
@@ -180,6 +180,25 @@ static int extent_matches_stripe(struct bch_fs *c,
return -1;
}
+static bool extent_has_stripe_ptr(struct bkey_s_c k, u64 idx)
+{
+ struct bkey_s_c_ext... |
7cfac5f5064331b99928000907e9b4d646cdfc71 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix for the stripes mark path and gc | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 2479ad37775b..d0a288dddb45 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -994,7 +994,7 @@ static int bch2_mark_stripe(struct bch_fs *c, struct bkey_s_c k,
return -1;
}
- if (m->alive)
+ if (!gc && m->alive)
bch2_strip... |
9516950c0690b6a8bef4cc1c7ae269da996973d8 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix return code from bch2_fs_start() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 654ccc611099..4c54ac64b0af 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -897,7 +897,8 @@ err:
break;
}
- BUG_ON(!ret);
+ if (ret >= 0)
+ ret = -EIO;
goto out;
}
``` |
fca1223ccfac2a461d7d3e29fb09a1b2142bdd7f | Analyze and fix the following issue in the Linux kernel code: bcachefs: Avoid write lock on mark_lock | Problem Details:
mark_lock is a frequently taken lock, and there's also potential for
deadlocks since currently bch2_clear_page_bits which is called from
memory reclaim has to take it to drop disk reservations.
The disk reservation get path takes it when it recalculates the number
of sectors known to be available, but... | ```diff
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 807291c33f5c..877ce788d413 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -640,6 +640,7 @@ struct bch_fs {
unsigned bucket_size_max;
atomic64_t sectors_available;
+ struct mutex sectors_available_lock;
struct bc... |
33eb63e5753ad6229d4027340153817b92840760 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a bug with multiple iterators being traversed | Problem Details:
If upgrade fails on one iterator, but it was copied from another
iterator and will be freed before transaction restart, then the original
iterator will get traversed first, so we need to make required btree
nodes on the original iterator will be traversed too.
Signed-off-by: Kent Overstreet <kent.over... | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index ac3c3769e126..eeb9a59283a7 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -320,7 +320,6 @@ bool __bch2_btree_iter_upgrade(struct btree_iter *iter,
trans_for_each_iter(iter->trans, linked)
if (linked != iter &&
... |
1fe93f88c36dcceee9f92055d0a1febbd90338d3 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_rbio_narrow_crcs() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index b07b0f92d4f9..9bb4b1fe5b8a 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1422,7 +1422,7 @@ static void bch2_rbio_narrow_crcs(struct bch_read_bio *rbio)
struct bkey_i_extent *e;
BKEY_PADDED(k) new;
struct bch_extent_crc_unpacked new_crc;
- u... |
1f7d45beb71f460b9ea138788340926c1b3a4c4d | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix journal shutdown path | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 25d0631c43dd..0261c6bbfa92 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -959,6 +959,8 @@ void bch2_fs_journal_stop(struct journal *j)
{
struct bch_fs *c = container_of(j, struct bch_fs, journal);
+ bch2_journal_flush_all_... |
75812e70d9341e7a1a55f6f2a0e367186c859623 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix fsync error reporting | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index f76dd4d89f25..619daf65e1ec 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -1131,9 +1131,10 @@ static void bch2_writepage_io_done(struct closure *cl)
struct bio_vec *bvec;
if (io->op.op.error) {
- bio_for_each_segment_all(bvec, bi... |
a7451c42926c894956fee3b455619c3e0387219f | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_flags_to_text() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index 295f4577e9c1..0ca1fb59f54d 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -143,10 +143,10 @@ void bch2_flags_to_text(struct printbuf *out,
nr++;
while (flags && (bit = __ffs(flags)) < nr) {
- pr_buf(out, "%s", list[bit]);
if (!fi... |
201a4d4cbed532c73d83ea9ea8166f40e9faa1e1 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix triggers for stripes btree | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 7a05ba5fd589..e9c5889b2c0f 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1107,6 +1107,15 @@ void bch2_mark_update(struct btree_trans *trans,
if (unlikely(trans->flags & BTREE_INSERT_NOMARK_OVERWRITES))
return;
+ /*
+ *... |
f80b4e64a4d79e78053a0e2ed4607f6af9dd2c89 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix hang while shutting down | Problem Details:
If the allocator thread exited before bch2_dev_allocator_stop() was
called (because of an error), bch2_dev_allocator_quiesce() could hang.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index c254c08af9d1..4a8f6fa3db1e 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -598,6 +598,9 @@ static int wait_buckets_available(struct bch_fs *c, struct bch_dev *ca)
unsigned long gc_count = c-... |
53beb841623bcdb1fe619efe5f2c34ca3af08c78 | Analyze and fix the following issue in the Linux kernel code: bcachefs: lockdep fix when going rw from bch2_alloc_write() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 5c8cebc443d1..c254c08af9d1 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -411,21 +411,21 @@ static int __bch2_alloc_write_key(struct btree_trans *trans, struct bch_dev *ca,
int bch2_alloc_... |
dcf77129749fea4f6608d310161be1650dc2a4dc | Analyze and fix the following issue in the Linux kernel code: bcachefs: minor fsck fix | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 661131d5a114..9db01437315b 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -1240,12 +1240,10 @@ static int check_inode(struct btree_trans *trans,
return ret;
}
- if (u.bi_flags & BCH_INODE_UNLINKED) {
- fsck_err_on(c->sb.clean, c,
-... |
4c1c1e395373a8b47dee91a78f708176794d04f5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_trans_unlock() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index bb898911bdc6..fbbb7428c592 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1705,7 +1705,7 @@ void bch2_trans_preload_iters(struct btree_trans *trans)
static int btree_trans_iter_alloc(struct btree_trans *trans)
{... |
a6d90385e6915429a891408824b8c72219a139f2 | Analyze and fix the following issue in the Linux kernel code: bcachefs: (invalidate|release)_folio fixes | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index d865081d4a21..c8f6104553aa 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -736,9 +736,6 @@ out:
void bch2_invalidate_folio(struct folio *folio, size_t offset, size_t length)
{
- EBUG_ON(!PageLocked(&folio->page));
- EBUG_ON(folio_te... |
3a0e06db71f65ae0e7a98a1db170339d40abacdc | Analyze and fix the following issue in the Linux kernel code: bcachefs: Assorted preemption fixes | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 3549f0f54624..b5f5c223e008 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -291,8 +291,10 @@ int bch2_alloc_read(struct bch_fs *c, struct list_head *journal_replay_list)
bch2_alloc_read_ke... |
ccaa61c9f6a9db28f2e0b480927f6f2c97ff72af | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix initial gc | Problem Details:
Buckets weren't being marked as dirty
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 5abd7ac5bb78..b5a4ac9a4176 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -559,12 +559,6 @@ static void bch2_gc_done(struct bch_fs *c, bool initial)
struct bucket_array *src = __bucket_array(ca, 1);
size_t b;
- if (... |
65e7ab8f2aa7d45190f1e90b1332c71ef83587a6 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a deadlock | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 503cbc5ae309..a05fd7104a72 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -560,6 +560,8 @@ static inline int do_btree_insert_at(struct btree_trans *trans,
trans_for_each_update_iter(tran... |
8b2b9d11b9d0aea6401546780e84adcf51e27ba4 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix error handling in gc | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 0069d6cb6e5d..302793d84b92 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -261,15 +261,14 @@ static int bch2_gc_btree(struct bch_fs *c, enum btree_id btree_id,
return ret;
mutex_lock(&c->btree_root_lock);
-
b = c->b... |
6122ab639c8e3d6afe9a3c8e3e49173cd2a064a3 | Analyze and fix the following issue in the Linux kernel code: bcachefs: More debug params for testing of recovery paths | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index ea648753aec0..5a9b776558f6 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -278,7 +278,11 @@ do { \
"cached data") \
BCH_DEBUG_PARAM(force_reconstruct_read, \
"Force reads to use the reconstruct path, ... |
082f0801e0c96a4dbea67998b63c29c18da2419f | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix error handling in bch2_fs_recovery() | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index fdc64e199f8b..9610b488fbdf 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -271,11 +271,13 @@ int bch2_fs_recovery(struct bch_fs *c)
continue;
err = "invalid btree root pointer";
+ ret = -1;
if (r->error)
got... |
7c648fe8991a267886b262e8988546ec87ad926e | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a deadlock | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c
index 955831a50824..38bf75b6bc2d 100644
--- a/fs/bcachefs/migrate.c
+++ b/fs/bcachefs/migrate.c
@@ -96,11 +96,11 @@ static int bch2_dev_usrdata_drop(struct bch_fs *c, unsigned dev_idx, int flags)
break;
}
+ bch2_trans_exit(&trans);
+
bch2_repl... |
db8a5f0a6abd1981caf4b87cc65e5a998851f9c6 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_mark_bkey_replicas() call | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 7749fccd0eab..b484cbc3071e 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -797,8 +797,13 @@ err:
}
bch2_btree_iter_unlock(trans->entries[0].iter);
- ret = bch2_mark_bkey_replicas(... |
18c9883e1cddb6a8c3f593b0c2c921bb0179fa50 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_invalidate_one_bucket2() during journal replay | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 0ea4bebdd0af..2f1a8e70ad88 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -939,7 +939,7 @@ retry:
else
memset(&u, 0, sizeof(u));
- invalidating_cached_data = u.cached_sectors != 0;
+ in... |
3aea434272884b8dc77c57624a6d3fec55ade898 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix for shutting down before fs started marking it clean | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index c79aa11f2120..4f627e91f041 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -299,7 +299,8 @@ void bch2_fs_read_only(struct bch_fs *c)
if (!bch2_journal_error(&c->journal) &&
!test_bit(BCH_FS_ERROR, &c->flags) &&
- !test_bit(... |
844045581e52955525fcc487d59fb3981a412f35 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix for when compressed extent is split during journal replay | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index db95257cec11..9997a2793e0a 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -823,6 +823,63 @@ fsck_err:
/* journal replay: */
+static int bch2_extent_replay_key(struct bch_fs *c, struct bkey_i *k)
+{
+ /*
+ * We ... |
db6447b383e5299e864826a3adc29b5eca04f4c5 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix a faulty assertion | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 0aae8fd74c8a..64f9c5740ec8 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -248,13 +248,13 @@ static int journal_entry_open(struct journal *j)
do {
old.v = new.v = v;
- EBUG_ON(journal_state_count(new, new.idx));
-
if ... |
812af308de34f5bc3fc0d30a00f826ad159a724f | Analyze and fix the following issue in the Linux kernel code: bcachefs: assertion to catch outstanding bug | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 66e174d93a9c..c89fe5d630e4 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -1027,7 +1027,10 @@ void bch2_fs_mark_clean(struct bch_fs *c, bool clean)
sb_clean->flags = 0;
sb_clean->read_clock = cpu_to_le16(c->bucket_clock... |
b5d056358d1da10738500a272a4e7967d55e9341 | Analyze and fix the following issue in the Linux kernel code: bcachefs: minor journal reclaim fixes | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c
index 053fa4aa4f5f..2f67ea2debd2 100644
--- a/fs/bcachefs/journal_reclaim.c
+++ b/fs/bcachefs/journal_reclaim.c
@@ -502,8 +502,8 @@ void bch2_journal_reclaim(struct journal *j)
nr_buckets = min(nr_buckets, ja->nr);
bucket_to_flus... |
59928c12206ce8f478113403562947e21a47883a | Analyze and fix the following issue in the Linux kernel code: bcachefs: Don't BUG_ON() on bucket sector count overflow | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 5011e7af3563..bddddcb93bc6 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -541,29 +541,40 @@ static int bch2_mark_alloc(struct bch_fs *c, struct bkey_s_c k,
}
#define checked_add(a, b) \
-do { \
+({ \
uns... |
fcbf3e509648a94129ae23a6101f5295a3fdced0 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Allocator startup fixes/refactoring | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 52b0d27dbc68..5ea7abc496de 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1467,7 +1467,7 @@ int bch2_dev_allocator_start(struct bch_dev *ca)
return 0;
}
-static bool flush_done(struct bc... |
2d3b581039614a20b064856b8fd899a733a4a1f8 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Better journal debug | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 21e611cdaa06..c9881fc2df17 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -1084,35 +1084,54 @@ ssize_t bch2_journal_print_debug(struct journal *j, char *buf)
{
struct printbuf out = _PBUF(buf, PAGE_SIZE);
struct bch_fs *c =... |
8db2acde2fca80954b4db12977182aa44b1e85fe | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix integer underflow in journal code | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 91d0e5d443ed..3a6040244064 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -256,6 +256,8 @@ static int journal_entry_open(struct journal *j)
do {
old.v = new.v = v;
+ EBUG_ON(journal_state_count(new, new.idx));
+
if (o... |
28062d320bded23eb7d24633e6ab11ea3c03487b | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix gc handling of bucket gens | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 56402fc64bc2..c899a77bf891 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -142,22 +142,23 @@ static int bch2_gc_mark_key(struct bch_fs *c, struct bkey_s_c k,
bkey_for_each_ptr(ptrs, ptr) {
struct bch_dev *ca = bch_dev... |
86a225c42d44ba966504801c6d953745184ea9cf | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix a deadlock on startup | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 04b75367fcde..fd39eeae5740 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1678,7 +1678,6 @@ int bch2_fs_allocator_start(struct bch_fs *c)
{
struct bch_dev *ca;
unsigned i;
- bool wrote;
... |
73c27c60956ed55d165d41658745dead49d689c4 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fixes for cached data accounting | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 16d82832277c..949541f15e7d 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -432,7 +432,7 @@ static int __bch2_invalidate_bucket(struct bch_fs *c, struct bch_dev *ca,
if (old.cached_sectors)
update_cached_sectors(c, fs_usag... |
8c96cfccf045efff12d8287a41f2b8f4ef3094c2 | Analyze and fix the following issue in the Linux kernel code: bcachefs: fix more locking bugs | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 7c57de5390b4..5b9d6c77d037 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -886,7 +886,8 @@ static int bch2_invalidate_buckets(struct bch_fs *c, struct bch_dev *ca)
ret = __bch2_alloc_write_... |
2ecc6171a3267fe24d7ee28059631a630344c310 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix double counting when gc is running | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c
index 6dff960e095d..60aa28e3f5f8 100644
--- a/fs/bcachefs/btree_update_interior.c
+++ b/fs/bcachefs/btree_update_interior.c
@@ -1088,8 +1088,7 @@ static void bch2_btree_set_root_inmem(struct btree_update *as, struct btree *b)... |
76f4c7b0c33d86bfa3973655ea6ed6182039ca99 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix oldest_gen handling | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 34c1de63e43b..9d2e21d99e6e 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -183,6 +183,7 @@ static void __alloc_read_key(struct bucket *g, const struct bch_alloc *a)
g->_mark.data_type = get_... |
053dbb377dd2874942a1ca8517d454f35916a782 | Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix a locking bug | Problem Details:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> | ```diff
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index c44e0417af87..34c1de63e43b 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -883,6 +883,7 @@ static int bch2_invalidate_buckets(struct bch_fs *c, struct bch_dev *ca)
ret = __bch2_alloc_writ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.