add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202505161519.ew2oo7cw-...@intel.com/
smatch warnings:
fs/f2fs/super.c:858 f2fs_parse_param() warn: impossible condition
'(result.int_32 > ((~0 >> 1))) => (s32mi
On Wed, May 07, 2025 at 10:59:11AM +0800, Chao Yu wrote:
> On 5/2/25 16:15, Dan Carpenter wrote:
> > Hello Matthew Wilcox (Oracle),
> >
> > 1768 /* reference all summary page */
> > 1769 while (segno < end_segno) {
> > 1770
migrated >= sbi->migration_granularity)
1798 goto skip;
--> 1799 if (!folio_test_uptodate(sum_folio) ||
^
Dereferenced here.
1800 unlikely(f2fs_cp_e
b_info *sbi, pgoff_t nid,
> if (err < 0) {
> goto out_put_err;
> } else if (err == LOCKED_PAGE) {
> - err = 0;
> goto page_hit;
> }
We could remove the curly braces as well.
regards,
dan carpenter
__
tests which deal
with compression tests/f2fs/002 and tests/f2fs/007. But it feels like
xfstests is not really the right place for this sort of thing, it would
be better as part of some sort of fuzz testing.
What do you think?
regards,
dan carpenter
_
2fs_handle_critical_error(sbi, reason, end_io);
36 }
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
i)->user_block_count);
2095
2096 SM_I(sbi)->segment_count = (int)SM_I(sbi)->segment_count +
segs;
2097 MAIN_SEGS(sbi) = (int)MAIN_SEGS(sbi) + segs;
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linu
/archive/20240120/202401201237.ovvyekvs-...@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.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
| Reported-by: Dan Carpenter
s get rid of "ret" as well:
return filemap_check_errors(NODE_MAPPING(sbi));
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
New smatch warnings:
fs/f2fs/iostat.c:228 __update_iostat_latency() error: buffer overflow
'io_lat->sum_lat[type]' 3 <= 3
fs/f
On Wed, May 11, 2022 at 10:37:57AM -0700, Jaegeuk Kim wrote:
> Hi Dan,
>
> Thank you for the fix. If you don't mind, can I integrate this fix into
> the original patch which is in -next?
>
Yeah, that's not a problem. Feel free.
regards,
dan carpenter
> Thanks,
Return an error code if f2fs_iget() fails. Currently it returns
success.
Fixes: 3d7ad9c30607 ("f2fs: change the current atomic write way")
Signed-off-by: Dan Carpenter
---
fs/f2fs/file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 79
ly other places which
rely on the old behavior.
In an ideal world, with the new API the compiler would warn about
uninitialized variables, but unfortunately that warning is disabled by
default so we still have to rely on kbuild/Clang/Smatch to
.c
index ddf5737c63d9..c9dffa5c40a2 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3771,6 +3771,9 @@ EXPORT_SYMBOL(kmem_cache_free_bulk);
*
* Don't free memory not originally allocated by kmalloc()
* or you will run into trouble.
+ *
+ * CHECKER information
+ * frees: $0
*/
void kfree(const void *ob
^^^
425
426 for (port = 0; port < r8a66597->max_root_hub; port++) {
427 if (r8a66597->root_hub[port].dev == dev) {
^^^
428 r8a66597->root_hub[port].dev = NULL;
42
On Mon, Feb 28, 2022 at 10:20:28AM -0800, Joe Perches wrote:
> On Mon, 2022-02-28 at 14:24 +0300, Dan Carpenter wrote:
>
> > a multi-line indent gets curly braces for readability even though
> > it's not required by C. And then both sides would get curly braces.
>
&
een what is a related part of a
patch is a bit vague and some maintainers will ask you to add or subtract
from a patch depending on their individual tastes. I don't really have
an exact answer, but I felt like this patch needs to be subtracted from.
Especially i
dev_name(&_phy->dev));
> BUG();
> }
> } else {
> - sas_port_create_link(port, phy);
> - list_add_tail(&phy->port_siblings, &port->phy_list);
> + s
nse, but it's out of date now. Just delete it.
> - if (group && &group->list == &rcd->tid_group_list.list)
> + if (!group)
> goto bail_eagain;
> group = list_prepare_entry(group, &rcd->tid_group_list.list,
> list);
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
--
> drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++--
> drivers/perf/xgene_pmu.c | 13 +++--
> 3 files changed, 11 insertions(+), 10 deletions(-)
These are all bug fixes.
1) Send them as 3 separate patches.
2) Add Fixes tags.
regards,
dan carpenter
_
break;
> + }
> }
> - if (&req->req != _req) {
> + if (!req) {
> ep->stopped = stopped;
> spin_unlock_irqrestore(&ep->dev->lock, flags);
> return -EINVAL;
> @@ -954,7 +957,6 @@ net2272_dequ
return count;
487 }
488
489 if (!strcmp(a->attr.name, "gc_urgent_high_remaining")) {
--> 490 if (t < 0)
^
impossible.
491 retu
sbi->wr_sum_lat[sync][iotype] += ts_diff;
3371sbi->wr_bio_cnt[sync][iotype]++;
3372if (ts_diff > sbi->wr_peak_lat[sync][iotype])
3373sbi->wr_peak_lat[sync][iotype] = ts_diff;
3374}
3375
F2FS_I(dir)->task = current;
390 return de;
Which means that we return a NULL "de" and "*res_page" is uninitialized
and that matches what syzbot found throug runtime testing.
391 }
regards,
dan carpenter
___
er comment.
This looks really old. Maybe commit 399368372ed9 ("f2fs: introduce a
new global lock scheme")?
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
On Wed, Sep 04, 2019 at 07:43:07PM +0800, Chao Yu wrote:
> On 2019/9/4 18:02, Dan Carpenter wrote:
> > The error handling doesn't work because "cf_name->len" is unsigned.
>
> Dan, thanks for catching this, would you mind merging this into original
> patch,
The error handling doesn't work because "cf_name->len" is unsigned.
Fixes: fbce5d4ab3ab ("f2fs: optimize case-insensitive lookups")
Signed-off-by: Dan Carpenter
---
fs/f2fs/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/dir.c b/fs/f
On Wed, Feb 13, 2019 at 04:49:57PM +0800, Chao Yu wrote:
> On 2019/2/13 11:32, Chao Yu wrote:
> > On 2019/2/12 2:45, Dan Carpenter wrote:
> >> We put an upper bound on ->write_io_size_bits but we don't have a lower
> >> bound.
> >
> > Oh, lower boun
We put an upper bound on ->write_io_size_bits but we don't have a lower
bound.
Signed-off-by: Dan Carpenter
---
fs/f2fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 3ec11d392a5e..2db2d38e2aca 100644
--- a/fs/f2fs
those warnings.
Thanks!
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
f2fs_write_checkpoint(sbi, &cpc);
1485
1486sbi->unusable_block_count = 0;
1487mutex_unlock(&sbi->gc_mutex);
1488return 0;
1489 }
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
look at this! I think that's probably a bit
complicated for Smatch...
regards,
dan carpenter
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
/
609 if (dei.len >= 1 &&
610 prev.len < F2FS_MIN_EXTENT_LEN &&
611 et->largest.len < F2FS_MIN_EXTENT_LEN) {
612 et->largest
d by LBA
> order"), did Smatch missed to check original commit?
>
It does warn about __issue_discard_cmd_range() but I didn't look at
which patch introduced that warning...
This code is several months old, but I don't know why it's o
^^^
Dereference.
1278 dc = rb_entry_safe(node, struct discard_cmd, rb_node);
1279 }
1280
1281 blk_finish_plug(&plug);
1282
See also:
fs/f2fs/segment.c:2550 __issue_discard_c
"ret" can be uninitialized on the success path when "in ==
F2FS_GOING_DOWN_FULLSYNC".
Fixes: 60b2b4ee2bc0 ("f2fs: Fix deadlock in shutdown ioctl")
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 6880c6f78d58..73c875c81ed6 100644
---
We checked that "inode" is not an error pointer earlier so there is
no need to check again here.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 56c19b0610a8..290a9d7060ef 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -321,9 +321,9 @@ sta
if (pages)
1119 put_page(page);
1120 }
1121 BUG_ON(pages && !list_empty(pages));
1122 if (bio)
1123 __submit_bio(F2FS_I_SB(inode), bio, DATA);
^^^
Dereferenced.
1
goto sync_out;
669 }
670 }
regards,
dan carpenter
--
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.source
unlock the page.
>
> Hmm, any workaround to avoid that warning?
>
No, it's fine. Just ignore it.
regards,
dan carpenter
--
___
Linux-f2fs-devel mailing list
Lin
e_page(apage, READA);
1042 f2fs_put_page(apage, err ? 1 : 0);
In the old code we took errors into consideration but now we treat them
as LOCKED_PAGE. Is that intentional? A lot of the other callers in
that patch still check for errors...
104
The return was not indented far enough so it looked like it was supposed
to go with the other if statement.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 17e89ba..741db3a 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -554,8 +554,8 @@ static
err = f2fs_setup_fname_crypto(inode);
439 if (err)
440 goto out;
regards,
dan carpenter
--
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest o
nlock();
return err;
Btw shouldn't we earlier if page_symlink() fails?
regards,
dan carpenter
--
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring
e_decrypt (error code
%d)\n",
^^
191 __func__, res);
192 return res;
193 }
regards,
dan carpenter
---
On Wed, Apr 22, 2015 at 11:13:36AM -0700, Jaegeuk Kim wrote:
> On Wed, Apr 22, 2015 at 01:27:22PM +0300, Dan Carpenter wrote:
> > On Wed, Apr 22, 2015 at 02:28:22PM +0800, Chao Yu wrote:
> > > > > fs/f2fs/namei.c
> > > > >299 static void *f2fs_fo
om smatch not true? or I made a mistake? If so,
> please
> correct me.
Smatch is correct, it returns NULL on error. However, I agree that it
looks like it is supposed to return an ERR_PTR. Every caller seems to
expect that.
I suspect the right fix is to change page_follow_link_light(). B
ntial NULL deref.
310 page_cache_release(page);
311 return ERR_PTR(-ENOENT);
312 }
313 return page;
314 }
regards,
dan carpenter
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT
NR_INLINE_DENTRY *
F2FS_SLOT_LEN);
364
regards,
dan carpenter
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls
My static checker complains that segment is a u64 but only the lower 31
bits can be used before we hit a shift wrapping bug.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index b423005..d8ed1b8 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -949,7
return PTR_ERR(page);
182
Also:
fs/f2fs/recovery.c:446 recover_data() warn: 'page' isn't an ERR_PTR
regards,
dan carpenter
--
Want excitement?
Manually upgrade your production da
We can make the code a bit simpler because we know that "!retry" is
zero.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0f61f5a..41bdf51 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1133,7 +1133,7 @@ free_sbi:
/* give only o
grab_cache_page_write_begin() returns NULL on error, it doesn't return
error pointers.
Fixes: e18c65b2ac91 ('f2fs: key functions to handle inline data')
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 69a923e38f0c..e0d800a1d79f 100644
--- a/f
On Thu, Nov 28, 2013 at 06:24:41PM +0900, Jaegeuk Kim wrote:
> 2013-11-28 (목), 11:08 +0300, Dan Carpenter:
> > On Thu, Nov 28, 2013 at 01:04:47PM +0900, Jaegeuk Kim wrote:
> > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> > > index b7ad1ec..5fa54c1 100644
> > &g
gt;
> /* read segment summary of victim */
> sum_page = get_sum_page(sbi, segno);
> - if (IS_ERR(sum_page))
> - return;
Didn't you want to check for NULL here?
regards,
dan carpe
On Wed, Nov 27, 2013 at 06:04:57PM +0900, Jaegeuk Kim wrote:
> Hi,
>
> 2013-11-27 (수), 11:31 +0300, Dan Carpenter:
> > On Wed, Nov 27, 2013 at 11:46:21AM +0900, Jaegeuk Kim wrote:
> > > Hi Dan,
> > >
> > > Thank you for the report.
> > >
>
;re
unlikely to support 18TB with f2fs so let's just leave the code as is
with the original warning.
regards,
dan carpenter
--
Rapidly troubleshoot problems before they affect your business. Most IT
organizations
_discard(sbi->sb->s_bdev, sector_addr, sector_len,
277 GFP_NOFS, 0);
278 trace_f2fs_issue_discard(sbi->sb, blkstart, blklen);
279 }
regards,
dan carpenter
--
Shape the Mobile Ex
alloc_page() returns a NULL on failure, it never returns an ERR_PTR.
Signed-off-by: Dan Carpenter
---
v2: fix the calls in recovery.c as well.
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index f5172e2..3e87fe0 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1515,8 +1515,8 @@ int
On Wed, Aug 14, 2013 at 10:24:36PM +0900, Jaegeuk Kim wrote:
> Hi Dan,
>
> Agreed.
> Could you make a patch that covers other alloc_page cases too?
Sure. Thanks for catching that. I will resend a v2 of this one
which fixes those as well.
regards,
d
alloc_page() returns a NULL on failure, it never returns an ERR_PTR.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index f5172e2..3e87fe0 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1515,8 +1515,8 @@ int restore_node_summary(struct f2fs_sb_info *sbi
This kfree() is no longer needed after a79dc083d7 "f2fs: move
bio_private allocation out of f2fs_bio_alloc()". The "bio->bi_private"
is NULL here so it's a no-op.
Signed-off-by: Dan Carpenter
---
Only needed in linux-next.
diff --git a/fs/f2fs/data.c b/fs/f2fs/d
On Sun, May 26, 2013 at 05:05:15PM +0200, walter harms wrote:
>
>
> Am 23.05.2013 12:02, schrieb Dan Carpenter:
> > There is an error path where "dir" is an ERR_PTR.
> >
> > Signed-off-by: Dan Carpenter
> >
> > diff --git a/fs/f2fs/recovery.
t; addresses
> Cc: linux-fsde...@vger.kernel.org, linux-ker...@vger.kernel.org,
> linux-f2fs-devel@lists.sourceforge.net
>
> The on-disk block address is defined as __le32, but in-memory block
> address,
> block_t, does as u64.
>
> Let's synchronize them to 32 bits.
>
ro should probably be:
#define NEW_ADDR ((block_t)-1)
I'm not able to test this so there may be some reason why changing
this breaks something. In that case we could do:
#define NEW_ADDR ((u32)(block_t)-1) /* ex
There is an error path where "dir" is an ERR_PTR.
Signed-off-by: Dan Carpenter
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 5148d90..921aede 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -71,7 +71,8 @@ static int recover_dentry(struct page *ipage, st
66 matches
Mail list logo