From: Kent Overstreet <kent.overstreet@linux.dev>
To: linux-bcachefs@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Subject: [PATCH 07/37] bcachefs: Fix bch2_journal_keys_peek_prev_min()
Date: Wed, 18 Jun 2025 17:53:58 -0400 [thread overview]
Message-ID: <20250618215431.738317-8-kent.overstreet@linux.dev> (raw)
In-Reply-To: <20250618215431.738317-1-kent.overstreet@linux.dev>
this code is rarely invoked, so - we had a few bugs left from basing it
off of bch2_journal_keys_peek_max()...
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
fs/bcachefs/btree_journal_iter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/bcachefs/btree_journal_iter.c b/fs/bcachefs/btree_journal_iter.c
index cf7398751644..de996c848e43 100644
--- a/fs/bcachefs/btree_journal_iter.c
+++ b/fs/bcachefs/btree_journal_iter.c
@@ -141,8 +141,8 @@ struct bkey_i *bch2_journal_keys_peek_prev_min(struct bch_fs *c, enum btree_id b
if (!*idx)
*idx = __bch2_journal_key_search(keys, btree_id, level, pos);
- while (*idx &&
- __journal_key_cmp(btree_id, level, end_pos, idx_to_key(keys, *idx - 1)) <= 0) {
+ while (*idx < keys->nr &&
+ __journal_key_cmp(btree_id, level, end_pos, idx_to_key(keys, *idx - 1)) >= 0) {
(*idx)++;
iters++;
if (iters == 10) {
--
2.50.0
next prev parent reply other threads:[~2025-06-18 21:54 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 21:53 [PATCH 00/37] 6.16-rc3 hotfixes series Kent Overstreet
2025-06-18 21:53 ` [PATCH 01/37] bcachefs: trace_extent_trim_atomic Kent Overstreet
2025-06-18 21:53 ` [PATCH 02/37] bcachefs: btree iter tracepoints Kent Overstreet
2025-06-18 21:53 ` [PATCH 03/37] bcachefs: Don't allocate new memory when mempool is exhausted Kent Overstreet
2025-06-18 21:53 ` [PATCH 04/37] bcachefs: Fix alloc_req use after free Kent Overstreet
2025-06-18 21:53 ` [PATCH 05/37] bcachefs: Add missing EBUG_ON Kent Overstreet
2025-06-18 21:53 ` [PATCH 06/37] bcachefs: Delay calculation of trans->journal_u64s Kent Overstreet
2025-06-18 21:53 ` Kent Overstreet [this message]
2025-06-18 21:53 ` [PATCH 08/37] bcachefs: btree_iter: fix updates, journal overlay Kent Overstreet
2025-06-18 21:54 ` [PATCH 09/37] bcachefs: better __bch2_snapshot_is_ancestor() assert Kent Overstreet
2025-06-18 21:54 ` [PATCH 10/37] bcachefs: pass last_seq into fs_journal_start() Kent Overstreet
2025-06-18 21:54 ` [PATCH 11/37] bcachefs: Fix "now allowing incompatible features" message Kent Overstreet
2025-06-18 21:54 ` [PATCH 12/37] bcachefs: Fix snapshot_key_missing_inode_snapshot repair Kent Overstreet
2025-06-18 21:54 ` [PATCH 13/37] bcachefs: fsck: fix add_inode() Kent Overstreet
2025-06-18 21:54 ` [PATCH 14/37] bcachefs: fsck: fix extent past end of inode repair Kent Overstreet
2025-06-18 21:54 ` [PATCH 15/37] bcachefs: opts.journal_rewind Kent Overstreet
2025-06-18 21:54 ` [PATCH 16/37] bcachefs: Kill unused tracepoints Kent Overstreet
2025-06-18 21:54 ` [PATCH 17/37] bcachefs: mark more errors autofix Kent Overstreet
2025-06-18 21:54 ` [PATCH 18/37] bcachefs: Move bset size check before csum check Kent Overstreet
2025-06-18 21:54 ` [PATCH 19/37] bcachefs: Fix pool->alloc NULL pointer dereference Kent Overstreet
2025-06-18 21:54 ` [PATCH 20/37] bcachefs: don't return fsck_fix for unfixable node errors in __btree_err Kent Overstreet
2025-06-18 21:54 ` [PATCH 21/37] bcachefs: fsck: Improve check_key_has_inode() Kent Overstreet
2025-06-18 21:54 ` [PATCH 22/37] bcachefs: Call bch2_fs_init_rw() early if we'll be going rw Kent Overstreet
2025-06-18 21:54 ` [PATCH 23/37] bcachefs: Fix __bch2_inum_to_path() when crossing subvol boundaries Kent Overstreet
2025-06-18 21:54 ` [PATCH 24/37] bcachefs: fsck: Print path when we find a subvol loop Kent Overstreet
2025-06-18 21:54 ` [PATCH 25/37] bcachefs: fsck: Fix remove_backpointer() for subvol roots Kent Overstreet
2025-06-18 21:54 ` [PATCH 26/37] bcachefs: fsck: Fix reattach_inode() " Kent Overstreet
2025-06-18 21:54 ` [PATCH 27/37] bcachefs: fsck: check_directory_structure runs in reverse order Kent Overstreet
2025-06-18 21:54 ` [PATCH 28/37] bcachefs: fsck: additional diagnostics for reattach_inode() Kent Overstreet
2025-06-18 21:54 ` [PATCH 29/37] bcachefs: fsck: check_subdir_count logs path Kent Overstreet
2025-06-18 21:54 ` [PATCH 30/37] bcachefs: fsck: Fix check_path_loop() + snapshots Kent Overstreet
2025-06-18 21:54 ` [PATCH 31/37] bcachefs: Fix bch2_read_bio_to_text() Kent Overstreet
2025-06-18 21:54 ` [PATCH 32/37] bcachefs: Fix restart handling in btree_node_scrub_work() Kent Overstreet
2025-06-18 21:54 ` [PATCH 33/37] bcachefs: fsck: Fix check_directory_structure when no check_dirents Kent Overstreet
2025-06-18 21:54 ` [PATCH 34/37] bcachefs: fsck: fix unhandled restart in topology repair Kent Overstreet
2025-06-18 21:54 ` [PATCH 35/37] bcachefs: fsck: Fix oops in key_visible_in_snapshot() Kent Overstreet
2025-06-18 21:54 ` [PATCH 36/37] bcachefs: fix spurious error in read_btree_roots() Kent Overstreet
2025-06-18 21:54 ` [PATCH 37/37] bcachefs: Fix missing newlines before ero Kent Overstreet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250618215431.738317-8-kent.overstreet@linux.dev \
--to=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).