[Bug 161424] [nullfs] __getcwd() calls fail when used on nullfs mount

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Aug 14 13:01:18 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=161424

Konstantin Belousov <kib at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib at FreeBSD.org

--- Comment #10 from Konstantin Belousov <kib at FreeBSD.org> ---
(In reply to fullermd from comment #9)
What you described is the expected behaviour, it is just a situation that it
always happens for nullfs, but only sporadically for other filesystems.

More precisely, nullfs does not use namecache for good reasons (we cannot
provide cache consistency between nullfs entries and lower filesystems without
some drastic measures).  If a filesystem uses namecache, then getcwd call first
tries to resolve the path using namecache, and only when the cache failed to
provide an entry, it falls down to read the ".." directory and searching the
child entry name by inode number.  So typically for fs like ufs or zfs, the
reading of ".." does not happen.

On the other hand, since nullfs does not use namecache, ".." is always scanned
and there the directory permissions starts to play.

So the fix, if we ever would change the observed behaviour, is to make getcwd
to honor the directory permissions even when the request is satisfied by the
namecache, making failure deterministic.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-fs mailing list