Page MenuHomeFreeBSD

VOP_VPUT_PAIR(): handle the case when dvp == vp
AcceptedPublic

Authored by kib on Wed, Jun 24, 6:23 PM.
Tags
None
Referenced Files
F160599705: D57824.diff
Fri, Jun 26, 1:51 AM
F160568490: D57824.diff
Thu, Jun 25, 6:51 PM
F160557733: D57824.diff
Thu, Jun 25, 4:08 PM
F160510397: D57824.id180574.diff
Thu, Jun 25, 5:44 AM
Unknown Object (File)
Wed, Jun 24, 11:07 PM
Unknown Object (File)
Wed, Jun 24, 11:07 PM
Unknown Object (File)
Wed, Jun 24, 11:05 PM
Unknown Object (File)
Wed, Jun 24, 8:13 PM
Subscribers

Details

Reviewers
jah
markj
mckusick

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Wed, Jun 24, 6:23 PM
kib retitled this revision from ffs_vput_pair(): handle the case when dvp == vp to VOP_VPUT_PAIR(): handle the case when dvp == vp.

Also handle in the default implementation

sys/ufs/ffs/ffs_vnops.c
2008–2009

Don't you also need to check here?

Is there some situation in which we expect dvp and vp to be the same, without the caller taking steps to avoid using VOP_VPUT_PAIR() in the first place?

kib marked an inline comment as done.Wed, Jun 24, 10:36 PM
In D57824#1325771, @jah wrote:

Is there some situation in which we expect dvp and vp to be the same, without the caller taking steps to avoid using VOP_VPUT_PAIR() in the first place?

I hope that no, there is no such case. I wanted to use VOP_VPUT_PAIR() in some path for the RENAME_EXCHANGE path but it requires more generic behavior.

Handle one more return place for dvp == vp.

sys/kern/vfs_default.c
1642–1643

What should the VOP do if unlock_vp is false and vp == dvp? Right now we're unconditionally unlocking it.

kib marked an inline comment as done.

Clean up the case dvp == vp && !unlock_vp.
Add comment to vop_stdvput_pair() explaining the intent.
Change vrele() to vunref() for locked vnode, but it should be nop since there must be one more use reference.

This revision is now accepted and ready to land.Thu, Jun 25, 11:19 PM