linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Zhang <starzhangzsd@gmail.com>
To: djwong@kernel.org, dchinner@redhat.com, chandan.babu@oracle.com
Cc: zhangshida@kylinos.cn, starzhangzsd@gmail.com,
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: [PATCH] xfs: remove the redundant check in xfs_bmap_first_unused
Date: Fri,  9 Sep 2022 11:07:56 +0800	[thread overview]
Message-ID: <20220909030756.3916297-1-zhangshida@kylinos.cn> (raw)

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


             reply	other threads:[~2022-09-09  3:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  3:07 Stephen Zhang [this message]
2022-09-11 23:12 ` [PATCH] xfs: remove the redundant check in xfs_bmap_first_unused 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

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=20220909030756.3916297-1-zhangshida@kylinos.cn \
    --to=starzhangzsd@gmail.com \
    --cc=chandan.babu@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zhangshida@kylinos.cn \
    /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).