2020-08-14 06:36:52

by kernel test robot

[permalink] [raw]
Subject: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e764a1e32337aaf325fc5b14a5bbd06eabba4699
commit: 464170647b5648bb81f3615567485fcb9a685bed jbd2: Make state lock a spinlock
date: 10 months ago
config: x86_64-randconfig-c002-20200812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


coccinelle warnings: (new ones prefixed by >>)

>> fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413

vim +2430 fs/ocfs2/suballoc.c

415cb800375cc4 Mark Fasheh 2007-09-16 2379
b4414eea0e7b9c Mark Fasheh 2010-03-11 2380 static int ocfs2_block_group_clear_bits(handle_t *handle,
ccd979bdbce9fb Mark Fasheh 2005-12-15 2381 struct inode *alloc_inode,
ccd979bdbce9fb Mark Fasheh 2005-12-15 2382 struct ocfs2_group_desc *bg,
ccd979bdbce9fb Mark Fasheh 2005-12-15 2383 struct buffer_head *group_bh,
ccd979bdbce9fb Mark Fasheh 2005-12-15 2384 unsigned int bit_off,
b4414eea0e7b9c Mark Fasheh 2010-03-11 2385 unsigned int num_bits,
b4414eea0e7b9c Mark Fasheh 2010-03-11 2386 void (*undo_fn)(unsigned int bit,
b4414eea0e7b9c Mark Fasheh 2010-03-11 2387 unsigned long *bmap))
ccd979bdbce9fb Mark Fasheh 2005-12-15 2388 {
ccd979bdbce9fb Mark Fasheh 2005-12-15 2389 int status;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2390 unsigned int tmp;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2391 struct ocfs2_group_desc *undo_bg = NULL;
464170647b5648 Thomas Gleixner 2019-08-09 2392 struct journal_head *jh;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2393
42035306132802 Joel Becker 2008-11-13 2394 /* The caller got this descriptor from
42035306132802 Joel Becker 2008-11-13 2395 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */
42035306132802 Joel Becker 2008-11-13 2396 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
ccd979bdbce9fb Mark Fasheh 2005-12-15 2397
2f73e135b83c50 Tao Ma 2011-02-22 2398 trace_ocfs2_block_group_clear_bits(bit_off, num_bits);
ccd979bdbce9fb Mark Fasheh 2005-12-15 2399
b4414eea0e7b9c Mark Fasheh 2010-03-11 2400 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode));
0cf2f7632b1789 Joel Becker 2009-02-12 2401 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode),
b4414eea0e7b9c Mark Fasheh 2010-03-11 2402 group_bh,
b4414eea0e7b9c Mark Fasheh 2010-03-11 2403 undo_fn ?
b4414eea0e7b9c Mark Fasheh 2010-03-11 2404 OCFS2_JOURNAL_ACCESS_UNDO :
b4414eea0e7b9c Mark Fasheh 2010-03-11 2405 OCFS2_JOURNAL_ACCESS_WRITE);
ccd979bdbce9fb Mark Fasheh 2005-12-15 2406 if (status < 0) {
ccd979bdbce9fb Mark Fasheh 2005-12-15 2407 mlog_errno(status);
ccd979bdbce9fb Mark Fasheh 2005-12-15 2408 goto bail;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2409 }
ccd979bdbce9fb Mark Fasheh 2005-12-15 2410
464170647b5648 Thomas Gleixner 2019-08-09 2411 jh = bh2jh(group_bh);
b4414eea0e7b9c Mark Fasheh 2010-03-11 2412 if (undo_fn) {
464170647b5648 Thomas Gleixner 2019-08-09 @2413 spin_lock(&jh->b_state_lock);
464170647b5648 Thomas Gleixner 2019-08-09 2414 undo_bg = (struct ocfs2_group_desc *) jh->b_committed_data;
94e41ecfe0f202 Sunil Mushran 2009-06-19 2415 BUG_ON(!undo_bg);
94e41ecfe0f202 Sunil Mushran 2009-06-19 2416 }
ccd979bdbce9fb Mark Fasheh 2005-12-15 2417
ccd979bdbce9fb Mark Fasheh 2005-12-15 2418 tmp = num_bits;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2419 while(tmp--) {
ccd979bdbce9fb Mark Fasheh 2005-12-15 2420 ocfs2_clear_bit((bit_off + tmp),
ccd979bdbce9fb Mark Fasheh 2005-12-15 2421 (unsigned long *) bg->bg_bitmap);
b4414eea0e7b9c Mark Fasheh 2010-03-11 2422 if (undo_fn)
b4414eea0e7b9c Mark Fasheh 2010-03-11 2423 undo_fn(bit_off + tmp,
ccd979bdbce9fb Mark Fasheh 2005-12-15 2424 (unsigned long *) undo_bg->bg_bitmap);
ccd979bdbce9fb Mark Fasheh 2005-12-15 2425 }
ccd979bdbce9fb Mark Fasheh 2005-12-15 2426 le16_add_cpu(&bg->bg_free_bits_count, num_bits);
9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2427 if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
e75ed71be4f2f7 Changwei Ge 2018-01-31 2428 if (undo_fn)
464170647b5648 Thomas Gleixner 2019-08-09 2429 spin_unlock(&jh->b_state_lock);
7ecef14ab1db96 Joe Perches 2015-09-04 @2430 return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2431 (unsigned long long)le64_to_cpu(bg->bg_blkno),
9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2432 le16_to_cpu(bg->bg_bits),
7ecef14ab1db96 Joe Perches 2015-09-04 2433 le16_to_cpu(bg->bg_free_bits_count),
7ecef14ab1db96 Joe Perches 2015-09-04 2434 num_bits);
9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2435 }
ccd979bdbce9fb Mark Fasheh 2005-12-15 2436
b4414eea0e7b9c Mark Fasheh 2010-03-11 2437 if (undo_fn)
464170647b5648 Thomas Gleixner 2019-08-09 2438 spin_unlock(&jh->b_state_lock);
94e41ecfe0f202 Sunil Mushran 2009-06-19 2439
ec20cec7a35158 Joel Becker 2010-03-19 2440 ocfs2_journal_dirty(handle, group_bh);
ccd979bdbce9fb Mark Fasheh 2005-12-15 2441 bail:
ccd979bdbce9fb Mark Fasheh 2005-12-15 2442 return status;
ccd979bdbce9fb Mark Fasheh 2005-12-15 2443 }
ccd979bdbce9fb Mark Fasheh 2005-12-15 2444

:::::: The code at line 2430 was first introduced by commit
:::::: 7ecef14ab1db961545354fa443749aeda2ea1b75 ocfs2: neaten do_error, ocfs2_error and ocfs2_abort

:::::: TO: Joe Perches <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (5.94 kB)
.config.gz (34.55 kB)
Download all attachments

2020-08-14 13:39:11

by Thomas Gleixner

[permalink] [raw]
Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413

On Fri, Aug 14 2020 at 14:11, kernel test robot wrote:
>
> coccinelle warnings: (new ones prefixed by >>)
>
>>> fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413
>
> vim +2430 fs/ocfs2/suballoc.c
>
> 415cb800375cc4 Mark Fasheh 2007-09-16 2379
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2380 static int ocfs2_block_group_clear_bits(handle_t *handle,
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2381 struct inode *alloc_inode,
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2382 struct ocfs2_group_desc *bg,
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2383 struct buffer_head *group_bh,
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2384 unsigned int bit_off,
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2385 unsigned int num_bits,
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2386 void (*undo_fn)(unsigned int bit,
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2387 unsigned long *bmap))
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2388 {
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2389 int status;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2390 unsigned int tmp;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2391 struct ocfs2_group_desc *undo_bg = NULL;
> 464170647b5648 Thomas Gleixner 2019-08-09 2392 struct journal_head *jh;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2393
> 42035306132802 Joel Becker 2008-11-13 2394 /* The caller got this descriptor from
> 42035306132802 Joel Becker 2008-11-13 2395 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */
> 42035306132802 Joel Becker 2008-11-13 2396 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2397
> 2f73e135b83c50 Tao Ma 2011-02-22 2398 trace_ocfs2_block_group_clear_bits(bit_off, num_bits);
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2399
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2400 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode));
> 0cf2f7632b1789 Joel Becker 2009-02-12 2401 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode),
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2402 group_bh,
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2403 undo_fn ?
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2404 OCFS2_JOURNAL_ACCESS_UNDO :
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2405 OCFS2_JOURNAL_ACCESS_WRITE);
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2406 if (status < 0) {
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2407 mlog_errno(status);
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2408 goto bail;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2409 }
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2410
> 464170647b5648 Thomas Gleixner 2019-08-09 2411 jh = bh2jh(group_bh);
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2412 if (undo_fn) {
> 464170647b5648 Thomas Gleixner 2019-08-09 @2413 spin_lock(&jh->b_state_lock);
> 464170647b5648 Thomas Gleixner 2019-08-09 2414 undo_bg = (struct ocfs2_group_desc *) jh->b_committed_data;
> 94e41ecfe0f202 Sunil Mushran 2009-06-19 2415 BUG_ON(!undo_bg);
> 94e41ecfe0f202 Sunil Mushran 2009-06-19 2416 }
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2417
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2418 tmp = num_bits;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2419 while(tmp--) {
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2420 ocfs2_clear_bit((bit_off + tmp),
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2421 (unsigned long *) bg->bg_bitmap);
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2422 if (undo_fn)
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2423 undo_fn(bit_off + tmp,
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2424 (unsigned long *) undo_bg->bg_bitmap);
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2425 }
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2426 le16_add_cpu(&bg->bg_free_bits_count, num_bits);
> 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2427 if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
> e75ed71be4f2f7 Changwei Ge 2018-01-31 2428 if (undo_fn)
> 464170647b5648 Thomas Gleixner 2019-08-09 2429 spin_unlock(&jh->b_state_lock);
> 7ecef14ab1db96 Joe Perches 2015-09-04 @2430 return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
> 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2431 (unsigned long long)le64_to_cpu(bg->bg_blkno),
> 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2432 le16_to_cpu(bg->bg_bits),
> 7ecef14ab1db96 Joe Perches 2015-09-04 2433 le16_to_cpu(bg->bg_free_bits_count),
> 7ecef14ab1db96 Joe Perches 2015-09-04 2434 num_bits);
> 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2435 }
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2436
> b4414eea0e7b9c Mark Fasheh 2010-03-11 2437 if (undo_fn)
> 464170647b5648 Thomas Gleixner 2019-08-09 2438 spin_unlock(&jh->b_state_lock);
> 94e41ecfe0f202 Sunil Mushran 2009-06-19 2439
> ec20cec7a35158 Joel Becker 2010-03-19 2440 ocfs2_journal_dirty(handle, group_bh);
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2441 bail:
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2442 return status;
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2443 }
> ccd979bdbce9fb Mark Fasheh 2005-12-15 2444

That's clearly a false positive. Is there anything what can be done to
help that cocci script here?

Thanks,

tglx

2020-08-14 20:20:16

by Thomas Gleixner

[permalink] [raw]
Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413

Julia,

On Fri, Aug 14 2020 at 21:00, Julia Lawall wrote:
> On Fri, 14 Aug 2020, Thomas Gleixner wrote:
>> That's clearly a false positive. Is there anything what can be done to
>> help that cocci script here?
>
> I have a better version that needs to get pushed.
>
> But normally these pass through me. Did you get it directly from kbuild?

Yes, because I touched the affected lines last :)

Thanks,

tglx

2020-08-14 20:23:41

by Julia Lawall

[permalink] [raw]
Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413



On Fri, 14 Aug 2020, Thomas Gleixner wrote:

> Julia,
>
> On Fri, Aug 14 2020 at 21:00, Julia Lawall wrote:
> > On Fri, 14 Aug 2020, Thomas Gleixner wrote:
> >> That's clearly a false positive. Is there anything what can be done to
> >> help that cocci script here?
> >
> > I have a better version that needs to get pushed.
> >
> > But normally these pass through me. Did you get it directly from kbuild?
>
> Yes, because I touched the affected lines last :)

Actually, that's not the point. Normally, I get all the reports on this
case, and then I forward them if they look ok. If I forwarded something
incorrect, then sorry about that. If the policy has changed for this rule
to be sending the reports out directlty to the recipients, then I think it
should be changed back. There are a lot of real bugs with lock usage, but
there are alot of false positives too. Specifically, the rule looks for
the case with identical if tests, but only when the branches are identical
too.

Kbuild people, can this be adjusted? Or have I misunderstood the
situation?

thanks,
julia

2020-08-14 21:01:39

by Julia Lawall

[permalink] [raw]
Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413



On Fri, 14 Aug 2020, Thomas Gleixner wrote:

> On Fri, Aug 14 2020 at 14:11, kernel test robot wrote:
> >
> > coccinelle warnings: (new ones prefixed by >>)
> >
> >>> fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413
> >
> > vim +2430 fs/ocfs2/suballoc.c
> >
> > 415cb800375cc4 Mark Fasheh 2007-09-16 2379
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2380 static int ocfs2_block_group_clear_bits(handle_t *handle,
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2381 struct inode *alloc_inode,
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2382 struct ocfs2_group_desc *bg,
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2383 struct buffer_head *group_bh,
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2384 unsigned int bit_off,
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2385 unsigned int num_bits,
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2386 void (*undo_fn)(unsigned int bit,
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2387 unsigned long *bmap))
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2388 {
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2389 int status;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2390 unsigned int tmp;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2391 struct ocfs2_group_desc *undo_bg = NULL;
> > 464170647b5648 Thomas Gleixner 2019-08-09 2392 struct journal_head *jh;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2393
> > 42035306132802 Joel Becker 2008-11-13 2394 /* The caller got this descriptor from
> > 42035306132802 Joel Becker 2008-11-13 2395 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */
> > 42035306132802 Joel Becker 2008-11-13 2396 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg));
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2397
> > 2f73e135b83c50 Tao Ma 2011-02-22 2398 trace_ocfs2_block_group_clear_bits(bit_off, num_bits);
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2399
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2400 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode));
> > 0cf2f7632b1789 Joel Becker 2009-02-12 2401 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode),
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2402 group_bh,
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2403 undo_fn ?
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2404 OCFS2_JOURNAL_ACCESS_UNDO :
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2405 OCFS2_JOURNAL_ACCESS_WRITE);
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2406 if (status < 0) {
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2407 mlog_errno(status);
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2408 goto bail;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2409 }
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2410
> > 464170647b5648 Thomas Gleixner 2019-08-09 2411 jh = bh2jh(group_bh);
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2412 if (undo_fn) {
> > 464170647b5648 Thomas Gleixner 2019-08-09 @2413 spin_lock(&jh->b_state_lock);
> > 464170647b5648 Thomas Gleixner 2019-08-09 2414 undo_bg = (struct ocfs2_group_desc *) jh->b_committed_data;
> > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2415 BUG_ON(!undo_bg);
> > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2416 }
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2417
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2418 tmp = num_bits;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2419 while(tmp--) {
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2420 ocfs2_clear_bit((bit_off + tmp),
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2421 (unsigned long *) bg->bg_bitmap);
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2422 if (undo_fn)
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2423 undo_fn(bit_off + tmp,
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2424 (unsigned long *) undo_bg->bg_bitmap);
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2425 }
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2426 le16_add_cpu(&bg->bg_free_bits_count, num_bits);
> > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2427 if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
> > e75ed71be4f2f7 Changwei Ge 2018-01-31 2428 if (undo_fn)
> > 464170647b5648 Thomas Gleixner 2019-08-09 2429 spin_unlock(&jh->b_state_lock);
> > 7ecef14ab1db96 Joe Perches 2015-09-04 @2430 return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
> > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2431 (unsigned long long)le64_to_cpu(bg->bg_blkno),
> > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2432 le16_to_cpu(bg->bg_bits),
> > 7ecef14ab1db96 Joe Perches 2015-09-04 2433 le16_to_cpu(bg->bg_free_bits_count),
> > 7ecef14ab1db96 Joe Perches 2015-09-04 2434 num_bits);
> > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2435 }
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2436
> > b4414eea0e7b9c Mark Fasheh 2010-03-11 2437 if (undo_fn)
> > 464170647b5648 Thomas Gleixner 2019-08-09 2438 spin_unlock(&jh->b_state_lock);
> > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2439
> > ec20cec7a35158 Joel Becker 2010-03-19 2440 ocfs2_journal_dirty(handle, group_bh);
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2441 bail:
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2442 return status;
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2443 }
> > ccd979bdbce9fb Mark Fasheh 2005-12-15 2444
>
> That's clearly a false positive. Is there anything what can be done to
> help that cocci script here?

I have a better version that needs to get pushed.

But normally these pass through me. Did you get it directly from kbuild?

julia

2020-08-15 21:40:16

by Philip Li

[permalink] [raw]
Subject: Re: [kbuild-all] Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413

On Fri, Aug 14, 2020 at 09:52:13PM +0200, Julia Lawall wrote:
>
>
> On Fri, 14 Aug 2020, Thomas Gleixner wrote:
>
> > Julia,
> >
> > On Fri, Aug 14 2020 at 21:00, Julia Lawall wrote:
> > > On Fri, 14 Aug 2020, Thomas Gleixner wrote:
> > >> That's clearly a false positive. Is there anything what can be done to
> > >> help that cocci script here?
> > >
> > > I have a better version that needs to get pushed.
> > >
> > > But normally these pass through me. Did you get it directly from kbuild?
> >
> > Yes, because I touched the affected lines last :)
>
> Actually, that's not the point. Normally, I get all the reports on this
> case, and then I forward them if they look ok. If I forwarded something
> incorrect, then sorry about that. If the policy has changed for this rule
> to be sending the reports out directlty to the recipients, then I think it
> should be changed back. There are a lot of real bugs with lock usage, but
> there are alot of false positives too. Specifically, the rule looks for
> the case with identical if tests, but only when the branches are identical
> too.
>
> Kbuild people, can this be adjusted? Or have I misunderstood the
> situation?
Hi Julia and Thomas, pls allow us to check this further, usually all cocci
reports will be sent to [email protected] for Julia to check. But there maybe
something wrong with this report. We will check the detail in next week as
we have server maintainance during the weekend.

>
> thanks,
> julia
> _______________________________________________
> kbuild-all mailing list -- [email protected]
> To unsubscribe send an email to [email protected]