linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* f2fs compile problem in next-20191220 on x86-32
@ 2019-12-22 15:49 Pavel Machek
  2019-12-25 13:04 ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2019-12-22 15:49 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel, kernel list, sfr

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

Hi!

I'm getting this:

  LD      .tmp_vmlinux1
  ld: fs/f2fs/file.o: in function `f2fs_truncate_blocks':
  file.c:(.text+0x2968): undefined reference to `__udivdi3'
  make: *** [Makefile:1079: vmlinux] Error 1

when attempting to compile kernel for x86-32.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: f2fs compile problem in next-20191220 on x86-32
  2019-12-22 15:49 f2fs compile problem in next-20191220 on x86-32 Pavel Machek
@ 2019-12-25 13:04 ` Pavel Machek
  2019-12-26  1:32   ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2019-12-25 13:04 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel, kernel list, sfr, david

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

On Sun 2019-12-22 16:49:17, Pavel Machek wrote:
> Hi!
> 
> I'm getting this:
> 
>   LD      .tmp_vmlinux1
>   ld: fs/f2fs/file.o: in function `f2fs_truncate_blocks':
>   file.c:(.text+0x2968): undefined reference to `__udivdi3'
>   make: *** [Makefile:1079: vmlinux] Error 1
> 
> when attempting to compile kernel for x86-32.

David bisected it:

https://bugzilla.kernel.org/show_bug.cgi?id=205967

And the bug is actually easy to see:

+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);

#define roundup(x, y) (                                 \
{                                                       \
        typeof(y) __y = y;                              \
        (((x) + (__y - 1)) / __y) * __y;                \
}                                                       \

div64 is needed instead of div in the roundup macro. Or actually... It
is quite stupid to use roundup like this on value that is power of
two, right?

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: f2fs compile problem in next-20191220 on x86-32
  2019-12-25 13:04 ` Pavel Machek
@ 2019-12-26  1:32   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2019-12-26  1:32 UTC (permalink / raw)
  To: Pavel Machek, jaegeuk, linux-f2fs-devel, kernel list, sfr, david

On 2019/12/25 21:04, Pavel Machek wrote:
> On Sun 2019-12-22 16:49:17, Pavel Machek wrote:
>> Hi!
>>
>> I'm getting this:
>>
>>   LD      .tmp_vmlinux1
>>   ld: fs/f2fs/file.o: in function `f2fs_truncate_blocks':
>>   file.c:(.text+0x2968): undefined reference to `__udivdi3'
>>   make: *** [Makefile:1079: vmlinux] Error 1
>>
>> when attempting to compile kernel for x86-32.
> 
> David bisected it:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=205967
> 
> And the bug is actually easy to see:
> 
> +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);
> 
> #define roundup(x, y) (                                 \
> {                                                       \
>         typeof(y) __y = y;                              \
>         (((x) + (__y - 1)) / __y) * __y;                \
> }                                                       \
> 
> div64 is needed instead of div in the roundup macro. Or actually... It
> is quite stupid to use roundup like this on value that is power of
> two, right?

This has been fixed in dev branch, could you check that? People still saw this
issue because linux-next did not update after we fix this bug.

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev

Thanks,

> 
> Best regards,
> 									Pavel
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-26  1:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-22 15:49 f2fs compile problem in next-20191220 on x86-32 Pavel Machek
2019-12-25 13:04 ` Pavel Machek
2019-12-26  1:32   ` Chao Yu

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).