linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Chao Yu <chao@kernel.org>,
	Linux-Next <linux-next@vger.kernel.org>
Subject: Re: [RFC PATCH v5] f2fs: support data compression
Date: Thu, 19 Dec 2019 11:25:11 +0100	[thread overview]
Message-ID: <CAMuHMdUDURUQJjJU+2QQgY1hXN8ndJ6dwc-PF1CWc-HAio0sKA@mail.gmail.com> (raw)
In-Reply-To: <20191216062806.112361-1-yuchao0@huawei.com>

Hi,

On Mon, Dec 16, 2019 at 7:29 AM Chao Yu <yuchao0@huawei.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@ellerman.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@linux-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

  parent reply	other threads:[~2019-12-19 10:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  6:28 [RFC PATCH v5] f2fs: support data compression Chao Yu
2019-12-16 11:08 ` Markus Elfring
2019-12-16 13:12   ` Chao Yu
2019-12-16 11:32 ` Markus Elfring
2019-12-16 13:24   ` [f2fs-dev] " Chao Yu
2019-12-16 11:51 ` Markus Elfring
2019-12-16 13:28   ` Chao Yu
2019-12-16 13:38     ` [v5] " Markus Elfring
2019-12-18 21:46 ` [RFC PATCH v5] " Jaegeuk Kim
2019-12-23  3:32   ` Chao Yu
2019-12-23  3:58     ` [f2fs-dev] " Chao Yu
2019-12-23 19:29     ` Jaegeuk Kim
2019-12-31  0:46     ` Jaegeuk Kim
2019-12-31  1:45       ` Chao Yu
2020-01-02 18:18         ` Jaegeuk Kim
2020-01-02 19:00           ` Jaegeuk Kim
2020-01-03  6:50             ` Chao Yu
2020-01-06  9:01               ` [f2fs-dev] " Chao Yu
2020-01-06 18:16                 ` Jaegeuk Kim
2020-01-10 23:52                   ` Jaegeuk Kim
2020-01-11  9:08                     ` Chao Yu
2020-01-11 18:02                       ` Jaegeuk Kim
2020-01-13  8:56                         ` Chao Yu
2020-01-13 16:11                           ` Jaegeuk Kim
2020-01-14  1:52                             ` Chao Yu
2020-01-14 22:48                               ` Jaegeuk Kim
2020-01-15 10:12                                 ` Chao Yu
2020-01-15 21:38                                   ` Jaegeuk Kim
2020-01-03  1:19           ` Chao Yu
2019-12-19  9:53 ` Geert Uytterhoeven
2019-12-23  3:36   ` Chao Yu
2019-12-19 10:18 ` Geert Uytterhoeven
2019-12-19 10:25 ` Geert Uytterhoeven [this message]
2019-12-20 21:26   ` Jaegeuk Kim

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=CAMuHMdUDURUQJjJU+2QQgY1hXN8ndJ6dwc-PF1CWc-HAio0sKA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=yuchao0@huawei.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).