Page MenuHomeFreeBSD

vn_open_vnode(): handle error when fp == NULL
ClosedPublic

Authored by kib on Apr 19 2021, 10:32 AM.
Tags
None
Referenced Files
F148583581: D29830.diff
Wed, Mar 18, 11:07 PM
F148569901: D29830.diff
Wed, Mar 18, 8:25 PM
Unknown Object (File)
Wed, Mar 18, 6:52 AM
Unknown Object (File)
Wed, Mar 18, 12:50 AM
Unknown Object (File)
Tue, Mar 17, 6:52 AM
Unknown Object (File)
Tue, Mar 17, 6:51 AM
Unknown Object (File)
Sun, Mar 15, 3:51 PM
Unknown Object (File)
Wed, Mar 4, 3:03 PM
Subscribers

Details

Summary

If VOP_ADD_WRITECOUNT() or adv locking failed, so VOP_CLOSE() needs to be called, we cannot use fp fo_close() when there is no fp. This occurs when e.g. kernel code directly calls vn_open() instead of the open(2) syscall.

In this case, VOP_CLOSE() can be called directly, after possible lock upgrade.

Reported by: nvass@gmx.com
PR: 255119

Diff Detail

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

Event Timeline

kib requested review of this revision.Apr 19 2021, 10:32 AM
kib created this revision.

This fixes the issue for me. I have started a full test on mercat1.

In D29830#669416, @pho wrote:

This fixes the issue for me. I have started a full test on mercat1.

I completed a full stress2 test without seeing any issues.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 21 2021, 3:08 PM
This revision was automatically updated to reflect the committed changes.