Bug 175449 - [unionfs] unionfs and devfs misbehaviour
Summary: [unionfs] unionfs and devfs misbehaviour
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 1.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-20 14:50 UTC by David Naylor
Modified: 2023-05-12 03:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Naylor 2013-01-20 14:50:00 UTC
When creating a uniofs based chroot I discovered some strange behaviour with dev/.

Fix: 

Workaround:

# mkdir bottom-p bottom/dev top
# mount -t unionfs -o below bottom top
# mount -t tmpfs tmdevfs devfs top/dev
# touch top/dev
How-To-Repeat: # mkdir bottom-p bottom/dev top
# mount -t unionfs -o below bottom top
# mount -t tmpfs tmdevfs devfs top/dev
# ls -l top/dev/null
ls: top/dev/null: No such file or directory
# touch top/dev/null
# ls -l top/dev/null
-rw-r--r--  1 root  wheel  0 Jan 20 16:35 top/dev/null
# touch top/dev
# ls -l top/dev/null
crw-rw-rw-  1 root  wheel    0,  18 Jan 20 16:34 top/dev/null
Comment 1 David Naylor 2013-01-21 18:17:08 UTC
Another example, this time using nullfs:

# mkdir -p bottom top nullfs/dir top/mnt
# touch nullfs/dir/file
# mount -t unionfs bottom top
# mount -t nullfs nullfs top/mnt
# ls top/mnt/dir/
ls: top/mnt/dir/: No such file or directory
# ls top/mnt/
dir
# ls top/mnt/dir/
file
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2013-03-10 04:56:44 UTC
Responsible Changed
From-To: freebsd-bugs->daichi

Over to maintainer.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
State Changed
From-To: open->open

commit bit has been taken in for safekeeping. 


Comment 4 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
Responsible Changed
From-To: daichi->freebsd-fs
Comment 5 David Naylor freebsd_committer freebsd_triage 2014-12-16 14:23:31 UTC
This bug is still applicable on FreeBSD 10.1-RELEASE
Comment 6 David Naylor freebsd_committer freebsd_triage 2018-12-12 13:56:06 UTC
This is still an issue on FreeBSD 11.2.  The issue appears to be that unionfs requires a ls(1) (I'm guessing a lstat) before it will allow traversing of the directory...