From: kernel test robot <lkp@intel.com>
To: Chao Yu <chao@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Chao Yu <chao@kernel.org>
Subject: [chao:bugfix/syzbot 3/4] fs/f2fs/node.c:1528:3: error: a label can only be part of a statement and a declaration is not a statement
Date: Tue, 2 Sep 2025 04:05:20 +0800 [thread overview]
Message-ID: <202509020309.KOSXlxMX-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git bugfix/syzbot
head: e78352f91a47b493a1627cfb57e13c845a5da6ef
commit: 55c4622c9b2238d6a793200235bdec0f45003e35 [3/4] f2fs: fix to do sanity check on node footer before node folio writeback
config: s390-randconfig-002-20250902 (https://download.01.org/0day-ci/archive/20250902/202509020309.KOSXlxMX-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250902/202509020309.KOSXlxMX-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/202509020309.KOSXlxMX-lkp@intel.com/
All errors (new ones prefixed by >>):
fs/f2fs/node.c: In function 'sanity_check_node_footer':
>> fs/f2fs/node.c:1528:3: error: a label can only be part of a statement and a declaration is not a statement
1528 | struct f2fs_inode *ri = &F2FS_NODE(folio)->i;
| ^~~~~~
>> fs/f2fs/node.c:1529:3: error: expected expression before 'umode_t'
1529 | umode_t m = le16_to_cpu(ri->i_mode);
| ^~~~~~~
In file included from include/linux/stat.h:7,
from include/linux/fs.h:11,
from fs/f2fs/node.c:8:
>> fs/f2fs/node.c:1532:17: error: 'm' undeclared (first use in this function); did you mean 'tm'?
1532 | if (!S_ISLNK(m) && !S_ISREG(m) && !S_ISDIR(m) &&
| ^
include/uapi/linux/stat.h:21:23: note: in definition of macro 'S_ISLNK'
21 | #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
| ^
fs/f2fs/node.c:1532:17: note: each undeclared identifier is reported only once for each function it appears in
1532 | if (!S_ISLNK(m) && !S_ISREG(m) && !S_ISDIR(m) &&
| ^
include/uapi/linux/stat.h:21:23: note: in definition of macro 'S_ISLNK'
21 | #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
| ^
fs/f2fs/node.c:1528:22: warning: unused variable 'ri' [-Wunused-variable]
1528 | struct f2fs_inode *ri = &F2FS_NODE(folio)->i;
| ^~
vim +1528 fs/f2fs/node.c
1502
1503 static int sanity_check_node_footer(struct f2fs_sb_info *sbi,
1504 struct folio *folio, pgoff_t nid,
1505 enum node_type ntype)
1506 {
1507 bool is_inode;
1508
1509 if (unlikely(nid != nid_of_node(folio)))
1510 goto out_err;
1511
1512 is_inode = IS_INODE(folio);
1513
1514 switch (ntype) {
1515 case NODE_TYPE_INODE:
1516 if (!is_inode)
1517 goto out_err;
1518 break;
1519 case NODE_TYPE_XATTR:
1520 if (is_inode || !f2fs_has_xattr_block(ofs_of_node(folio)))
1521 goto out_err;
1522 break;
1523 case NODE_TYPE_NON_INODE:
1524 if (is_inode)
1525 goto out_err;
1526 break;
1527 case NODE_TYPE_UNKNOWN:
> 1528 struct f2fs_inode *ri = &F2FS_NODE(folio)->i;
> 1529 umode_t m = le16_to_cpu(ri->i_mode);
1530
1531 if (is_inode) {
> 1532 if (!S_ISLNK(m) && !S_ISREG(m) && !S_ISDIR(m) &&
1533 !S_ISCHR(m) && !S_ISBLK(m) && !S_ISFIFO(m) &&
1534 !S_ISSOCK(m))
1535 goto out_err;
1536
1537 if (f2fs_has_xattr_block(ofs_of_node(folio)))
1538 goto out_err;
1539 }
1540 break;
1541 default:
1542 break;
1543 }
1544 if (time_to_inject(sbi, FAULT_INCONSISTENT_FOOTER))
1545 goto out_err;
1546 return 0;
1547 out_err:
1548 f2fs_warn(sbi, "inconsistent node block, node_type:%d, nid:%lu, "
1549 "node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
1550 ntype, nid, nid_of_node(folio), ino_of_node(folio),
1551 ofs_of_node(folio), cpver_of_node(folio),
1552 next_blkaddr_of_node(folio));
1553 set_sbi_flag(sbi, SBI_NEED_FSCK);
1554 f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER);
1555 return -EFSCORRUPTED;
1556 }
1557
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-09-01 20:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202509020309.KOSXlxMX-lkp@intel.com \
--to=lkp@intel.com \
--cc=chao@kernel.org \
--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.