Page MenuHomeFreeBSD

Use gbincore_unlocked for unprotected incore()
ClosedPublic

Authored by cem on Jul 23 2020, 7:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 7:58 AM
Unknown Object (File)
Feb 2 2024, 2:47 AM
Unknown Object (File)
Feb 2 2024, 2:47 AM
Unknown Object (File)
Feb 2 2024, 2:47 AM
Unknown Object (File)
Jan 30 2024, 10:33 PM
Unknown Object (File)
Jan 15 2024, 6:29 PM
Unknown Object (File)
Dec 26 2023, 12:01 PM
Unknown Object (File)
Dec 21 2023, 10:51 PM
Subscribers

Details

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem requested review of this revision.Jul 23 2020, 7:29 PM
cem created this revision.

Hmm. There is one use of incore() which modifies the returned buf, in indir_trunc(). The comment right after states that some lock is held, but I can't see what it is. How does the update to the dependency list get synchronized?

This revision is now accepted and ready to land.Jul 24 2020, 2:20 PM

Hmm. There is one use of incore() which modifies the returned buf, in indir_trunc(). The comment right after states that some lock is held, but I can't see what it is. How does the update to the dependency list get synchronized?

I think they are synchronized under the global ump mutex in UFS, but I don't know. I don't think this revision changes that, though.

In D25790#571313, @cem wrote:

Hmm. There is one use of incore() which modifies the returned buf, in indir_trunc(). The comment right after states that some lock is held, but I can't see what it is. How does the update to the dependency list get synchronized?

I think they are synchronized under the global ump mutex in UFS, but I don't know.

The per-mountpoint softdep lock is not held there (it is acquired a few lines below), and I don't think the mountpoint lock is either.

I don't think this revision changes that, though.

Indeed, just trying to understand if there is a bug here.

In D25790#571313, @cem wrote:

I think they are synchronized under the global ump mutex in UFS, but I don't know.

The per-mountpoint softdep lock is not held there (it is acquired a few lines below), and I don't think the mountpoint lock is either.

Right; it looked like (in my quick scan) that we intentionally dropped the lock to run indir_trunc(). But my guess was/is any synchronization needed on the datastructure is performed under that lock before it is dropped. I don't really know SU that well.

This revision was automatically updated to reflect the committed changes.