From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: fix incorrect test in xfs_alloc_ag_vextent_lastblock
Date: Mon, 16 Mar 2020 11:34:53 -0400 [thread overview]
Message-ID: <20200316153453.GA17967@bfoster> (raw)
In-Reply-To: <20200316153155.GE256767@magnolia>
On Mon, Mar 16, 2020 at 08:31:55AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> When I lifted the code in xfs_alloc_ag_vextent_lastblock out of a loop,
> I forgot to convert all the accesses to len to be pointer dereferences.
>
> Coverity-id: 1457918
> Fixes: 5113f8ec3753ed ("xfs: clean up weird while loop in xfs_alloc_ag_vextent_near")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 337822115bbc..203e74fa64aa 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -1514,7 +1514,7 @@ xfs_alloc_ag_vextent_lastblock(
> * maxlen, go to the start of this block, and skip all those smaller
> * than minlen.
> */
> - if (len || args->alignment > 1) {
> + if (*len || args->alignment > 1) {
> acur->cnt->bc_ptrs[0] = 1;
> do {
> error = xfs_alloc_get_rec(acur->cnt, bno, len, &i);
>
next prev parent reply other threads:[~2020-03-16 15:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 15:31 [PATCH] xfs: fix incorrect test in xfs_alloc_ag_vextent_lastblock Darrick J. Wong
2020-03-16 15:34 ` Brian Foster [this message]
2020-03-17 18:34 ` Christoph Hellwig
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=20200316153453.GA17967@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@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).