Re: [PATCH v2 4/6] mm/fs: add a sync_mode param for clear_page_dirty_for_io()

From: kbuild test robot
Date: Sun Jul 01 2018 - 22:12:18 EST


Hi John,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.18-rc3]
[cannot apply to next-20180629]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/john-hubbard-gmail-com/mm-fs-gup-don-t-unmap-or-drop-filesystem-buffers/20180702-090125
config: x86_64-randconfig-x010-201826 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/checkpoint.c:11:
fs/f2fs/checkpoint.c: In function 'commit_checkpoint':
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
fs/f2fs/checkpoint.c:1200:49: error: invalid type argument of '->' (have 'struct writeback_control')
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> fs/f2fs/checkpoint.c:1200:2: note: in expansion of macro 'if'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~
include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~~~~~~~~~~~~~~
fs/f2fs/checkpoint.c:1200:6: note: in expansion of macro 'unlikely'
if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
^~~~~~~~
--
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/data.c:11:
fs/f2fs/data.c: In function 'f2fs_write_cache_pages':
fs/f2fs/data.c:2021:9: error: too few arguments to function 'clear_page_dirty_for_io'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~
In file included from include/linux/pagemap.h:8:0,
from include/linux/f2fs_fs.h:14,
from fs/f2fs/data.c:12:
include/linux/mm.h:1540:5: note: declared here
int clear_page_dirty_for_io(struct page *page, int sync_mode);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/data.c:11:
include/linux/compiler.h:56:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~
fs/f2fs/data.c:2021:9: error: too few arguments to function 'clear_page_dirty_for_io'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~
In file included from include/linux/pagemap.h:8:0,
from include/linux/f2fs_fs.h:14,
from fs/f2fs/data.c:12:
include/linux/mm.h:1540:5: note: declared here
int clear_page_dirty_for_io(struct page *page, int sync_mode);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/data.c:11:
include/linux/compiler.h:56:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~
fs/f2fs/data.c:2021:9: error: too few arguments to function 'clear_page_dirty_for_io'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~
In file included from include/linux/pagemap.h:8:0,
from include/linux/f2fs_fs.h:14,
from fs/f2fs/data.c:12:
include/linux/mm.h:1540:5: note: declared here
int clear_page_dirty_for_io(struct page *page, int sync_mode);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:10:0,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/data.c:11:
include/linux/compiler.h:56:41: warning: left-hand operand of comma expression has no effect [-Wunused-value]
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> fs/f2fs/data.c:2021:4: note: in expansion of macro 'if'
if (!clear_page_dirty_for_io(page), wbc->sync_mode)
^~

vim +/if +1200 fs/f2fs/checkpoint.c

1179
1180 static void commit_checkpoint(struct f2fs_sb_info *sbi,
1181 void *src, block_t blk_addr)
1182 {
1183 struct writeback_control wbc = {
1184 .for_reclaim = 0,
1185 };
1186
1187 /*
1188 * pagevec_lookup_tag and lock_page again will take
1189 * some extra time. Therefore, f2fs_update_meta_pages and
1190 * f2fs_sync_meta_pages are combined in this function.
1191 */
1192 struct page *page = f2fs_grab_meta_page(sbi, blk_addr);
1193 int err;
1194
1195 memcpy(page_address(page), src, PAGE_SIZE);
1196 set_page_dirty(page);
1197
1198 f2fs_wait_on_page_writeback(page, META, true);
1199 f2fs_bug_on(sbi, PageWriteback(page));
> 1200 if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode)))
1201 f2fs_bug_on(sbi, 1);
1202
1203 /* writeout cp pack 2 page */
1204 err = __f2fs_write_meta_page(page, &wbc, FS_CP_META_IO);
1205 f2fs_bug_on(sbi, err);
1206
1207 f2fs_put_page(page, 0);
1208
1209 /* submit checkpoint (with barrier if NOBARRIER is not set) */
1210 f2fs_submit_merged_write(sbi, META_FLUSH);
1211 }
1212

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip