Message ID | 20180702005654.20369-5-jhubbard@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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
Hi John, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR 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: i386-randconfig-x075-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=i386 All errors (new ones prefixed by >>): fs/f2fs/dir.c: In function 'f2fs_delete_entry': >> fs/f2fs/dir.c:734:33: error: 'WB_SYNC_ALL' undeclared (first use in this function); did you mean 'FS_SYNC_FL'? clear_page_dirty_for_io(page, WB_SYNC_ALL); ^~~~~~~~~~~ FS_SYNC_FL fs/f2fs/dir.c:734:33: note: each undeclared identifier is reported only once for each function it appears in -- fs/f2fs/inline.c: In function 'f2fs_convert_inline_page': >> fs/f2fs/inline.c:139:50: error: dereferencing pointer to incomplete type 'struct writeback_control' dirty = clear_page_dirty_for_io(page, fio.io_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/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:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ -- 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) ^~~~~~~~~~~~~~~~~~~~~~~ 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); ^~~~~~~~~~~~~~~~~~~~~~~ fs/f2fs/data.c:2021:38: warning: left-hand operand of comma expression has no effect [-Wunused-value] if (!clear_page_dirty_for_io(page), wbc->sync_mode) ^ vim +734 fs/f2fs/dir.c 690 691 /* 692 * It only removes the dentry from the dentry page, corresponding name 693 * entry in name page does not need to be touched during deletion. 694 */ 695 void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, 696 struct inode *dir, struct inode *inode) 697 { 698 struct f2fs_dentry_block *dentry_blk; 699 unsigned int bit_pos; 700 int slots = GET_DENTRY_SLOTS(le16_to_cpu(dentry->name_len)); 701 int i; 702 703 f2fs_update_time(F2FS_I_SB(dir), REQ_TIME); 704 705 if (F2FS_OPTION(F2FS_I_SB(dir)).fsync_mode == FSYNC_MODE_STRICT) 706 f2fs_add_ino_entry(F2FS_I_SB(dir), dir->i_ino, TRANS_DIR_INO); 707 708 if (f2fs_has_inline_dentry(dir)) 709 return f2fs_delete_inline_entry(dentry, page, dir, inode); 710 711 lock_page(page); 712 f2fs_wait_on_page_writeback(page, DATA, true); 713 714 dentry_blk = page_address(page); 715 bit_pos = dentry - dentry_blk->dentry; 716 for (i = 0; i < slots; i++) 717 __clear_bit_le(bit_pos + i, &dentry_blk->dentry_bitmap); 718 719 /* Let's check and deallocate this dentry page */ 720 bit_pos = find_next_bit_le(&dentry_blk->dentry_bitmap, 721 NR_DENTRY_IN_BLOCK, 722 0); 723 set_page_dirty(page); 724 725 dir->i_ctime = dir->i_mtime = current_time(dir); 726 f2fs_mark_inode_dirty_sync(dir, false); 727 728 if (inode) 729 f2fs_drop_nlink(dir, inode); 730 731 if (bit_pos == NR_DENTRY_IN_BLOCK && 732 !f2fs_truncate_hole(dir, page->index, page->index + 1)) { 733 f2fs_clear_radix_tree_dirty_tag(page); > 734 clear_page_dirty_for_io(page, WB_SYNC_ALL); 735 ClearPagePrivate(page); 736 ClearPageUptodate(page); 737 inode_dec_dirty_pages(dir); 738 f2fs_remove_dirty_inode(dir); 739 } 740 f2fs_put_page(page, 1); 741 } 742 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
On 07/01/2018 07:11 PM, kbuild test robot wrote: > 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 > [...] > ^ > 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) > ^~ > Typo, that should have been: if (!clear_page_dirty_for_io(page, wbc->sync_mode)) ...fixed locally, I'll include it in the next spin. (Somehow my last build didn't have all the filesystems enabled, sorry for the glitches.) thanks,
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index e1cbdfdb7c68..35572f150b31 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -221,7 +221,7 @@ static int v9fs_launder_page(struct page *page) struct inode *inode = page->mapping->host; v9fs_fscache_wait_on_page_write(inode, page); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, WB_SYNC_NONE)) { retval = v9fs_vfs_writepage_locked(page); if (retval) return retval; diff --git a/fs/afs/write.c b/fs/afs/write.c index 8b39e6ebb40b..a0c7a364ffb7 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -472,7 +472,7 @@ static int afs_write_back_from_locked_page(struct address_space *mapping, trace_afs_page_dirty(vnode, tracepoint_string("store+"), page->index, priv); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) BUG(); if (test_set_page_writeback(page)) BUG(); @@ -612,7 +612,7 @@ static int afs_writepages_region(struct address_space *mapping, continue; } - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) BUG(); ret = afs_write_back_from_locked_page(mapping, wbc, page, end); put_page(page); @@ -838,7 +838,7 @@ int afs_launder_page(struct page *page) _enter("{%lx}", page->index); priv = page_private(page); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, WB_SYNC_NONE)) { f = 0; t = PAGE_SIZE; if (PagePrivate(page)) { diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e55843f536bc..78fafec3b607 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1364,7 +1364,7 @@ void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end) while (index <= end_index) { page = find_get_page(inode->i_mapping, index); BUG_ON(!page); /* Pages should be in the extent_io_tree */ - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); put_page(page); index++; } @@ -1707,7 +1707,7 @@ static int __process_pages_contig(struct address_space *mapping, continue; } if (page_ops & PAGE_CLEAR_DIRTY) - clear_page_dirty_for_io(pages[i]); + clear_page_dirty_for_io(pages[i], WB_SYNC_ALL); if (page_ops & PAGE_SET_WRITEBACK) set_page_writeback(pages[i]); if (page_ops & PAGE_SET_ERROR) @@ -3740,7 +3740,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, for (i = 0; i < num_pages; i++) { struct page *p = eb->pages[i]; - clear_page_dirty_for_io(p); + clear_page_dirty_for_io(p, wbc->sync_mode); set_page_writeback(p); ret = submit_extent_page(REQ_OP_WRITE | write_flags, tree, wbc, p, offset, PAGE_SIZE, 0, bdev, @@ -3764,7 +3764,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, if (unlikely(ret)) { for (; i < num_pages; i++) { struct page *p = eb->pages[i]; - clear_page_dirty_for_io(p); + clear_page_dirty_for_io(p, wbc->sync_mode); unlock_page(p); } } @@ -3984,7 +3984,7 @@ static int extent_write_cache_pages(struct address_space *mapping, } if (PageWriteback(page) || - !clear_page_dirty_for_io(page)) { + !clear_page_dirty_for_io(page, wbc->sync_mode)) { unlock_page(page); continue; } @@ -4089,7 +4089,7 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end, while (start <= end) { page = find_get_page(mapping, start >> PAGE_SHIFT); - if (clear_page_dirty_for_io(page)) + if (clear_page_dirty_for_io(page, wbc_writepages.sync_mode)) ret = __extent_writepage(page, &wbc_writepages, &epd); else { if (tree->ops && tree->ops->writepage_end_io_hook) @@ -5170,7 +5170,7 @@ void clear_extent_buffer_dirty(struct extent_buffer *eb) lock_page(page); WARN_ON(!PagePrivate(page)); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); xa_lock_irq(&page->mapping->i_pages); if (!PageDirty(page)) { radix_tree_tag_clear(&page->mapping->i_pages, diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 51e77d72068a..dace1375f366 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1514,7 +1514,7 @@ lock_and_cleanup_extent_if_need(struct btrfs_inode *inode, struct page **pages, } for (i = 0; i < num_pages; i++) { - if (clear_page_dirty_for_io(pages[i])) + if (clear_page_dirty_for_io(pages[i]), WB_SYNC_NONE) account_page_redirty(pages[i]); set_page_extent_mapped(pages[i]); WARN_ON(!PageLocked(pages[i])); diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index d5f80cb300be..2014e9a2b659 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -387,7 +387,7 @@ static int io_ctl_prepare_pages(struct btrfs_io_ctl *io_ctl, struct inode *inode } for (i = 0; i < io_ctl->num_pages; i++) { - clear_page_dirty_for_io(io_ctl->pages[i]); + clear_page_dirty_for_io(io_ctl->pages[i], WB_SYNC_ALL); set_page_extent_mapped(io_ctl->pages[i]); } diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 43ecbe620dea..e7291284b4c8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1337,7 +1337,7 @@ static int cluster_pages_for_defrag(struct inode *inode, page_start, page_end - 1, &cached_state); for (i = 0; i < i_done; i++) { - clear_page_dirty_for_io(pages[i]); + clear_page_dirty_for_io(pages[i], WB_SYNC_ALL); ClearPageChecked(pages[i]); set_page_extent_mapped(pages[i]); set_page_dirty(pages[i]); diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 292b3d72d725..29948c0464c0 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -937,7 +937,7 @@ static int ceph_writepages_start(struct address_space *mapping, wait_on_page_writeback(page); } - if (!clear_page_dirty_for_io(page)) { + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) { dout("%p !clear_page_dirty_for_io\n", page); unlock_page(page); continue; @@ -1277,7 +1277,7 @@ static int ceph_update_writeable_page(struct file *file, /* yay, writeable, do it now (without dropping page lock) */ dout(" page %p snapc %p not current, but oldest\n", page, snapc); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, WB_SYNC_ALL)) goto retry_locked; r = writepage_nounlock(page, NULL); if (r < 0) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index d352da325de3..0f8ddc80a4db 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1999,7 +1999,8 @@ cifs_writev_requeue(struct cifs_writedata *wdata) for (j = 0; j < nr_pages; j++) { wdata2->pages[j] = wdata->pages[i + j]; lock_page(wdata2->pages[j]); - clear_page_dirty_for_io(wdata2->pages[j]); + clear_page_dirty_for_io(wdata2->pages[j], + wdata->sync_mode); } wdata2->sync_mode = wdata->sync_mode; diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8d41ca7bfcf1..488061185b95 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2019,7 +2019,8 @@ wdata_prepare_pages(struct cifs_writedata *wdata, unsigned int found_pages, wait_on_page_writeback(page); if (PageWriteback(page) || - !clear_page_dirty_for_io(page)) { + !clear_page_dirty_for_io(page, + wbc->sync_mode)) { unlock_page(page); break; } @@ -4089,7 +4090,7 @@ static int cifs_launder_page(struct page *page) cifs_dbg(FYI, "Launder page: %p\n", page); - if (clear_page_dirty_for_io(page)) + if (clear_page_dirty_for_io(page, wbc.sync_mode)) rc = cifs_writepage_locked(page, &wbc); cifs_fscache_invalidate_page(page, page->mapping->host); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2ea07efbe016..78f77d31c8ad 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1741,7 +1741,8 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd, BUG_ON(PageWriteback(page)); if (invalidate) { if (page_mapped(page)) - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, + WB_SYNC_ALL); block_invalidatepage(page, 0, PAGE_SIZE); ClearPageUptodate(page); } @@ -2187,7 +2188,7 @@ static int mpage_submit_page(struct mpage_da_data *mpd, struct page *page) int err; BUG_ON(page->index != mpd->first_page); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); /* * We have to be very careful here! Nothing protects writeback path * against i_size changes and the page can be writeably mapped into diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 9f1c96caebda..e1dcc848207b 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -354,7 +354,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type, f2fs_wait_on_page_writeback(page, META, true); BUG_ON(PageWriteback(page)); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc.sync_mode)) goto continue_unlock; if (__f2fs_write_meta_page(page, &wbc, io_type)) { @@ -1197,7 +1197,7 @@ static void commit_checkpoint(struct f2fs_sb_info *sbi, f2fs_wait_on_page_writeback(page, META, true); f2fs_bug_on(sbi, PageWriteback(page)); - if (unlikely(!clear_page_dirty_for_io(page))) + if (unlikely(!clear_page_dirty_for_io(page, wbc->sync_mode))) f2fs_bug_on(sbi, 1); /* writeout cp pack 2 page */ diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8f931d699287..a03eac98cfe3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2018,7 +2018,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping, } BUG_ON(PageWriteback(page)); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page), wbc->sync_mode) goto continue_unlock; ret = __write_data_page(page, &submitted, wbc, io_type); diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 7f955c4e86a4..258f9dc117f4 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -731,7 +731,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, if (bit_pos == NR_DENTRY_IN_BLOCK && !f2fs_truncate_hole(dir, page->index, page->index + 1)) { f2fs_clear_radix_tree_dirty_tag(page); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); ClearPagePrivate(page); ClearPageUptodate(page); inode_dec_dirty_pages(dir); diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 9093be6e7a7d..a6eb7ecf6f0b 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -693,7 +693,7 @@ static void move_data_block(struct inode *inode, block_t bidx, set_page_dirty(fio.encrypted_page); f2fs_wait_on_page_writeback(fio.encrypted_page, DATA, true); - if (clear_page_dirty_for_io(fio.encrypted_page)) + if (clear_page_dirty_for_io(fio.encrypted_page, fio.io_wbc->sync_mode)) dec_page_count(fio.sbi, F2FS_DIRTY_META); set_page_writeback(fio.encrypted_page); @@ -780,7 +780,7 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type, retry: set_page_dirty(page); f2fs_wait_on_page_writeback(page, DATA, true); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, fio.io_wbc->sync_mode)) { inode_dec_dirty_pages(inode); f2fs_remove_dirty_inode(inode); } diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 043830be5662..97dbc721e985 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -136,7 +136,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) set_page_dirty(page); /* clear dirty state */ - dirty = clear_page_dirty_for_io(page); + dirty = clear_page_dirty_for_io(page, fio.io_wbc->sync_mode); /* write data page to try to make data consistent */ set_page_writeback(page); diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 10643b11bd59..9401f70d3f9f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -104,7 +104,7 @@ static void clear_node_page_dirty(struct page *page) { if (PageDirty(page)) { f2fs_clear_radix_tree_dirty_tag(page); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); dec_page_count(F2FS_P_SB(page), F2FS_DIRTY_NODES); } ClearPageUptodate(page); @@ -1276,7 +1276,7 @@ static void flush_inline_data(struct f2fs_sb_info *sbi, nid_t ino) if (!PageDirty(page)) goto page_out; - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, WB_SYNC_ALL)) goto page_out; ret = f2fs_write_inline_data(inode, page); @@ -1444,7 +1444,7 @@ void f2fs_move_node_page(struct page *node_page, int gc_type) f2fs_wait_on_page_writeback(node_page, NODE, true); f2fs_bug_on(F2FS_P_SB(node_page), PageWriteback(node_page)); - if (!clear_page_dirty_for_io(node_page)) + if (!clear_page_dirty_for_io(node_page, wbc.sync_mode)) goto out_page; if (__write_node_page(node_page, false, NULL, @@ -1544,7 +1544,7 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, set_page_dirty(page); } - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, WB_SYNC_ALL)) goto continue_unlock; ret = __write_node_page(page, atomic && @@ -1658,7 +1658,7 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi, f2fs_wait_on_page_writeback(page, NODE, true); BUG_ON(PageWriteback(page)); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) goto continue_unlock; set_fsync_mark(page, 0); diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 9efce174c51a..947a16c1836f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -382,7 +382,8 @@ static int __f2fs_commit_inmem_pages(struct inode *inode) set_page_dirty(page); f2fs_wait_on_page_writeback(page, DATA, true); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, + fio.io_wbc->sync_mode)) { inode_dec_dirty_pages(inode); f2fs_remove_dirty_inode(inode); } diff --git a/fs/fuse/file.c b/fs/fuse/file.c index a201fb0ac64f..a7837d909894 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2015,7 +2015,7 @@ static int fuse_write_end(struct file *file, struct address_space *mapping, static int fuse_launder_page(struct page *page) { int err = 0; - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, WB_SYNC_NONE)) { struct inode *inode = page->mapping->host; err = fuse_writepage_locked(page); if (!err) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 35f5ee23566d..43d8baabaa13 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -304,7 +304,7 @@ static int gfs2_write_jdata_pagevec(struct address_space *mapping, } BUG_ON(PageWriteback(page)); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) goto continue_unlock; trace_wbc_writepage(wbc, inode_to_bdi(inode)); diff --git a/fs/nfs/write.c b/fs/nfs/write.c index a057b4f45a46..0535ee5c1b88 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -2037,7 +2037,7 @@ int nfs_wb_page(struct inode *inode, struct page *page) for (;;) { wait_on_page_writeback(page); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, wbc.sync_mode)) { ret = nfs_writepage_locked(page, &wbc); if (ret < 0) goto out_error; diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 4cb850a6f1c2..f38805177248 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c @@ -480,7 +480,7 @@ int __nilfs_clear_page_dirty(struct page *page) page_index(page), PAGECACHE_TAG_DIRTY); xa_unlock_irq(&mapping->i_pages); - return clear_page_dirty_for_io(page); + return clear_page_dirty_for_io(page, WB_SYNC_ALL); } xa_unlock_irq(&mapping->i_pages); return 0; diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 0953635e7d48..b237378cbc81 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -1644,7 +1644,7 @@ static void nilfs_begin_page_io(struct page *page) return; lock_page(page); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); set_page_writeback(page); unlock_page(page); } @@ -1662,7 +1662,8 @@ static void nilfs_segctor_prepare_write(struct nilfs_sc_info *sci) if (bh->b_page != bd_page) { if (bd_page) { lock_page(bd_page); - clear_page_dirty_for_io(bd_page); + clear_page_dirty_for_io(bd_page, + WB_SYNC_ALL); set_page_writeback(bd_page); unlock_page(bd_page); } @@ -1676,7 +1677,8 @@ static void nilfs_segctor_prepare_write(struct nilfs_sc_info *sci) if (bh == segbuf->sb_super_root) { if (bh->b_page != bd_page) { lock_page(bd_page); - clear_page_dirty_for_io(bd_page); + clear_page_dirty_for_io(bd_page, + WB_SYNC_ALL); set_page_writeback(bd_page); unlock_page(bd_page); bd_page = bh->b_page; @@ -1691,7 +1693,7 @@ static void nilfs_segctor_prepare_write(struct nilfs_sc_info *sci) } if (bd_page) { lock_page(bd_page); - clear_page_dirty_for_io(bd_page); + clear_page_dirty_for_io(bd_page, WB_SYNC_ALL); set_page_writeback(bd_page); unlock_page(bd_page); } diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index fd7eb6fe9090..80804e13a05f 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1169,7 +1169,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, */ ubifs_assert(PagePrivate(page)); - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); if (UBIFS_BLOCKS_PER_PAGE_SHIFT) offset = new_size & (PAGE_SIZE - 1); diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 8eb3ba3d4d00..2d61e7c92287 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -496,7 +496,7 @@ xfs_start_page_writeback( * write this page in this writeback sweep will be made. */ if (clear_dirty) { - clear_page_dirty_for_io(page); + clear_page_dirty_for_io(page, WB_SYNC_ALL); set_page_writeback(page); } else set_page_writeback_keepwrite(page); diff --git a/include/linux/mm.h b/include/linux/mm.h index a0fbb9ffe380..3094500f5cff 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1532,7 +1532,12 @@ static inline void cancel_dirty_page(struct page *page) if (PageDirty(page)) __cancel_dirty_page(page); } -int clear_page_dirty_for_io(struct page *page); + +/* The sync_mode argument expects enum writeback_sync_modes (see + * include/linux/writeback.h), but is declared as an int here, to avoid + * even more header file dependencies in mm.h. + */ +int clear_page_dirty_for_io(struct page *page, int sync_mode); int get_cmdline(struct task_struct *task, char *buffer, int buflen); diff --git a/mm/migrate.c b/mm/migrate.c index 8c0af0f7cab1..703c9ee86309 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -849,7 +849,7 @@ static int writeout(struct address_space *mapping, struct page *page) /* No write method for the address space */ return -EINVAL; - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc.sync_mode)) /* Someone else already triggered a write */ return -EAGAIN; diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 337c6afb3345..e526b3cbf900 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2233,7 +2233,7 @@ int write_cache_pages(struct address_space *mapping, } BUG_ON(PageWriteback(page)); - if (!clear_page_dirty_for_io(page)) + if (!clear_page_dirty_for_io(page, wbc->sync_mode)) goto continue_unlock; trace_wbc_writepage(wbc, inode_to_bdi(mapping->host)); @@ -2371,7 +2371,7 @@ int write_one_page(struct page *page) wait_on_page_writeback(page); - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, wbc.sync_mode)) { get_page(page); ret = mapping->a_ops->writepage(page, &wbc); if (ret == 0) @@ -2643,8 +2643,13 @@ EXPORT_SYMBOL(__cancel_dirty_page); * * This incoherency between the page's dirty flag and radix-tree tag is * unfortunate, but it only exists while the page is locked. + * + * The sync_mode argument expects enum writeback_sync_modes (see + * include/linux/writeback.h), but is declared as an int here, to avoid + * even more header file dependencies in mm.h. */ -int clear_page_dirty_for_io(struct page *page) + +int clear_page_dirty_for_io(struct page *page, int sync_mode) { struct address_space *mapping = page_mapping(page); int ret = 0; diff --git a/mm/vmscan.c b/mm/vmscan.c index 03822f86f288..16c305a8d476 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -668,7 +668,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping, if (!may_write_to_inode(mapping->host, sc)) return PAGE_KEEP; - if (clear_page_dirty_for_io(page)) { + if (clear_page_dirty_for_io(page, WB_SYNC_ALL)) { int res; struct writeback_control wbc = { .sync_mode = WB_SYNC_NONE,