2022-06-15 07:09:36

by Ren Zhijie

[permalink] [raw]
Subject: [PATCH -next] f2fs: fix build error too many arguments to functions

If CONFIG_F2FS_FS_COMPRESSION is not set.

make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this:
fs/f2fs/data.c: In function ‘f2fs_finish_read_bio’:
fs/f2fs/data.c:136:5: error: too many arguments to function ‘f2fs_end_read_compressed_page’
f2fs_end_read_compressed_page(page, true, 0,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:0:
fs/f2fs/f2fs.h:4228:20: note: declared here
static inline void f2fs_end_read_compressed_page(struct page *page,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/f2fs/data.c:138:4: error: too many arguments to function ‘f2fs_put_page_dic’
f2fs_put_page_dic(page, in_softirq);
^~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:0:
fs/f2fs/f2fs.h:4233:20: note: declared here
static inline void f2fs_put_page_dic(struct page *page)
^~~~~~~~~~~~~~~~~
fs/f2fs/data.c: In function ‘f2fs_handle_step_decompress’:
fs/f2fs/data.c:241:4: error: too many arguments to function ‘f2fs_end_read_compressed_page’
f2fs_end_read_compressed_page(page, PageError(page),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:0:
fs/f2fs/f2fs.h:4228:20: note: declared here
static inline void f2fs_end_read_compressed_page(struct page *page,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [fs/f2fs/data.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [fs/f2fs] Error 2

Since commit 1b565702dffe ("f2fs: handle decompress only post processing in softirq")
had changed the definition of function "f2fs_end_read_compressed_page()" and "f2fs_put_page_dic()",
but forgot the other definitions in f2fs.h warpped by #else /* CONFIG_F2FS_FS_COMPRESSION */.

Reported-by: Hulk Robot <[email protected]>
Fixes: 1b565702dffe("f2fs: handle decompress only post processing in softirq")
Signed-off-by: Ren Zhijie <[email protected]>
---
fs/f2fs/f2fs.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index b42fcca030e2..0811a9335dde 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -4225,12 +4225,12 @@ static inline struct page *f2fs_compress_control_page(struct page *page)
static inline int f2fs_init_compress_mempool(void) { return 0; }
static inline void f2fs_destroy_compress_mempool(void) { }
static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic) { }
-static inline void f2fs_end_read_compressed_page(struct page *page,
- bool failed, block_t blkaddr)
+static inline void f2fs_end_read_compressed_page(struct page *page, bool failed,
+ block_t blkaddr, bool in_softirq)
{
WARN_ON_ONCE(1);
}
-static inline void f2fs_put_page_dic(struct page *page)
+static inline void f2fs_put_page_dic(struct page *page, bool in_softirq)
{
WARN_ON_ONCE(1);
}
--
2.17.1


2022-06-15 15:12:59

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH -next] f2fs: fix build error too many arguments to functions

Hi Ren,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20220615]

url: https://github.com/intel-lab-lkp/linux/commits/Ren-Zhijie/f2fs-fix-build-error-too-many-arguments-to-functions/20220615-150808
base: 6012273897fefb12566580efedee10bb06e5e6ed
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20220615/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/1832104c73270fad342bf40c089542083dca7585
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Ren-Zhijie/f2fs-fix-build-error-too-many-arguments-to-functions/20220615-150808
git checkout 1832104c73270fad342bf40c089542083dca7585
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/f2fs/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

fs/f2fs/data.c: In function 'f2fs_finish_read_bio':
>> fs/f2fs/data.c:136:33: error: too few arguments to function 'f2fs_end_read_compressed_page'
136 | f2fs_end_read_compressed_page(page, true, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:
fs/f2fs/f2fs.h:4226:20: note: declared here
4226 | static inline void f2fs_end_read_compressed_page(struct page *page, bool failed,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/f2fs/data.c:137:25: error: too few arguments to function 'f2fs_put_page_dic'
137 | f2fs_put_page_dic(page);
| ^~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:
fs/f2fs/f2fs.h:4231:20: note: declared here
4231 | static inline void f2fs_put_page_dic(struct page *page, bool in_softirq)
| ^~~~~~~~~~~~~~~~~
fs/f2fs/data.c: In function 'f2fs_handle_step_decompress':
fs/f2fs/data.c:239:25: error: too few arguments to function 'f2fs_end_read_compressed_page'
239 | f2fs_end_read_compressed_page(page, PageError(page),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/f2fs/data.c:25:
fs/f2fs/f2fs.h:4226:20: note: declared here
4226 | static inline void f2fs_end_read_compressed_page(struct page *page, bool failed,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/f2fs_end_read_compressed_page +136 fs/f2fs/data.c

6dbb17961f46b2 Eric Biggers 2018-04-18 121
7f59b277f79e8a Eric Biggers 2021-01-04 122 static void f2fs_finish_read_bio(struct bio *bio)
93dfe2ac516250 Jaegeuk Kim 2013-11-30 123 {
6dbb17961f46b2 Eric Biggers 2018-04-18 124 struct bio_vec *bv;
6dc4f100c175dd Ming Lei 2019-02-15 125 struct bvec_iter_all iter_all;
93dfe2ac516250 Jaegeuk Kim 2013-11-30 126
7f59b277f79e8a Eric Biggers 2021-01-04 127 /*
7f59b277f79e8a Eric Biggers 2021-01-04 128 * Update and unlock the bio's pagecache pages, and put the
7f59b277f79e8a Eric Biggers 2021-01-04 129 * decompression context for any compressed pages.
7f59b277f79e8a Eric Biggers 2021-01-04 130 */
2b070cfe582b8e Christoph Hellwig 2019-04-25 131 bio_for_each_segment_all(bv, bio, iter_all) {
7f59b277f79e8a Eric Biggers 2021-01-04 132 struct page *page = bv->bv_page;
6dbb17961f46b2 Eric Biggers 2018-04-18 133
7f59b277f79e8a Eric Biggers 2021-01-04 134 if (f2fs_is_compressed_page(page)) {
7f59b277f79e8a Eric Biggers 2021-01-04 135 if (bio->bi_status)
6ce19aff0b8cd3 Chao Yu 2021-05-20 @136 f2fs_end_read_compressed_page(page, true, 0);
7f59b277f79e8a Eric Biggers 2021-01-04 @137 f2fs_put_page_dic(page);
4c8ff7095bef64 Chao Yu 2019-11-01 138 continue;
4c8ff7095bef64 Chao Yu 2019-11-01 139 }
4c8ff7095bef64 Chao Yu 2019-11-01 140
7f59b277f79e8a Eric Biggers 2021-01-04 141 /* PG_error was set if decryption or verity failed. */
6dbb17961f46b2 Eric Biggers 2018-04-18 142 if (bio->bi_status || PageError(page)) {
6dbb17961f46b2 Eric Biggers 2018-04-18 143 ClearPageUptodate(page);
fb7d70db305a14 Jaegeuk Kim 2018-09-25 144 /* will re-read again later */
fb7d70db305a14 Jaegeuk Kim 2018-09-25 145 ClearPageError(page);
6dbb17961f46b2 Eric Biggers 2018-04-18 146 } else {
6dbb17961f46b2 Eric Biggers 2018-04-18 147 SetPageUptodate(page);
6dbb17961f46b2 Eric Biggers 2018-04-18 148 }
5f9abab42b60e6 Jaegeuk Kim 2018-10-16 149 dec_page_count(F2FS_P_SB(page), __read_io_type(page));
6dbb17961f46b2 Eric Biggers 2018-04-18 150 unlock_page(page);
6dbb17961f46b2 Eric Biggers 2018-04-18 151 }
79bbefb19f1359 Chao Yu 2020-03-23 152
7f59b277f79e8a Eric Biggers 2021-01-04 153 if (bio->bi_private)
7f59b277f79e8a Eric Biggers 2021-01-04 154 mempool_free(bio->bi_private, bio_post_read_ctx_pool);
7f59b277f79e8a Eric Biggers 2021-01-04 155 bio_put(bio);
4c8ff7095bef64 Chao Yu 2019-11-01 156 }
4c8ff7095bef64 Chao Yu 2019-11-01 157

--
0-DAY CI Kernel Test Service
https://01.org/lkp

2022-06-15 17:29:13

by Jaegeuk Kim

[permalink] [raw]
Subject: Re: [PATCH -next] f2fs: fix build error too many arguments to functions

Thanks, but I deqeued the buggy patch, so expect to get the right change
later.

On 06/15, Ren Zhijie wrote:
> If CONFIG_F2FS_FS_COMPRESSION is not set.
>
> make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this:
> fs/f2fs/data.c: In function ‘f2fs_finish_read_bio’:
> fs/f2fs/data.c:136:5: error: too many arguments to function ‘f2fs_end_read_compressed_page’
> f2fs_end_read_compressed_page(page, true, 0,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/f2fs/data.c:25:0:
> fs/f2fs/f2fs.h:4228:20: note: declared here
> static inline void f2fs_end_read_compressed_page(struct page *page,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/f2fs/data.c:138:4: error: too many arguments to function ‘f2fs_put_page_dic’
> f2fs_put_page_dic(page, in_softirq);
> ^~~~~~~~~~~~~~~~~
> In file included from fs/f2fs/data.c:25:0:
> fs/f2fs/f2fs.h:4233:20: note: declared here
> static inline void f2fs_put_page_dic(struct page *page)
> ^~~~~~~~~~~~~~~~~
> fs/f2fs/data.c: In function ‘f2fs_handle_step_decompress’:
> fs/f2fs/data.c:241:4: error: too many arguments to function ‘f2fs_end_read_compressed_page’
> f2fs_end_read_compressed_page(page, PageError(page),
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/f2fs/data.c:25:0:
> fs/f2fs/f2fs.h:4228:20: note: declared here
> static inline void f2fs_end_read_compressed_page(struct page *page,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[2]: *** [fs/f2fs/data.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [fs/f2fs] Error 2
>
> Since commit 1b565702dffe ("f2fs: handle decompress only post processing in softirq")
> had changed the definition of function "f2fs_end_read_compressed_page()" and "f2fs_put_page_dic()",
> but forgot the other definitions in f2fs.h warpped by #else /* CONFIG_F2FS_FS_COMPRESSION */.
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes: 1b565702dffe("f2fs: handle decompress only post processing in softirq")
> Signed-off-by: Ren Zhijie <[email protected]>
> ---
> fs/f2fs/f2fs.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index b42fcca030e2..0811a9335dde 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4225,12 +4225,12 @@ static inline struct page *f2fs_compress_control_page(struct page *page)
> static inline int f2fs_init_compress_mempool(void) { return 0; }
> static inline void f2fs_destroy_compress_mempool(void) { }
> static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic) { }
> -static inline void f2fs_end_read_compressed_page(struct page *page,
> - bool failed, block_t blkaddr)
> +static inline void f2fs_end_read_compressed_page(struct page *page, bool failed,
> + block_t blkaddr, bool in_softirq)
> {
> WARN_ON_ONCE(1);
> }
> -static inline void f2fs_put_page_dic(struct page *page)
> +static inline void f2fs_put_page_dic(struct page *page, bool in_softirq)
> {
> WARN_ON_ONCE(1);
> }
> --
> 2.17.1