public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Catherine Hoang <catherine.hoang@oracle.com>
To: xfs-stable@lists.linux.dev
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 6.6 CANDIDATE 01/24] xfs: assert a valid limit in xfs_rtfind_forw
Date: Tue,  4 Feb 2025 19:07:09 -0800	[thread overview]
Message-ID: <20250205030732.29546-2-catherine.hoang@oracle.com> (raw)
In-Reply-To: <20250205030732.29546-1-catherine.hoang@oracle.com>

From: Christoph Hellwig <hch@lst.de>

commit 6d2db12d56a389b3e8efa236976f8dc3a8ae00f0 upstream.

Protect against developers passing stupid limits when refactoring the
RT code once again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
---
 fs/xfs/libxfs/xfs_rtbitmap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 760172a65aff..d7d06dc89eb7 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -288,6 +288,8 @@ xfs_rtfind_forw(
 	xfs_rtword_t	wdiff;		/* difference from wanted value */
 	int		word;		/* word number in the buffer */
 
+	ASSERT(start <= limit);
+
 	/*
 	 * Compute and read in starting bitmap block for starting block.
 	 */
-- 
2.39.3


  reply	other threads:[~2025-02-05  3:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <RXFziXyTkkJs02L8mR-Um70po2IisADFkG9XGfYFGhNPh-xy7gNJ_tSvG1ZYBchOAp07owM1mgnBRF1Iw0-TzQ==@protonmail.internalid>
2025-02-05  3:07 ` [PATCH 6.6 CANDIDATE 00/24] xfs backports for 6.6.y (from 6.12) Catherine Hoang
2025-02-05  3:07   ` Catherine Hoang [this message]
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 02/24] xfs: validate inumber in xfs_iget Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 03/24] xfs: fix a sloppy memory handling bug in xfs_iroot_realloc Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 04/24] xfs: fix a typo Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 05/24] xfs: skip background cowblock trims on inodes open for write Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 06/24] xfs: don't free cowblocks from under dirty pagecache on unshare Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 07/24] xfs: merge xfs_attr_leaf_try_add into xfs_attr_leaf_addname Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 08/24] xfs: return bool from xfs_attr3_leaf_add Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 09/24] xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 10/24] xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 11/24] xfs: fold xfs_bmap_alloc_userdata into xfs_bmapi_allocate Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 12/24] xfs: don't ifdef around the exact minlen allocations Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 13/24] xfs: call xfs_bmap_exact_minlen_extent_alloc from xfs_bmap_btalloc Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 14/24] xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 15/24] xfs: Use try_cmpxchg() in xlog_cil_insert_pcp_aggregate() Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 16/24] xfs: Remove empty declartion in header file Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 17/24] xfs: pass the exact range to initialize to xfs_initialize_perag Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 18/24] xfs: update the file system geometry after recoverying superblock buffers Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 19/24] xfs: error out when a superblock buffer update reduces the agcount Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 20/24] xfs: don't use __GFP_RETRY_MAYFAIL in xfs_initialize_perag Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 21/24] xfs: update the pag for the last AG at recovery time Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 22/24] xfs: Reduce unnecessary searches when searching for the best extents Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 23/24] xfs: streamline xfs_filestream_pick_ag Catherine Hoang
2025-02-05  3:07   ` [PATCH 6.6 CANDIDATE 24/24] xfs: Check for delayed allocations before setting extsize Catherine Hoang
2025-02-05  8:12   ` [PATCH 6.6 CANDIDATE 00/24] xfs backports for 6.6.y (from 6.12) Carlos Maiolino
2025-02-05 15:57     ` Darrick J. Wong
2025-02-05 16:01   ` Darrick J. Wong

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=20250205030732.29546-2-catherine.hoang@oracle.com \
    --to=catherine.hoang@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=xfs-stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox