Bug #8376

cached v_path should be kept fresh

Added by Patrick Mooney almost 4 years ago. Updated almost 4 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


The logic for generating and maintaining the cached v_path value on vnodes could stand to be improved. If vnodes were purely ephemeral, then freshly calculating v_path at the time of lookup() would result in correct values (at a performance cost). When they persist, either as referenced by other structures (such as open files, process cwd, dnlc entries, etc), the opportunity for the v_path to become stale arises. This is exacerbated by the current behavior that, when v_path is found to be invalid (during a vnodetopath operation) will strive to recalculate it, but not preserve the result. The overall situation leads to both performance and correctness (due to lack of results) problems relating to v_path.

This has been addressed in SmartOS through a series of changes. Firstly, to do proper invalidation of v_path when it's found to be stale:
- OS-3891 stale v_path slows vfs lookups

OS-3891 revealed that some logic made assumptions about v_path never transitioning from non-NULL to NULL. It was addressed here:
- OS-4317 v_path accesses can race

While the pathological stale v_path behavior had been addressed, there are still cases where the absence of valid v_path information was causing problems. The largest patch in this series addressed it by performing v_path checking and updates during vnode lookups/updates, when it is most convenient:
- OS-5167 cached v_path should be kept fresh

Two smaller updates are included too, to prevent erroneous behavior introduced by the prior changes:
- OS-5846 procfs should follow VFS rules
- OS-6134 vn_reinit balks on zeroed vnodes

Related issues

Related to illumos gate - Bug #6015: vnode: v_path reading should be protected by v_lockIn ProgressMarcel Telka2015-06-19

Related to illumos gate - Bug #8438: panic in vnode_valid_pnClosedPatrick Mooney2017-06-28


Updated by Marcel Telka almost 4 years ago

  • Related to Bug #6015: vnode: v_path reading should be protected by v_lock added

Updated by Electric Monk almost 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit e2fc3408efa6cdfc5e33c73c3567efc8c7592707

commit  e2fc3408efa6cdfc5e33c73c3567efc8c7592707
Author: Patrick Mooney <>
Date:   2017-06-21T18:33:14.000Z

    8376 cached v_path should be kept fresh
    Reviewed by: Jerry Jelinek <>
    Reviewed by: Robert Mustacchi <>
    Approved by: Gordon Ross <>


Updated by Marcel Telka almost 4 years ago

  • Related to Bug #8438: panic in vnode_valid_pn added

Also available in: Atom PDF