From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev,
Kent Overstreet <kent.overstreet@linux.dev>
Subject: [bcachefs:bcachefs-testing 141/148] fs/bcachefs/btree_iter.c:2668:41-42: Unneeded semicolon
Date: Mon, 28 Oct 2024 17:55:21 +0800 [thread overview]
Message-ID: <202410281741.fvwVF2Ru-lkp@intel.com> (raw)
tree: https://evilpiepirate.org/git/bcachefs.git bcachefs-testing
head: 94e538060c93b0d601bdbfc91f495a8ebbf56b6c
commit: a9e16001658d3ba0e90954652b859bcf0a7cd1e3 [141/148] bcachefs: Implement bch2_btree_iter_prev_min()
config: m68k-randconfig-r051-20241027 (https://download.01.org/0day-ci/archive/20241028/202410281741.fvwVF2Ru-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410281741.fvwVF2Ru-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> fs/bcachefs/btree_iter.c:2668:41-42: Unneeded semicolon
vim +2668 fs/bcachefs/btree_iter.c
2556
2557 /**
2558 * bch2_btree_iter_peek_prev_min() - returns first key less than or equal to
2559 * iterator's current position
2560 * @iter: iterator to peek from
2561 * @end: search limit: returns keys greater than or equal to @end
2562 *
2563 * Returns: key if found, or an error extractable with bkey_err().
2564 */
2565 struct bkey_s_c bch2_btree_iter_peek_prev_min(struct btree_iter *iter, struct bpos end)
2566 {
2567 struct btree_trans *trans = iter->trans;
2568 struct bpos search_key = iter->pos;
2569 struct bkey_s_c k;
2570 btree_path_idx_t saved_path = 0;
2571
2572 bch2_trans_verify_not_unlocked(trans);
2573 bch2_btree_iter_verify_entry_exit(iter);
2574 EBUG_ON((iter->flags & BTREE_ITER_filter_snapshots) && bpos_eq(end, POS_MIN));
2575
2576 int ret = trans_maybe_inject_restart(trans, _RET_IP_);
2577 if (unlikely(ret)) {
2578 k = bkey_s_c_err(ret);
2579 goto out_no_locked;
2580 }
2581
2582 if (iter->flags & BTREE_ITER_filter_snapshots)
2583 search_key.snapshot = U32_MAX;
2584
2585 while (1) {
2586 k = __bch2_btree_iter_peek_prev(iter, search_key);
2587 if (unlikely(!k.k))
2588 goto end;
2589 if (unlikely(bkey_err(k)))
2590 goto out_no_locked;
2591
2592 if (iter->flags & BTREE_ITER_filter_snapshots) {
2593 struct btree_path *s = saved_path ? trans->paths + saved_path : NULL;
2594 if (s && bpos_lt(k.k->p, SPOS(s->pos.inode, s->pos.offset, iter->snapshot))) {
2595 /*
2596 * If we have a saved candidate, and we're past
2597 * the last possible snapshot overwrite, return
2598 * it:
2599 */
2600 bch2_path_put_nokeep(trans, iter->path,
2601 iter->flags & BTREE_ITER_intent);
2602 iter->path = saved_path;
2603 saved_path = 0;
2604 k = bch2_btree_path_peek_slot(btree_iter_path(trans, iter), &iter->k);
2605 break;
2606 }
2607
2608 /*
2609 * We need to check against @end before FILTER_SNAPSHOTS because
2610 * if we get to a different inode that requested we might be
2611 * seeing keys for a different snapshot tree that will all be
2612 * filtered out.
2613 */
2614 if (unlikely(bkey_lt(k.k->p, end)))
2615 goto end;
2616
2617 if (!bch2_snapshot_is_ancestor(trans->c, iter->snapshot, k.k->p.snapshot)) {
2618 search_key = bpos_predecessor(k.k->p);
2619 continue;
2620 }
2621
2622 if (k.k->p.snapshot != iter->snapshot) {
2623 /*
2624 * Have a key visible in iter->snapshot, but
2625 * might have overwrites: - save it and keep
2626 * searching. Unless it's a whiteout - then drop
2627 * our previous saved candidate:
2628 */
2629 if (saved_path) {
2630 bch2_path_put_nokeep(trans, saved_path,
2631 iter->flags & BTREE_ITER_intent);
2632 saved_path = 0;
2633 }
2634
2635 if (!bkey_whiteout(k.k)) {
2636 saved_path = btree_path_clone(trans, iter->path,
2637 iter->flags & BTREE_ITER_intent,
2638 _THIS_IP_);
2639 trace_btree_path_save_pos(trans,
2640 trans->paths + iter->path,
2641 trans->paths + saved_path);
2642 }
2643
2644 search_key = bpos_predecessor(k.k->p);
2645 continue;
2646 }
2647
2648 if (bkey_whiteout(k.k)) {
2649 search_key = bkey_predecessor(iter, k.k->p);
2650 search_key.snapshot = U32_MAX;
2651 continue;
2652 }
2653 }
2654
2655 EBUG_ON(iter->flags & BTREE_ITER_all_snapshots ? bpos_gt(k.k->p, iter->pos) :
2656 iter->flags & BTREE_ITER_is_extents ? bkey_ge(bkey_start_pos(k.k), iter->pos) :
2657 bkey_gt(k.k->p, iter->pos));
2658
2659 if (unlikely(iter->flags & BTREE_ITER_all_snapshots ? bpos_lt(k.k->p, end) :
2660 iter->flags & BTREE_ITER_is_extents ? bkey_le(k.k->p, end) :
2661 bkey_lt(k.k->p, end)))
2662 goto end;
2663
2664 break;
2665 }
2666
2667 /* Extents can straddle iter->pos: */
> 2668 iter->pos = bpos_min(iter->pos, k.k->p);;
2669
2670 if (iter->flags & BTREE_ITER_filter_snapshots)
2671 iter->pos.snapshot = iter->snapshot;
2672 out_no_locked:
2673 if (saved_path)
2674 bch2_path_put_nokeep(trans, saved_path, iter->flags & BTREE_ITER_intent);
2675
2676 bch2_btree_iter_verify_entry_exit(iter);
2677 bch2_btree_iter_verify(iter);
2678 return k;
2679 end:
2680 bch2_btree_iter_set_pos(iter, end);
2681 k = bkey_s_c_null;
2682 goto out_no_locked;
2683 }
2684
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-10-28 9:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202410281741.fvwVF2Ru-lkp@intel.com \
--to=lkp@intel.com \
--cc=kent.overstreet@linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.