From: kernel test robot <lkp@intel.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Jaegeuk Kim <jaegeuk@kernel.org>
Subject: Re: [PATCH] f2fs: call __add_ino_entry out of the eviction path
Date: Tue, 18 Aug 2026 14:59:51 +0800 [thread overview]
Message-ID: <202608181459.m9UmVCUU-lkp@intel.com> (raw)
In-Reply-To: <20260804002027.2196300-1-jaegeuk@kernel.org>
Hi Jaegeuk,
kernel test robot noticed the following build errors:
[auto build test ERROR on v7.2-rc7]
[also build test ERROR on linus/master]
[cannot apply to jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev next-20260817]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jaegeuk-Kim/f2fs-call-__add_ino_entry-out-of-the-eviction-path/20260815-151820
base: v7.2-rc7
patch link: https://lore.kernel.org/r/20260804002027.2196300-1-jaegeuk%40kernel.org
patch subject: [PATCH] f2fs: call __add_ino_entry out of the eviction path
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260818/202608181459.m9UmVCUU-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/202608181459.m9UmVCUU-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608181459.m9UmVCUU-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/f2fs/inode.c:1051:6: error: call to undeclared function 'current_is_kswapd'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1051 | if (current_is_kswapd()) {
| ^
1 error generated.
vim +/current_is_kswapd +1051 fs/f2fs/inode.c
887
888 /*
889 * Called at the last iput() if i_nlink is zero
890 */
891 void f2fs_evict_inode(struct inode *inode)
892 {
893 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
894 struct f2fs_inode_info *fi = F2FS_I(inode);
895 nid_t xnid = fi->i_xattr_nid;
896 int err = 0;
897 bool freeze_protected = false;
898 unsigned int record_bits = 0;
899
900 f2fs_abort_atomic_write(inode, true);
901
902 if (fi->cow_inode && f2fs_is_cow_file(fi->cow_inode)) {
903 struct inode *cow_inode = fi->cow_inode;
904
905 f2fs_down_write(&F2FS_I(cow_inode)->i_sem);
906 clear_inode_flag(cow_inode, FI_COW_FILE);
907 F2FS_I(cow_inode)->atomic_inode = NULL;
908 fi->cow_inode = NULL;
909 f2fs_up_write(&F2FS_I(cow_inode)->i_sem);
910
911 iput(cow_inode);
912 }
913
914 trace_f2fs_evict_inode(inode);
915 truncate_inode_pages_final(&inode->i_data);
916
917 if ((inode->i_nlink || is_bad_inode(inode)) &&
918 test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode))
919 f2fs_invalidate_compress_pages(sbi, inode->i_ino);
920
921 if (inode->i_ino == F2FS_NODE_INO(sbi) ||
922 inode->i_ino == F2FS_META_INO(sbi) ||
923 inode->i_ino == F2FS_COMPRESS_INO(sbi))
924 goto out_clear;
925
926 f2fs_bug_on(sbi, get_dirty_pages(inode));
927 f2fs_remove_dirty_inode(inode);
928 f2fs_remove_donate_inode(inode);
929
930 if (!IS_DEVICE_ALIASING(inode))
931 f2fs_destroy_extent_tree(inode);
932
933 if (inode->i_nlink || is_bad_inode(inode))
934 goto no_delete;
935
936 err = f2fs_dquot_initialize(inode);
937 if (err) {
938 err = 0;
939 set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
940 }
941
942 f2fs_remove_ino_entry(sbi, inode->i_ino, APPEND_INO);
943 f2fs_remove_ino_entry(sbi, inode->i_ino, UPDATE_INO);
944 f2fs_remove_ino_entry(sbi, inode->i_ino, FLUSH_INO);
945
946 if (!is_sbi_flag_set(sbi, SBI_IS_FREEZING)) {
947 sb_start_intwrite(inode->i_sb);
948 freeze_protected = true;
949 }
950 set_inode_flag(inode, FI_NO_ALLOC);
951 i_size_write(inode, 0);
952 retry:
953 if (F2FS_HAS_BLOCKS(inode))
954 err = f2fs_truncate(inode);
955
956 if (time_to_inject(sbi, FAULT_EVICT_INODE))
957 err = -EIO;
958
959 if (!err) {
960 struct f2fs_lock_context lc;
961
962 f2fs_lock_op(sbi, &lc);
963 err = f2fs_remove_inode_page(inode);
964 f2fs_unlock_op(sbi, &lc);
965 if (err == -ENOENT) {
966 err = 0;
967
968 /*
969 * in fuzzed image, another node may has the same
970 * block address as inode's, if it was truncated
971 * previously, truncation of inode node will fail.
972 */
973 if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
974 f2fs_warn(F2FS_I_SB(inode),
975 "f2fs_evict_inode: inconsistent node id, ino:%llu",
976 inode->i_ino);
977 f2fs_inode_synced(inode);
978 set_sbi_flag(sbi, SBI_NEED_FSCK);
979 }
980 }
981 }
982
983 /* give more chances, if ENOMEM case */
984 if (err == -ENOMEM) {
985 err = 0;
986 goto retry;
987 }
988
989 if (IS_DEVICE_ALIASING(inode))
990 f2fs_destroy_extent_tree(inode);
991
992 if (err) {
993 f2fs_update_inode_page(inode);
994 if (dquot_initialize_needed(inode))
995 set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
996
997 /*
998 * If both f2fs_truncate() and f2fs_update_inode_page() failed
999 * due to fuzzed corrupted inode, call f2fs_inode_synced() to
1000 * avoid triggering later f2fs_bug_on().
1001 */
1002 if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
1003 f2fs_warn(sbi,
1004 "f2fs_evict_inode: inode is dirty, ino:%llu",
1005 inode->i_ino);
1006 f2fs_inode_synced(inode);
1007 set_sbi_flag(sbi, SBI_NEED_FSCK);
1008 }
1009 }
1010 if (freeze_protected)
1011 sb_end_intwrite(inode->i_sb);
1012 no_delete:
1013 dquot_drop(inode);
1014
1015 stat_dec_inline_xattr(inode);
1016 stat_dec_inline_dir(inode);
1017 stat_dec_inline_inode(inode);
1018 stat_dec_compr_inode(inode);
1019 stat_sub_compr_blocks(inode,
1020 atomic_read(&fi->i_compr_blocks));
1021
1022 if (likely(!f2fs_cp_error(sbi) &&
1023 !is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
1024 f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE));
1025
1026 /*
1027 * anyway, it needs to remove the inode from sbi->inode_list[DIRTY_META]
1028 * list to avoid UAF in f2fs_sync_inode_meta() during checkpoint.
1029 */
1030 f2fs_inode_synced(inode);
1031
1032 /* for the case f2fs_new_inode() was failed, .i_ino is zero, skip it */
1033 if (inode->i_ino)
1034 invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
1035 inode->i_ino);
1036 if (xnid)
1037 invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
1038
1039 if (!inode->i_nlink)
1040 goto skip_record;
1041
1042 if (is_inode_flag_set(inode, FI_APPEND_WRITE))
1043 record_bits = BIT(APPEND_INO);
1044 if (is_inode_flag_set(inode, FI_UPDATE_WRITE))
1045 record_bits = BIT(UPDATE_INO);
1046
1047 if (!record_bits)
1048 goto skip_record;
1049
1050 /* Let's do this in workqueue out of the direct reclaim path. */
> 1051 if (current_is_kswapd()) {
1052 f2fs_record_inode_state(sbi, inode->i_ino, record_bits);
1053 } else {
1054 struct evict_inode_work *ew =
1055 mempool_alloc(evict_inode_work_pool, GFP_NOFS);
1056
1057 ew->sbi = sbi;
1058 ew->ino = inode->i_ino;
1059 ew->add_ino_entry_bits = record_bits;
1060 INIT_WORK(&ew->work, f2fs_evict_inode_work);
1061 queue_work(sbi->evict_wq, &ew->work);
1062 }
1063 skip_record:
1064 if (is_inode_flag_set(inode, FI_FREE_NID)) {
1065 f2fs_alloc_nid_failed(sbi, inode->i_ino);
1066 clear_inode_flag(inode, FI_FREE_NID);
1067 } else {
1068 /*
1069 * If xattr nid is corrupted, we can reach out error condition,
1070 * err & !f2fs_exist_written_data(sbi, inode->i_ino, ORPHAN_INO)).
1071 * In that case, f2fs_check_nid_range() is enough to give a clue.
1072 */
1073 }
1074 out_clear:
1075 fscrypt_put_encryption_info(inode);
1076 clear_inode(inode);
1077 }
1078
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [f2fs-dev] [PATCH] f2fs: call __add_ino_entry out of the eviction path
Date: Tue, 18 Aug 2026 14:59:51 +0800 [thread overview]
Message-ID: <202608181459.m9UmVCUU-lkp@intel.com> (raw)
In-Reply-To: <20260804002027.2196300-1-jaegeuk@kernel.org>
Hi Jaegeuk,
kernel test robot noticed the following build errors:
[auto build test ERROR on v7.2-rc7]
[also build test ERROR on linus/master]
[cannot apply to jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev next-20260817]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jaegeuk-Kim/f2fs-call-__add_ino_entry-out-of-the-eviction-path/20260815-151820
base: v7.2-rc7
patch link: https://lore.kernel.org/r/20260804002027.2196300-1-jaegeuk%40kernel.org
patch subject: [PATCH] f2fs: call __add_ino_entry out of the eviction path
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260818/202608181459.m9UmVCUU-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/202608181459.m9UmVCUU-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608181459.m9UmVCUU-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/f2fs/inode.c:1051:6: error: call to undeclared function 'current_is_kswapd'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1051 | if (current_is_kswapd()) {
| ^
1 error generated.
vim +/current_is_kswapd +1051 fs/f2fs/inode.c
887
888 /*
889 * Called at the last iput() if i_nlink is zero
890 */
891 void f2fs_evict_inode(struct inode *inode)
892 {
893 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
894 struct f2fs_inode_info *fi = F2FS_I(inode);
895 nid_t xnid = fi->i_xattr_nid;
896 int err = 0;
897 bool freeze_protected = false;
898 unsigned int record_bits = 0;
899
900 f2fs_abort_atomic_write(inode, true);
901
902 if (fi->cow_inode && f2fs_is_cow_file(fi->cow_inode)) {
903 struct inode *cow_inode = fi->cow_inode;
904
905 f2fs_down_write(&F2FS_I(cow_inode)->i_sem);
906 clear_inode_flag(cow_inode, FI_COW_FILE);
907 F2FS_I(cow_inode)->atomic_inode = NULL;
908 fi->cow_inode = NULL;
909 f2fs_up_write(&F2FS_I(cow_inode)->i_sem);
910
911 iput(cow_inode);
912 }
913
914 trace_f2fs_evict_inode(inode);
915 truncate_inode_pages_final(&inode->i_data);
916
917 if ((inode->i_nlink || is_bad_inode(inode)) &&
918 test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode))
919 f2fs_invalidate_compress_pages(sbi, inode->i_ino);
920
921 if (inode->i_ino == F2FS_NODE_INO(sbi) ||
922 inode->i_ino == F2FS_META_INO(sbi) ||
923 inode->i_ino == F2FS_COMPRESS_INO(sbi))
924 goto out_clear;
925
926 f2fs_bug_on(sbi, get_dirty_pages(inode));
927 f2fs_remove_dirty_inode(inode);
928 f2fs_remove_donate_inode(inode);
929
930 if (!IS_DEVICE_ALIASING(inode))
931 f2fs_destroy_extent_tree(inode);
932
933 if (inode->i_nlink || is_bad_inode(inode))
934 goto no_delete;
935
936 err = f2fs_dquot_initialize(inode);
937 if (err) {
938 err = 0;
939 set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
940 }
941
942 f2fs_remove_ino_entry(sbi, inode->i_ino, APPEND_INO);
943 f2fs_remove_ino_entry(sbi, inode->i_ino, UPDATE_INO);
944 f2fs_remove_ino_entry(sbi, inode->i_ino, FLUSH_INO);
945
946 if (!is_sbi_flag_set(sbi, SBI_IS_FREEZING)) {
947 sb_start_intwrite(inode->i_sb);
948 freeze_protected = true;
949 }
950 set_inode_flag(inode, FI_NO_ALLOC);
951 i_size_write(inode, 0);
952 retry:
953 if (F2FS_HAS_BLOCKS(inode))
954 err = f2fs_truncate(inode);
955
956 if (time_to_inject(sbi, FAULT_EVICT_INODE))
957 err = -EIO;
958
959 if (!err) {
960 struct f2fs_lock_context lc;
961
962 f2fs_lock_op(sbi, &lc);
963 err = f2fs_remove_inode_page(inode);
964 f2fs_unlock_op(sbi, &lc);
965 if (err == -ENOENT) {
966 err = 0;
967
968 /*
969 * in fuzzed image, another node may has the same
970 * block address as inode's, if it was truncated
971 * previously, truncation of inode node will fail.
972 */
973 if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
974 f2fs_warn(F2FS_I_SB(inode),
975 "f2fs_evict_inode: inconsistent node id, ino:%llu",
976 inode->i_ino);
977 f2fs_inode_synced(inode);
978 set_sbi_flag(sbi, SBI_NEED_FSCK);
979 }
980 }
981 }
982
983 /* give more chances, if ENOMEM case */
984 if (err == -ENOMEM) {
985 err = 0;
986 goto retry;
987 }
988
989 if (IS_DEVICE_ALIASING(inode))
990 f2fs_destroy_extent_tree(inode);
991
992 if (err) {
993 f2fs_update_inode_page(inode);
994 if (dquot_initialize_needed(inode))
995 set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
996
997 /*
998 * If both f2fs_truncate() and f2fs_update_inode_page() failed
999 * due to fuzzed corrupted inode, call f2fs_inode_synced() to
1000 * avoid triggering later f2fs_bug_on().
1001 */
1002 if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
1003 f2fs_warn(sbi,
1004 "f2fs_evict_inode: inode is dirty, ino:%llu",
1005 inode->i_ino);
1006 f2fs_inode_synced(inode);
1007 set_sbi_flag(sbi, SBI_NEED_FSCK);
1008 }
1009 }
1010 if (freeze_protected)
1011 sb_end_intwrite(inode->i_sb);
1012 no_delete:
1013 dquot_drop(inode);
1014
1015 stat_dec_inline_xattr(inode);
1016 stat_dec_inline_dir(inode);
1017 stat_dec_inline_inode(inode);
1018 stat_dec_compr_inode(inode);
1019 stat_sub_compr_blocks(inode,
1020 atomic_read(&fi->i_compr_blocks));
1021
1022 if (likely(!f2fs_cp_error(sbi) &&
1023 !is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
1024 f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE));
1025
1026 /*
1027 * anyway, it needs to remove the inode from sbi->inode_list[DIRTY_META]
1028 * list to avoid UAF in f2fs_sync_inode_meta() during checkpoint.
1029 */
1030 f2fs_inode_synced(inode);
1031
1032 /* for the case f2fs_new_inode() was failed, .i_ino is zero, skip it */
1033 if (inode->i_ino)
1034 invalidate_mapping_pages(NODE_MAPPING(sbi), inode->i_ino,
1035 inode->i_ino);
1036 if (xnid)
1037 invalidate_mapping_pages(NODE_MAPPING(sbi), xnid, xnid);
1038
1039 if (!inode->i_nlink)
1040 goto skip_record;
1041
1042 if (is_inode_flag_set(inode, FI_APPEND_WRITE))
1043 record_bits = BIT(APPEND_INO);
1044 if (is_inode_flag_set(inode, FI_UPDATE_WRITE))
1045 record_bits = BIT(UPDATE_INO);
1046
1047 if (!record_bits)
1048 goto skip_record;
1049
1050 /* Let's do this in workqueue out of the direct reclaim path. */
> 1051 if (current_is_kswapd()) {
1052 f2fs_record_inode_state(sbi, inode->i_ino, record_bits);
1053 } else {
1054 struct evict_inode_work *ew =
1055 mempool_alloc(evict_inode_work_pool, GFP_NOFS);
1056
1057 ew->sbi = sbi;
1058 ew->ino = inode->i_ino;
1059 ew->add_ino_entry_bits = record_bits;
1060 INIT_WORK(&ew->work, f2fs_evict_inode_work);
1061 queue_work(sbi->evict_wq, &ew->work);
1062 }
1063 skip_record:
1064 if (is_inode_flag_set(inode, FI_FREE_NID)) {
1065 f2fs_alloc_nid_failed(sbi, inode->i_ino);
1066 clear_inode_flag(inode, FI_FREE_NID);
1067 } else {
1068 /*
1069 * If xattr nid is corrupted, we can reach out error condition,
1070 * err & !f2fs_exist_written_data(sbi, inode->i_ino, ORPHAN_INO)).
1071 * In that case, f2fs_check_nid_range() is enough to give a clue.
1072 */
1073 }
1074 out_clear:
1075 fscrypt_put_encryption_info(inode);
1076 clear_inode(inode);
1077 }
1078
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2026-08-18 7:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 0:20 [f2fs-dev] [PATCH] f2fs: call __add_ino_entry out of the eviction path Jaegeuk Kim via Linux-f2fs-devel
2026-08-04 0:20 ` Jaegeuk Kim
2026-08-05 1:28 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2026-08-05 1:28 ` Jaegeuk Kim via Linux-f2fs-devel
2026-08-06 2:38 ` Chao Yu via Linux-f2fs-devel
2026-08-06 2:38 ` Chao Yu
2026-08-07 22:03 ` Jaegeuk Kim
2026-08-07 22:03 ` Jaegeuk Kim via Linux-f2fs-devel
2026-08-16 12:06 ` [PATCH] " kernel test robot
2026-08-16 12:06 ` [f2fs-dev] " kernel test robot
2026-08-18 6:59 ` kernel test robot [this message]
2026-08-18 6:59 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202608181459.m9UmVCUU-lkp@intel.com \
--to=lkp@intel.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.