SVNews r322340

NOTE: This service is experimental and subject to change! Use at your own risk!

2017-08-10 05:38:31 - r322340 by dchagin (Dmitry Chagin)

Complete list of files affected by revision r322340:

(Note: At the moment, these links point to ViewVC on svn.freebsd.org. They are probably slow. Do not overuse.)

   Contents     MODIFY   /stable/11  
  History   Contents   Diff   MODIFY   /stable/11/share/man/man4/linux.4  
  History   Contents   Diff   MODIFY   /stable/11/share/man/man5/fdescfs.5  
  History   Contents   Diff   MODIFY   /stable/11/sys/fs/fdescfs/fdesc.h  
  History   Contents   Diff   MODIFY   /stable/11/sys/fs/fdescfs/fdesc_vfsops.c  
  History   Contents   Diff   MODIFY   /stable/11/sys/fs/fdescfs/fdesc_vnops.c  
  History   Contents   Diff   MODIFY   /stable/11/sys/kern/vfs_syscalls.c  
  History   Contents   Diff   MODIFY   /stable/11/sys/sys/vnode.h  

Commit message:

MFC r321839:

Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
Linux specific things to the native fdescfs file system.

Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.

Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.

For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has
beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle
it.

For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:

  mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11452

 


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 29 ms, 8 files printed. Current time is 2017-12-17 07:59:20. All times are in UTC/GMT.