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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 Dec 2019 11:25:11 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Chao Yu <yuchao0@...wei.com>
Cc:     Jaegeuk Kim <jaegeuk@...nel.org>,
        linux-f2fs-devel@...ts.sourceforge.net,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Chao Yu <chao@...nel.org>,
        Linux-Next <linux-next@...r.kernel.org>
Subject: Re: [RFC PATCH v5] f2fs: support data compression

Hi,

On Mon, Dec 16, 2019 at 7:29 AM Chao Yu <yuchao0@...wei.com> wrote:
>
> This patch tries to support compression in f2fs.



> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c

> @@ -667,6 +719,24 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
>         return err;
>  }
>
> +int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
> +{
> +       u64 free_from = from;
> +
> +       /*
> +        * for compressed file, only support cluster size
> +        * aligned truncation.
> +        */
> +       if (f2fs_compressed_file(inode)) {
> +               size_t cluster_size = PAGE_SIZE <<
> +                                       F2FS_I(inode)->i_log_cluster_size;
> +
> +               free_from = roundup(from, cluster_size);

This is a 64-by-32 or 64-by-64 division, causing a link failure on
32-bit platforms:

    fs/f2fs/file.o: In function `f2fs_truncate_blocks':
    file.c:(.text+0x1db4): undefined reference to `__udivdi3'

Please use DIV_ROUND_UP_ULL() instead.

Reported-by: <noreply@...erman.id.au>

> +       }
> +
> +       return do_truncate_blocks(inode, free_from, lock);
> +}


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ