lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 19 Oct 2020 15:45:35 +0200
From:   Andreas Gruenbacher <agruenba@...hat.com>
To:     Xianting Tian <tian.xianting@....com>
Cc:     Bob Peterson <rpeterso@...hat.com>,
        cluster-devel <cluster-devel@...hat.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gfs2: use helper macro abs()

Hi,

On Mon, Oct 19, 2020 at 10:03 AM Xianting Tian <tian.xianting@....com> wrote:
> Use helper macro abs() to simplify the "x >= y || x <= -y" cmp.
>
> Signed-off-by: Xianting Tian <tian.xianting@....com>
> ---
>  fs/gfs2/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 9f4d9e7be..05eb709de 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -304,7 +304,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
>         if (sdp->sd_args.ar_statfs_percent) {
>                 x = 100 * l_sc->sc_free;
>                 y = m_sc->sc_free * sdp->sd_args.ar_statfs_percent;
> -               if (x >= y || x <= -y)
> +               if (abs(x) >= y)

x and y are signed values, so this really doesn't seem right.

>                         need_sync = 1;
>         }
>         spin_unlock(&sdp->sd_statfs_spin);
> --
> 2.17.1

Thanks,
Andreas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ