public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: remove the redundant check in xfs_bmap_first_unused
@ 2022-09-09  3:07 Stephen Zhang
  2022-09-11 23:12 ` Dave Chinner
  2022-09-15  7:41 ` [xfs] [confidence: ] 505313cbc0: Assertion_failed kernel test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Zhang @ 2022-09-09  3:07 UTC (permalink / raw)
  To: djwong, dchinner, chandan.babu
  Cc: zhangshida, starzhangzsd, linux-kernel, linux-xfs

Given that
        max >= lowest,
hence if
        got.br_startoff >= max + len,
then, at the same time,
        got.br_startoff >= lowest + len,

So the check here is redundant, remove it.

Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
---
 fs/xfs/libxfs/xfs_bmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index e56723dc9cd5..f8a984c41b01 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -1230,8 +1230,7 @@ xfs_bmap_first_unused(
 		/*
 		 * See if the hole before this extent will work.
 		 */
-		if (got.br_startoff >= lowest + len &&
-		    got.br_startoff - max >= len)
+		if (got.br_startoff - max >= len)
 			break;
 		lastaddr = got.br_startoff + got.br_blockcount;
 		max = XFS_FILEOFF_MAX(lastaddr, lowest);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-15  7:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09  3:07 [PATCH] xfs: remove the redundant check in xfs_bmap_first_unused Stephen Zhang
2022-09-11 23:12 ` Dave Chinner
2022-09-12  6:39   ` Stephen Zhang
2022-09-14 16:42     ` Darrick J. Wong
2022-09-15  7:41 ` [xfs] [confidence: ] 505313cbc0: Assertion_failed kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox