Hi Nikolay, Thank you for the patch! Yet something to improve: [auto build test ERROR on ext4/dev] [also build test ERROR on v4.20-rc6 next-20181207] [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/Nikolay-Borisov/fs-Convert-open-coded-is-inode-open-for-write-check/20181211-023543 base: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev config: i386-randconfig-x006-201849 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All error/warnings (new ones prefixed by >>): fs//ext4/mballoc.c: In function 'ext4_mb_group_or_file': >> fs//ext4/mballoc.c:5362:0: error: unterminated argument list invoking macro "if" } >> fs//ext4/mballoc.c:4179:2: error: expected '(' at end of input if ((size == isize) && !ext4_fs_is_busy(sbi) ^~ >> fs//ext4/mballoc.c:4179:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] fs//ext4/mballoc.c:5362:0: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' } >> fs//ext4/mballoc.c:4179:2: error: expected declaration or statement at end of input if ((size == isize) && !ext4_fs_is_busy(sbi) ^~ At top level: fs//ext4/mballoc.c:4163:13: warning: 'ext4_mb_group_or_file' defined but not used [-Wunused-function] static void ext4_mb_group_or_file(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:4092:13: warning: 'ext4_mb_show_ac' defined but not used [-Wunused-function] static void ext4_mb_show_ac(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3876:1: warning: 'ext4_mb_discard_group_preallocations' defined but not used [-Wunused-function] ext4_mb_discard_group_preallocations(struct super_block *sb, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3774:12: warning: 'ext4_mb_new_preallocation' defined but not used [-Wunused-function] static int ext4_mb_new_preallocation(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3563:13: warning: 'ext4_mb_put_pa' defined but not used [-Wunused-function] static void ext4_mb_put_pa(struct ext4_allocation_context *ac, ^~~~~~~~~~~~~~ fs//ext4/mballoc.c:3399:1: warning: 'ext4_mb_use_preallocated' defined but not used [-Wunused-function] ext4_mb_use_preallocated(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3282:13: warning: 'ext4_discard_allocated_blocks' defined but not used [-Wunused-function] static void ext4_discard_allocated_blocks(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3253:13: warning: 'ext4_mb_collect_stats' defined but not used [-Wunused-function] static void ext4_mb_collect_stats(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:3059:1: warning: 'ext4_mb_normalize_request' defined but not used [-Wunused-function] ext4_mb_normalize_request(struct ext4_allocation_context *ac, ^~~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:2921:1: warning: 'ext4_mb_mark_diskspace_used' defined but not used [-Wunused-function] ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ fs//ext4/mballoc.c:2099:1: warning: 'ext4_mb_regular_allocator' defined but not used [-Wunused-function] ext4_mb_regular_allocator(struct ext4_allocation_context *ac) ^~~~~~~~~~~~~~~~~~~~~~~~~ vim +/if +5362 fs//ext4/mballoc.c 0c9ec4be Darrick J. Wong 2017-04-30 5314 0c9ec4be Darrick J. Wong 2017-04-30 5315 /* Iterate all the free extents in the group. */ 0c9ec4be Darrick J. Wong 2017-04-30 5316 int 0c9ec4be Darrick J. Wong 2017-04-30 5317 ext4_mballoc_query_range( 0c9ec4be Darrick J. Wong 2017-04-30 5318 struct super_block *sb, 0c9ec4be Darrick J. Wong 2017-04-30 5319 ext4_group_t group, 0c9ec4be Darrick J. Wong 2017-04-30 5320 ext4_grpblk_t start, 0c9ec4be Darrick J. Wong 2017-04-30 5321 ext4_grpblk_t end, 0c9ec4be Darrick J. Wong 2017-04-30 5322 ext4_mballoc_query_range_fn formatter, 0c9ec4be Darrick J. Wong 2017-04-30 5323 void *priv) 0c9ec4be Darrick J. Wong 2017-04-30 5324 { 0c9ec4be Darrick J. Wong 2017-04-30 5325 void *bitmap; 0c9ec4be Darrick J. Wong 2017-04-30 5326 ext4_grpblk_t next; 0c9ec4be Darrick J. Wong 2017-04-30 5327 struct ext4_buddy e4b; 0c9ec4be Darrick J. Wong 2017-04-30 5328 int error; 0c9ec4be Darrick J. Wong 2017-04-30 5329 0c9ec4be Darrick J. Wong 2017-04-30 5330 error = ext4_mb_load_buddy(sb, group, &e4b); 0c9ec4be Darrick J. Wong 2017-04-30 5331 if (error) 0c9ec4be Darrick J. Wong 2017-04-30 5332 return error; 0c9ec4be Darrick J. Wong 2017-04-30 5333 bitmap = e4b.bd_bitmap; 0c9ec4be Darrick J. Wong 2017-04-30 5334 0c9ec4be Darrick J. Wong 2017-04-30 5335 ext4_lock_group(sb, group); 0c9ec4be Darrick J. Wong 2017-04-30 5336 0c9ec4be Darrick J. Wong 2017-04-30 5337 start = (e4b.bd_info->bb_first_free > start) ? 0c9ec4be Darrick J. Wong 2017-04-30 5338 e4b.bd_info->bb_first_free : start; 0c9ec4be Darrick J. Wong 2017-04-30 5339 if (end >= EXT4_CLUSTERS_PER_GROUP(sb)) 0c9ec4be Darrick J. Wong 2017-04-30 5340 end = EXT4_CLUSTERS_PER_GROUP(sb) - 1; 0c9ec4be Darrick J. Wong 2017-04-30 5341 0c9ec4be Darrick J. Wong 2017-04-30 5342 while (start <= end) { 0c9ec4be Darrick J. Wong 2017-04-30 5343 start = mb_find_next_zero_bit(bitmap, end + 1, start); 0c9ec4be Darrick J. Wong 2017-04-30 5344 if (start > end) 0c9ec4be Darrick J. Wong 2017-04-30 5345 break; 0c9ec4be Darrick J. Wong 2017-04-30 5346 next = mb_find_next_bit(bitmap, end + 1, start); 0c9ec4be Darrick J. Wong 2017-04-30 5347 0c9ec4be Darrick J. Wong 2017-04-30 5348 ext4_unlock_group(sb, group); 0c9ec4be Darrick J. Wong 2017-04-30 5349 error = formatter(sb, group, start, next - start, priv); 0c9ec4be Darrick J. Wong 2017-04-30 5350 if (error) 0c9ec4be Darrick J. Wong 2017-04-30 5351 goto out_unload; 0c9ec4be Darrick J. Wong 2017-04-30 5352 ext4_lock_group(sb, group); 0c9ec4be Darrick J. Wong 2017-04-30 5353 0c9ec4be Darrick J. Wong 2017-04-30 5354 start = next + 1; 0c9ec4be Darrick J. Wong 2017-04-30 5355 } 0c9ec4be Darrick J. Wong 2017-04-30 5356 0c9ec4be Darrick J. Wong 2017-04-30 5357 ext4_unlock_group(sb, group); 0c9ec4be Darrick J. Wong 2017-04-30 5358 out_unload: 0c9ec4be Darrick J. Wong 2017-04-30 5359 ext4_mb_unload_buddy(&e4b); 0c9ec4be Darrick J. Wong 2017-04-30 5360 0c9ec4be Darrick J. Wong 2017-04-30 5361 return error; 0c9ec4be Darrick J. Wong 2017-04-30 @5362 } :::::: The code at line 5362 was first introduced by commit :::::: 0c9ec4beecac94cb450c8abb2ac8b7e8a79240ea ext4: support GETFSMAP ioctls :::::: TO: Darrick J. Wong :::::: CC: Theodore Ts'o --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation