linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@redhat.com>
To: lixiaokeng <lixiaokeng@huawei.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com,
	sandeen@redhat.com, darrick.wong@oracle.com,
	linfeilong <linfeilong@huawei.com>,
	"liuzhiqiang (I)" <liuzhiqiang26@huawei.com>
Subject: Re: [PATCH] xfs: fix SIGFPE bug in align_ag_geometry
Date: Thu, 1 Apr 2021 10:29:15 +0800	[thread overview]
Message-ID: <20210401022915.GA3796795@xiangao.remote.csb> (raw)
In-Reply-To: <61b82c3c-5bcf-0c91-4fa5-fa138b52a6a6@huawei.com>

On Thu, Apr 01, 2021 at 09:58:53AM +0800, lixiaokeng wrote:
> In some case, the cfg->dsunit is 32, the cfg->dswidth is zero
> and cfg->agsize is 6400 in align_ag_geometry. So, the
> (cfg->agsize % cfg->dswidth) will lead to coredump.
> 
> Here add check cfg->dswidth. If it is zero, goto validate.
> 

May I ask what's the command line? and is it reproducable on
the latest upstream version?

Thanks,
Gao Xiang

> Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
> ---
>  mkfs/xfs_mkfs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index a135e06..71d3f74 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2725,6 +2725,9 @@ _("agsize rounded to %lld, sunit = %d\n"),
>  				(long long)cfg->agsize, dsunit);
>  	}
> 
> +	if (!cfg->dswidth)
> +		goto validate;
> +
>  	if ((cfg->agsize % cfg->dswidth) == 0 &&
>  	    cfg->dswidth != cfg->dsunit &&
>  	    cfg->agcount > 1) {
> -- 
> 


  reply	other threads:[~2021-04-01  2:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  1:58 [PATCH] xfs: fix SIGFPE bug in align_ag_geometry lixiaokeng
2021-04-01  2:29 ` Gao Xiang [this message]
2021-04-01  2:53   ` Gao Xiang

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=20210401022915.GA3796795@xiangao.remote.csb \
    --to=hsiangkao@redhat.com \
    --cc=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    --cc=lixiaokeng@huawei.com \
    --cc=sandeen@redhat.com \
    /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).