Page MenuHomeFreeBSD

makefs: move brelse into bread
ClosedPublic

Authored by emaste on Mar 13 2023, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 12 2024, 1:04 PM
Unknown Object (File)
Mar 12 2024, 1:04 PM
Unknown Object (File)
Mar 12 2024, 1:04 PM
Unknown Object (File)
Mar 12 2024, 3:27 AM
Unknown Object (File)
Mar 8 2024, 5:54 AM
Unknown Object (File)
Jan 8 2024, 9:56 AM
Unknown Object (File)
Dec 23 2023, 4:06 AM
Unknown Object (File)
Dec 11 2023, 3:59 PM
Subscribers

Details

Summary

Obtained from: NetBSD

commit 0a62dad69f6288b05e812c0fe293e61a37c25edd
Author: christos <christos@NetBSD.org>
Date:   Sun Jan 27 20:05:46 2013 +0000

    This works well enough to populate plain files in the root dir. creating
    directories fails.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

Not yet tested

I think these are necessary, but not quite sufficient. this will leak, but only some metadata writes

mckusick requested changes to this revision.Apr 7 2023, 6:31 AM

The use of brelse in makefs/ffs/ffs_balloc.c is inconsistent. Assuming you are consistent in having bwrite brelse in both error and non-error cases there are two places in ffs_balloc.c that need to have brelse removed.

I have only checked the FFS code. All filesystem types need to have their use of brelse / bwrite checked.

usr.sbin/makefs/ffs/buf.c
142

Assuming your plan is that bwrite will always brelse(bp), error or not, then you need a brelse here.

149

You use bp in the next line after you have brelse'd it here. You need to check value and set errno equal zero before the brelse.

This revision now requires changes to proceed.Apr 7 2023, 6:31 AM

Update based on NetBSD commit:

commit 0c4125e1a19f619766092d0704164c091adac9fc
Author: christos <christos@NetBSD.org>
Date:   Mon Mar 13 22:10:30 2023 +0000

    modernize; release bpp and set it to NULL as the kernel does even if we
    never return here.

@mckusick I believe this update from NetBSD addresses the issue you raised.

Now looks good. Sorry for the slow response.

This revision is now accepted and ready to land.Apr 16 2023, 2:45 PM
This revision was automatically updated to reflect the committed changes.