Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patching file mm/mmap.c fails for kernel 6.11.3 #47

Open
vladns opened this issue Oct 12, 2024 · 30 comments
Open

patching file mm/mmap.c fails for kernel 6.11.3 #47

vladns opened this issue Oct 12, 2024 · 30 comments

Comments

@vladns
Copy link

vladns commented Oct 12, 2024

  -> Found linux-6.11.3.tar.xz
  -> Found linux-6.11.3.tar.sign
  -> Found linux-v6.11.3-arch1.patch.zst
  -> Found linux-v6.11.3-arch1.patch.zst.sig
  -> Found config
  -> Found aufs6-base.patch
  -> Found aufs6-kbuild.patch
  -> Found aufs6-mmap.patch
  -> Found aufs6-standalone.patch
  -> Found vfs-ino.patch
  -> Found Kconfig.patch
  -> Found regd.c.patch
==> Generating checksums for source files...
==> Making package: linux-aufs 6.11.3.arch1-1 (Сб 12 окт 2024 20:23:10)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found linux-6.11.3.tar.xz
  -> Found linux-6.11.3.tar.sign
  -> Found linux-v6.11.3-arch1.patch.zst
  -> Found linux-v6.11.3-arch1.patch.zst.sig
  -> Found config
  -> Found aufs6-base.patch
  -> Found aufs6-kbuild.patch
  -> Found aufs6-mmap.patch
  -> Found aufs6-standalone.patch
  -> Found vfs-ino.patch
  -> Found Kconfig.patch
  -> Found regd.c.patch
==> WARNING: Skipping verification of source file PGP signatures.
==> Validating source files with sha256sums...
    linux-6.11.3.tar.xz ... Passed
    linux-6.11.3.tar.sign ... Skipped
    linux-v6.11.3-arch1.patch.zst ... Passed
    linux-v6.11.3-arch1.patch.zst.sig ... Skipped
    config ... Passed
    aufs6-base.patch ... Passed
    aufs6-kbuild.patch ... Passed
    aufs6-mmap.patch ... Passed
    aufs6-standalone.patch ... Passed
    vfs-ino.patch ... Passed
    Kconfig.patch ... Passed
    regd.c.patch ... Passed
==> Validating source files with b2sums...
    linux-6.11.3.tar.xz ... Passed
    linux-6.11.3.tar.sign ... Skipped
    linux-v6.11.3-arch1.patch.zst ... Passed
    linux-v6.11.3-arch1.patch.zst.sig ... Skipped
    config ... Passed
    aufs6-base.patch ... Passed
    aufs6-kbuild.patch ... Passed
    aufs6-mmap.patch ... Passed
    aufs6-standalone.patch ... Passed
    vfs-ino.patch ... Passed
    Kconfig.patch ... Passed
    regd.c.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting linux-6.11.3.tar.xz with bsdtar
  -> Extracting linux-v6.11.3-arch1.patch.zst with zstd
==> Starting prepare()...
Setting version...
Copy directory aufs...
Copy driver for ax88179...
Applying patch linux-v6.11.3-arch1.patch...
patching file Makefile
patching file arch/Kconfig
patching file drivers/firmware/sysfb.c
patching file include/linux/user_namespace.h
patching file init/Kconfig
patching file kernel/fork.c
patching file kernel/sysctl.c
patching file kernel/user_namespace.c
Applying patch aufs6-base.patch...
patching file MAINTAINERS
patching file drivers/block/loop.c
patching file fs/dcache.c
patching file fs/fcntl.c
patching file fs/namespace.c
patching file fs/splice.c
patching file include/linux/fs.h
patching file include/linux/lockdep.h
patching file include/linux/mnt_namespace.h
patching file include/linux/splice.h
patching file kernel/locking/lockdep.c
Applying patch aufs6-kbuild.patch...
patching file fs/Kconfig
patching file fs/Makefile
Applying patch aufs6-mmap.patch...
patching file fs/proc/base.c
Hunk #1 succeeded at 2272 (offset 59 lines).
patching file fs/proc/nommu.c
patching file fs/proc/task_mmu.c
patching file fs/proc/task_nommu.c
patching file include/linux/mm.h
patching file include/linux/mm_types.h
patching file kernel/fork.c
Hunk #1 succeeded at 737 (offset 4 lines).
patching file mm/Makefile
patching file mm/filemap.c
Hunk #1 succeeded at 3677 (offset 4 lines).
patching file mm/mmap.c
Hunk #7 FAILED at 3200.
Hunk #8 succeeded at 3558 (offset 4 lines).
Hunk #9 succeeded at 3572 (offset 4 lines).
1 out of 9 hunks FAILED -- saving rejects to file mm/mmap.c.rej
patching file mm/nommu.c
patching file mm/prfile.c
==> ERROR: A failure occurred in prepare().
    Aborting...```
@sfjro
Copy link
Owner

sfjro commented Oct 13, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 13, 2024

Thanks, but there are still errors:

fs/aufs/hfsnotify.c: In function ‘au_hfsn_free_mark’:
./include/linux/container_of.h:20:54: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   20 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
...
././include/linux/compiler_types.h:451:27: error: expression in static assertion is not an integer
  451 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
...
./include/linux/stddef.h:16:33: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
...
fs/aufs/hfsnotify.c:36:9: error: implicit declaration of function ‘au_cache_free_hnotify’; did you mean ‘au_cache_free_vdir’? [-Wimplicit-function-declaration]
   36 |         au_cache_free_hnotify(hn);
      |         ^~~~~~~~~~~~~~~~~~~~~
      |         au_cache_free_vdir
fs/aufs/hfsnotify.c: In function ‘au_hfsn_alloc’:
fs/aufs/hfsnotify.c:51:20: error: ‘struct au_hinode’ has no member named ‘hi_notify’
   51 |         hn = hinode->hi_notify;
      |                    ^~
fs/aufs/hfsnotify.c:52:16: error: ‘struct au_hnotify’ has no member named ‘hn_aufs_inode’
   52 |         sb = hn->hn_aufs_inode->i_sb;
      |                ^~
fs/aufs/hfsnotify.c:57:19: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   57 |         mark = &hn->hn_mark;
      |                   ^~
fs/aufs/hfsnotify.c: In function ‘au_hfsn_free’:
fs/aufs/hfsnotify.c:80:19: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   80 |         mark = &hn->hn_mark;
      |                   ^~
fs/aufs/hfsnotify.c: In function ‘au_hfsn_ctl’:
fs/aufs/hfsnotify.c:101:23: error: ‘struct au_hinode’ has no member named ‘hi_notify’
  101 |         mark = &hinode->hi_notify->hn_mark;
      |                       ^~
fs/aufs/hfsnotify.c: In function ‘au_hfsn_handle_event’:
./include/linux/container_of.h:20:54: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   20 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||       \
...
././include/linux/compiler_types.h:451:27: error: expression in static assertion is not an integer
  451 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
...
./include/linux/stddef.h:16:33: error: ‘struct au_hnotify’ has no member named ‘hn_mark’
   16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
...
fs/aufs/hfsnotify.c:199:15: error: implicit declaration of function ‘au_hnotify’; did you mean ‘au_hnotify_fin’? [-Wimplicit-function-declaration]
  199 |         err = au_hnotify(h_dir, hnotify, mask, file_name, h_inode);
      |               ^~~~~~~~~~
      |               au_hnotify_fin
fs/aufs/hfsnotify.c: At top level:
fs/aufs/hfsnotify.c:280:14: error: variable ‘au_hnotify_op’ has initializer but incomplete type
  280 | const struct au_hnotify_op au_hnotify_op = {
      |              ^~~~~~~~~~~~~
fs/aufs/hfsnotify.c:281:10: error: ‘const struct au_hnotify_op’ has no member named ‘ctl’
  281 |         .ctl            = au_hfsn_ctl,
      |          ^~~
fs/aufs/hfsnotify.c:281:27: warning: excess elements in struct initializer
  281 |         .ctl            = au_hfsn_ctl,
      |                           ^~~~~~~~~~~
fs/aufs/hfsnotify.c:281:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:282:10: error: ‘const struct au_hnotify_op’ has no member named ‘alloc’
  282 |         .alloc          = au_hfsn_alloc,
      |          ^~~~~
fs/aufs/hfsnotify.c:282:27: warning: excess elements in struct initializer
  282 |         .alloc          = au_hfsn_alloc,
      |                           ^~~~~~~~~~~~~
fs/aufs/hfsnotify.c:282:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:283:10: error: ‘const struct au_hnotify_op’ has no member named ‘free’
  283 |         .free           = au_hfsn_free,
      |          ^~~~
fs/aufs/hfsnotify.c:283:27: warning: excess elements in struct initializer
  283 |         .free           = au_hfsn_free,
      |                           ^~~~~~~~~~~~
fs/aufs/hfsnotify.c:283:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:285:10: error: ‘const struct au_hnotify_op’ has no member named ‘fin’
  285 |         .fin            = au_hfsn_fin,
      |          ^~~
fs/aufs/hfsnotify.c:285:27: warning: excess elements in struct initializer
  285 |         .fin            = au_hfsn_fin,
      |                           ^~~~~~~~~~~
fs/aufs/hfsnotify.c:285:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:287:10: error: ‘const struct au_hnotify_op’ has no member named ‘reset_br’
  287 |         .reset_br       = au_hfsn_reset_br,
      |          ^~~~~~~~
fs/aufs/hfsnotify.c:287:27: warning: excess elements in struct initializer
  287 |         .reset_br       = au_hfsn_reset_br,
      |                           ^~~~~~~~~~~~~~~~
fs/aufs/hfsnotify.c:287:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:288:10: error: ‘const struct au_hnotify_op’ has no member named ‘fin_br’
  288 |         .fin_br         = au_hfsn_fin_br,
      |          ^~~~~~
fs/aufs/hfsnotify.c:288:27: warning: excess elements in struct initializer
  288 |         .fin_br         = au_hfsn_fin_br,
      |                           ^~~~~~~~~~~~~~
fs/aufs/hfsnotify.c:288:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:289:10: error: ‘const struct au_hnotify_op’ has no member named ‘init_br’
  289 |         .init_br        = au_hfsn_init_br
      |          ^~~~~~~
fs/aufs/hfsnotify.c:289:27: warning: excess elements in struct initializer
  289 |         .init_br        = au_hfsn_init_br
      |                           ^~~~~~~~~~~~~~~
fs/aufs/hfsnotify.c:289:27: note: (near initialization for ‘au_hnotify_op’)
fs/aufs/hfsnotify.c:280:28: error: storage size of ‘au_hnotify_op’ isn’t known
  280 | const struct au_hnotify_op au_hnotify_op = {
      |                            ^~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:244: fs/aufs/hfsnotify.o] Error 1
make[3]: *** [scripts/Makefile.build:485: fs/aufs] Error 2

@sfjro
Copy link
Owner

sfjro commented Oct 13, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 15, 2024

In my config, there is only one setting, concerning aufs CONFIG_AUFS_FS=m. It is entered via a script, into the original config file.
Where is this kconfig you are talking about located?
Apparently this file is located at /build/linux/src/linux-6.11.3/fs/aufs/Kconfig. I compared it with the file at /build/aufs-standalone/fs/aufs/Kconfig using the cmp command, it didn't output anything. I didn't edit this file, it was just copied to the build location.

@sfjro
Copy link
Owner

sfjro commented Oct 15, 2024 via email

@fulalas
Copy link

fulalas commented Oct 17, 2024

I confirm kernel 6.11.3 builds just fine using AUFS branch 6.11.2.

@vladns
Copy link
Author

vladns commented Oct 17, 2024

Where should this CONFIG_AUFS_HFSNOTIFY setting be?

@roadie2
Copy link

roadie2 commented Oct 17, 2024

I found with kernel 6.11.2 as well as 6.11.4, that CONFIG_AUFS_HFSNOTIFY=y must be enabled in the kernel config. If it is disabled, the patches apply well, but I get the same errors as vladns. This is using aufs6-6.11.2 patchset.

With CONFIG_AUFS_HFSNOTIFY=y, the kernel builds and boots properly.

@sfjro
Copy link
Owner

sfjro commented Oct 17, 2024 via email

@sfjro
Copy link
Owner

sfjro commented Oct 17, 2024 via email

@fulalas
Copy link

fulalas commented Oct 17, 2024

@sfjro, do you mind explaining to us is what is the benefit of enabling CONFIG_AUFS_HNOTIFY and CONFIG_AUFS_HFSNOTIFY?

@sfjro
Copy link
Owner

sfjro commented Oct 17, 2024 via email

@fulalas
Copy link

fulalas commented Oct 17, 2024

Maybe, but I don't have the links. I couldn't find anything here: https://aufs.sourceforge.net/aufs6/man.html

@sfjro
Copy link
Owner

sfjro commented Oct 17, 2024 via email

@fulalas
Copy link

fulalas commented Oct 17, 2024

Do you have any URL or could you provide the explanation to both CONFIG_AUFS_HNOTIFY and CONFIG_AUFS_HFSNOTIFY?

Thanks!

@sfjro
Copy link
Owner

sfjro commented Oct 17, 2024 via email

@fulalas
Copy link

fulalas commented Oct 17, 2024

It's not a 404 -- the link opens but I couldn't find anything useful regarding these 2 things, even outside the link (i.e. google).

It looks like you also can't find anything specific, but that's OK. I was just curious. :)

@sfjro
Copy link
Owner

sfjro commented Oct 18, 2024 via email

@fulalas
Copy link

fulalas commented Oct 18, 2024

Sorry, no link, no progress.

Edit: found it:

config AUFS_HNOTIFY

@vladns
Copy link
Author

vladns commented Oct 18, 2024

If I don't explicitly change these settings, what are their default values?

@sfjro
Copy link
Owner

sfjro commented Oct 18, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 19, 2024

Unfortunately, I am not an expert and I do not understand much. I just follow the instructions. I have never changed these values. The last kernel that built normally for me was 6.10.10. Then my archlinux switched to 6.11.2, after that the problems began.

@vladns
Copy link
Author

vladns commented Oct 19, 2024

I found with kernel 6.11.2 as well as 6.11.4, that CONFIG_AUFS_HFSNOTIFY=y must be enabled in the kernel config. If it is disabled, the patches apply well, but I get the same errors as vladns. This is using aufs6-6.11.2 patchset.

With CONFIG_AUFS_HFSNOTIFY=y, the kernel builds and boots properly.

This doesn't help me, the error is the same.

@sfjro
Copy link
Owner

sfjro commented Oct 19, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 19, 2024

Compile error in fs/aufs/hfsnotify.c?

Yes.

What is "the instructions" you call here?

From the readme, here it is:
For aufs-standalone tree,
There are several ways to build.

and so on.
My build is successful if I explicitly specify "CONFIG_AUFS_HFSNOTIFY=y" and "CONFIG_AUFS_HNOTIFY=y" in the linux config file.

@sfjro
Copy link
Owner

sfjro commented Oct 19, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 19, 2024

And you want to disable them, right?

Yes, I turned it off, the same errors occurred.

CONFIG_AUFS_FS=m
CONFIG_AUFS_BRANCH_MAX_127=y
# CONFIG_AUFS_BRANCH_MAX_511 is not set
# CONFIG_AUFS_BRANCH_MAX_1023 is not set
# CONFIG_AUFS_BRANCH_MAX_32767 is not set
CONFIG_AUFS_SBILIST=y
# CONFIG_AUFS_HNOTIFY is not set
CONFIG_AUFS_HFSNOTIFY=y
# CONFIG_AUFS_EXPORT is not set
# CONFIG_AUFS_XATTR is not set
# CONFIG_AUFS_FHSM is not set
# CONFIG_AUFS_RDU is not set
# CONFIG_AUFS_DIRREN is not set
# CONFIG_AUFS_SHWH is not set
# CONFIG_AUFS_BR_RAMFS is not set
# CONFIG_AUFS_BR_FUSE is not set
CONFIG_AUFS_BR_HFSPLUS=y
CONFIG_AUFS_BDEV_LOOP=y
# CONFIG_AUFS_DEBUG is not set

Here "CONFIG_AUFS_HFSNOTIFY=n" and "CONFIG_AUFS_HNOTIFY=n" in config, although I see that CONFIG_AUFS_HFSNOTIFY=y.

@sfjro
Copy link
Owner

sfjro commented Oct 19, 2024 via email

@vladns
Copy link
Author

vladns commented Oct 20, 2024

Yes, the kernel build is successful.

@sfjro
Copy link
Owner

sfjro commented Oct 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants