HomeFreeBSD

Work around an issue with mksnap_ffs not working in chroot'ed environment.

Description

Work around an issue with mksnap_ffs not working in chroot'ed environment.
The problem is that the statfs(2) system call used to determine the relevant
mount point returns path within real root in the f_mntonname, causing
nmount(2) system call to fail with ENOENT.

Use a bit of heuristics to skip over few starting path elements when it
happens until we hit an actual mount point.

For this to work properly the whole mount should be accessible within the
chroot, it's going to still fail if chroot only has access to a part of the
mounted fs.

Reviewed by: mckusick
Approved by: mckusick
MFC after: 2 weeks

Details

Provenance
sobomaxAuthored on
Reviewer
mckusick
Parents
rS316717: During a server crash recovery, fix the NFSv4.1 client for a NFSERR_BADSESSION
Branches
Unknown
Tags
Unknown