On December 8, 2024 at 3:53, SeongJae Park wrote:
I noticed kunit UM build errors as below on mm-unstable, and git bisect points this patch. $ ./tools/testing/kunit/kunit.py run --kunitconfig ./mm/damon/tests/ [...] fs/aio.c:525:71: error: ‘FGP_CREAT’ undeclared (first use in this function); did you mean ‘IPC_CREAT’? 525 | FGP_LOCK | FGP_ACCESSED | FGP_CREAT, | ^~~~~~~~~ | IPC_CREAT fs/aio.c:532:17: error: implicit declaration of function ‘folio_end_read’; did you mean ‘folio_test_head’? [-Werror=implicit-function-declaration] 532 | folio_end_read(folio, true); | ^~~~~~~~~~~~~~ | folio_test_head [...] I also confirmed including pagemap.h on fs/aio.c as below fixes the issue. I would like to hear you or others opinions though, since I'm not familiar with the inclusion routes of the file.
Including unnecessary header files in a .h file is not a good practice. It can lead to troublesome dependency issues in the future. However, based on the testing on your side, this change might cause some other compilation issues, as indicated in your patch. I think all these issues should be resolvable by including the pagemap.h in the .c files instead.