Page MenuHomeFreeBSD

swapongeom: destroy consumer in case swaponsomething failed
ClosedPublic

Authored by kib on Jul 30 2025, 3:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 1:42 PM
Unknown Object (File)
Sat, Oct 11, 5:25 AM
Unknown Object (File)
Sat, Oct 11, 5:25 AM
Unknown Object (File)
Sat, Oct 11, 5:25 AM
Unknown Object (File)
Sat, Oct 11, 5:25 AM
Unknown Object (File)
Sat, Oct 11, 5:25 AM
Unknown Object (File)
Fri, Oct 10, 10:13 PM
Unknown Object (File)
Thu, Oct 2, 11:19 PM
Subscribers

Details

Summary
Fixes:  aa42e4984997c9d3aa5d30534bdaf760e613e97b
Reported by:    olivier

Diff Detail

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

Event Timeline

kib requested review of this revision.Jul 30 2025, 3:03 PM

Do we also need to call VOP_CLOSE in the error path in swaponvp()?

Do we also need to call VOP_CLOSE in the error path in swaponvp()?

I thought it is done by sys_swapon(), but apparently not.

Close the vnode on failure.

This revision is now accepted and ready to land.Jul 30 2025, 4:32 PM
olivier requested changes to this revision.Jul 30 2025, 5:48 PM

I have still the same problem (did a full buildworld + buildkernel reinstall):

$ truncate -s 1000 swapfile
$ echo 'md99    none    swap    sw,file=swapfile  0       0' > fstab.out
$ sudo swapon -F fstab.out -a
swapon: /dev/md99: NSWAPDEV limit reached
$ sudo mdconfig -l
md99
$ sudo mdconfig -d -u 99
mdconfig: ioctl(/dev/mdctl): Device busy
This revision now requires changes to proceed.Jul 30 2025, 5:48 PM

Also roll back g_access()

olivier requested changes to this revision.Jul 30 2025, 6:54 PM

still same error with this diff #3.

This revision now requires changes to proceed.Jul 30 2025, 6:54 PM

still same error with this diff #3.

Are you sure? I checked that with the diff with g_access(-1,...) I can destroy a small md after failed swapon.

ooops yes, you’ve right! Don’t know how I’ve failed to correctly test that.

This revision is now accepted and ready to land.Jul 30 2025, 8:02 PM