* [chao:wip 7/9] fs/f2fs/data.c:2590 f2fs_should_update_outplace() error: we previously assumed 'fio' could be null (see line 2581)
@ 2024-03-25 23:40 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-03-25 23:40 UTC (permalink / raw
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
TO: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip
head: ffa2225cad631419f3944c962518291a7df50367
commit: aac0576c96c228281b5db26528047da6a585fe84 [7/9] f2fs: zone: allow IPU in regular block device
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: xtensa-randconfig-r081-20240325 (https://download.01.org/0day-ci/archive/20240326/202403260735.dL4awPJc-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 13.2.0
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202403260735.dL4awPJc-lkp@intel.com/
New smatch warnings:
fs/f2fs/data.c:2590 f2fs_should_update_outplace() error: we previously assumed 'fio' could be null (see line 2581)
Old smatch warnings:
fs/f2fs/data.c:276 f2fs_post_read_work() warn: bitwise AND condition is false here
fs/f2fs/data.c:281 f2fs_post_read_work() warn: bitwise AND condition is false here
arch/xtensa/include/asm/thread_info.h:97 current_thread_info() warn: inconsistent indenting
vim +/fio +2590 fs/f2fs/data.c
bb9e3bb8dbf597 Chao Yu 2018-01-17 2573
4d57b86dd86404 Chao Yu 2018-05-30 2574 bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
bb9e3bb8dbf597 Chao Yu 2018-01-17 2575 {
bb9e3bb8dbf597 Chao Yu 2018-01-17 2576 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
bb9e3bb8dbf597 Chao Yu 2018-01-17 2577
19bdba5265624b Jaegeuk Kim 2021-12-09 2578 /* The below cases were checked when setting it. */
19bdba5265624b Jaegeuk Kim 2021-12-09 2579 if (f2fs_is_pinned_file(inode))
19bdba5265624b Jaegeuk Kim 2021-12-09 2580 return false;
19bdba5265624b Jaegeuk Kim 2021-12-09 @2581 if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK))
19bdba5265624b Jaegeuk Kim 2021-12-09 2582 return true;
aac0576c96c228 Chao Yu 2024-03-23 2583 if (f2fs_lfs_mode(sbi)) {
aac0576c96c228 Chao Yu 2024-03-23 2584 if (!f2fs_sb_has_blkzoned(sbi))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2585 return true;
aac0576c96c228 Chao Yu 2024-03-23 2586 /* no regular block device in mainarea */
aac0576c96c228 Chao Yu 2024-03-23 2587 if (!sbi->first_zoned_segno)
aac0576c96c228 Chao Yu 2024-03-23 2588 return true;
aac0576c96c228 Chao Yu 2024-03-23 2589 /* blkaddr locates in sequential zone */
aac0576c96c228 Chao Yu 2024-03-23 @2590 if (GET_SEGNO(sbi, fio->old_blkaddr) >= sbi->first_zoned_segno)
aac0576c96c228 Chao Yu 2024-03-23 2591 return true;
aac0576c96c228 Chao Yu 2024-03-23 2592 }
bb9e3bb8dbf597 Chao Yu 2018-01-17 2593 if (S_ISDIR(inode->i_mode))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2594 return true;
af033b2aa8a874 Chao Yu 2018-09-20 2595 if (IS_NOQUOTA(inode))
af033b2aa8a874 Chao Yu 2018-09-20 2596 return true;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2597 if (f2fs_is_atomic_file(inode))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2598 return true;
943f7c6f987f4a Chao Yu 2023-09-04 2599 /* rewrite low ratio compress data w/ OPU mode to avoid fragmentation */
943f7c6f987f4a Chao Yu 2023-09-04 2600 if (f2fs_compressed_file(inode) &&
943f7c6f987f4a Chao Yu 2023-09-04 2601 F2FS_OPTION(sbi).compress_mode == COMPR_MODE_USER &&
943f7c6f987f4a Chao Yu 2023-09-04 2602 is_inode_flag_set(inode, FI_ENABLE_COMPRESS))
943f7c6f987f4a Chao Yu 2023-09-04 2603 return true;
859fca6b706e00 Chao Yu 2021-05-26 2604
859fca6b706e00 Chao Yu 2021-05-26 2605 /* swap file is migrating in aligned write mode */
859fca6b706e00 Chao Yu 2021-05-26 2606 if (is_inode_flag_set(inode, FI_ALIGNED_WRITE))
859fca6b706e00 Chao Yu 2021-05-26 2607 return true;
859fca6b706e00 Chao Yu 2021-05-26 2608
1018a5463a0637 Chao Yu 2022-02-04 2609 if (is_inode_flag_set(inode, FI_OPU_WRITE))
1018a5463a0637 Chao Yu 2022-02-04 2610 return true;
1018a5463a0637 Chao Yu 2022-02-04 2611
bb9e3bb8dbf597 Chao Yu 2018-01-17 2612 if (fio) {
b763f3bedc2da2 Chao Yu 2021-04-28 2613 if (page_private_gcing(fio->page))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2614 return true;
4354994f097d06 Daniel Rosenberg 2018-08-20 2615 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
4354994f097d06 Daniel Rosenberg 2018-08-20 2616 f2fs_is_checkpointed_data(sbi, fio->old_blkaddr)))
4354994f097d06 Daniel Rosenberg 2018-08-20 2617 return true;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2618 }
bb9e3bb8dbf597 Chao Yu 2018-01-17 2619 return false;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2620 }
bb9e3bb8dbf597 Chao Yu 2018-01-17 2621
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [chao:wip 7/9] fs/f2fs/data.c:2590 f2fs_should_update_outplace() error: we previously assumed 'fio' could be null (see line 2581)
@ 2024-03-26 8:06 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-03-26 8:06 UTC (permalink / raw
To: oe-kbuild, Chao Yu, Chao Yu; +Cc: lkp, oe-kbuild-all, Chao Yu, Chao Yu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git wip
head: ffa2225cad631419f3944c962518291a7df50367
commit: aac0576c96c228281b5db26528047da6a585fe84 [7/9] f2fs: zone: allow IPU in regular block device
config: xtensa-randconfig-r081-20240325 (https://download.01.org/0day-ci/archive/20240326/202403260735.dL4awPJc-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 13.2.0
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202403260735.dL4awPJc-lkp@intel.com/
New smatch warnings:
fs/f2fs/data.c:2590 f2fs_should_update_outplace() error: we previously assumed 'fio' could be null (see line 2581)
vim +/fio +2590 fs/f2fs/data.c
4d57b86dd86404 Chao Yu 2018-05-30 2574 bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio)
bb9e3bb8dbf597 Chao Yu 2018-01-17 2575 {
bb9e3bb8dbf597 Chao Yu 2018-01-17 2576 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
bb9e3bb8dbf597 Chao Yu 2018-01-17 2577
19bdba5265624b Jaegeuk Kim 2021-12-09 2578 /* The below cases were checked when setting it. */
19bdba5265624b Jaegeuk Kim 2021-12-09 2579 if (f2fs_is_pinned_file(inode))
19bdba5265624b Jaegeuk Kim 2021-12-09 2580 return false;
19bdba5265624b Jaegeuk Kim 2021-12-09 @2581 if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK))
^^^
Can fio be NULL?
19bdba5265624b Jaegeuk Kim 2021-12-09 2582 return true;
aac0576c96c228 Chao Yu 2024-03-23 2583 if (f2fs_lfs_mode(sbi)) {
aac0576c96c228 Chao Yu 2024-03-23 2584 if (!f2fs_sb_has_blkzoned(sbi))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2585 return true;
aac0576c96c228 Chao Yu 2024-03-23 2586 /* no regular block device in mainarea */
aac0576c96c228 Chao Yu 2024-03-23 2587 if (!sbi->first_zoned_segno)
aac0576c96c228 Chao Yu 2024-03-23 2588 return true;
aac0576c96c228 Chao Yu 2024-03-23 2589 /* blkaddr locates in sequential zone */
aac0576c96c228 Chao Yu 2024-03-23 @2590 if (GET_SEGNO(sbi, fio->old_blkaddr) >= sbi->first_zoned_segno)
^^^^^
Unchecked dereference
aac0576c96c228 Chao Yu 2024-03-23 2591 return true;
aac0576c96c228 Chao Yu 2024-03-23 2592 }
bb9e3bb8dbf597 Chao Yu 2018-01-17 2593 if (S_ISDIR(inode->i_mode))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2594 return true;
af033b2aa8a874 Chao Yu 2018-09-20 2595 if (IS_NOQUOTA(inode))
af033b2aa8a874 Chao Yu 2018-09-20 2596 return true;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2597 if (f2fs_is_atomic_file(inode))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2598 return true;
943f7c6f987f4a Chao Yu 2023-09-04 2599 /* rewrite low ratio compress data w/ OPU mode to avoid fragmentation */
943f7c6f987f4a Chao Yu 2023-09-04 2600 if (f2fs_compressed_file(inode) &&
943f7c6f987f4a Chao Yu 2023-09-04 2601 F2FS_OPTION(sbi).compress_mode == COMPR_MODE_USER &&
943f7c6f987f4a Chao Yu 2023-09-04 2602 is_inode_flag_set(inode, FI_ENABLE_COMPRESS))
943f7c6f987f4a Chao Yu 2023-09-04 2603 return true;
859fca6b706e00 Chao Yu 2021-05-26 2604
859fca6b706e00 Chao Yu 2021-05-26 2605 /* swap file is migrating in aligned write mode */
859fca6b706e00 Chao Yu 2021-05-26 2606 if (is_inode_flag_set(inode, FI_ALIGNED_WRITE))
859fca6b706e00 Chao Yu 2021-05-26 2607 return true;
859fca6b706e00 Chao Yu 2021-05-26 2608
1018a5463a0637 Chao Yu 2022-02-04 2609 if (is_inode_flag_set(inode, FI_OPU_WRITE))
1018a5463a0637 Chao Yu 2022-02-04 2610 return true;
1018a5463a0637 Chao Yu 2022-02-04 2611
bb9e3bb8dbf597 Chao Yu 2018-01-17 2612 if (fio) {
^^^^^^^^^^
Checked here as well.
b763f3bedc2da2 Chao Yu 2021-04-28 2613 if (page_private_gcing(fio->page))
bb9e3bb8dbf597 Chao Yu 2018-01-17 2614 return true;
4354994f097d06 Daniel Rosenberg 2018-08-20 2615 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
4354994f097d06 Daniel Rosenberg 2018-08-20 2616 f2fs_is_checkpointed_data(sbi, fio->old_blkaddr)))
4354994f097d06 Daniel Rosenberg 2018-08-20 2617 return true;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2618 }
bb9e3bb8dbf597 Chao Yu 2018-01-17 2619 return false;
bb9e3bb8dbf597 Chao Yu 2018-01-17 2620 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-26 8:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 8:06 [chao:wip 7/9] fs/f2fs/data.c:2590 f2fs_should_update_outplace() error: we previously assumed 'fio' could be null (see line 2581) Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2024-03-25 23:40 kernel test robot
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.