Home | History | Annotate | Download | only in ptyfs
History log of /src/sys/fs/ptyfs/ptyfs_subr.c
RevisionDateAuthorComments
 1.34  27-Nov-2020  christos make the order of the arguments in the PTYFS_FILENO macro consistent with
the order in the function calls. One of them was incorrect. Noticed by martin@
 1.33  15-Oct-2014  christos branches: 1.33.32;
From Ilia Zykov:
- correct some incorrect comments
- add XXX warning
- increase security by activating when get the slave
- make pty_vn_open() private to tty_ptm.c
 1.32  16-Aug-2014  hannken Needs HASH_SLIST, not HASH_LIST.
 1.31  15-Aug-2014  hannken Change ptyfs to vcache.
- Use (type, minor) as key.
- Change ptyfs_allocvp to return a referenced vnode and lock where needed.
- Remove unneeded vnode backpointer ptyfs_vnode.
- Keep a single hashlist for pty nodes to make their attributes persistent.

OK: Christos Zoulas
 1.30  13-Aug-2014  hannken - Add a map of active controlling ptys per mount and no longer abuse
the vnode lifecycle.
- No longer set "recycle" on VOP_INACTIVE().
- Make ptyfs_used_get() private to ptyfs_subr.c
- Stop copying device attributes from traditional ptys on first allocation.
- Remove unneeded argument "lwp" from ptyfs_allocvp() and ptyfs_free_get().

OK: Christos Zoulas
 1.29  27-Mar-2014  christos branches: 1.29.4;
From Ilya Zykov:
- ifdef out some code that is only used for NO_DEV_PTM
- pass the mountpoint instead of the ptm structure to the implementation
dependent (ptyfs or bsdpty) functions.
- add a function to return the correct ptyfs mountpoint for the current lwp
 1.28  26-Mar-2014  christos if one of the ptyfs instances has grabbed the handle don't grab it again,
Ilya Zykov
 1.27  21-Mar-2014  christos Ilya Zykov: Prepare readdir for multi-mountpoint use
 1.26  27-Feb-2014  hannken The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
 1.25  24-Oct-2012  christos branches: 1.25.2;
rename ptyfs_flag -> ptyfs_status to avoid confusion with ptyfs_flags
 1.24  23-Oct-2012  christos fix the mystery of the bad directory times.
 1.23  12-Jun-2011  rmind branches: 1.23.2; 1.23.8; 1.23.12;
Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.22  19-Nov-2010  dholland branches: 1.22.6;
Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
 1.21  21-Jul-2010  hannken Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.
 1.20  01-Jul-2010  hannken Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode. All LK_* flags move from sys/lock.h to sys/vnode.h. Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
 1.19  24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.18  24-Mar-2009  haad branches: 1.18.2; 1.18.4;
Destroy mutexes used to guard hash table during vfs_detach. Fixes LOCKDEBUG
panic when ptyfs module is unloaded.
 1.17  17-Dec-2008  cegger branches: 1.17.2;
kill MALLOC and FREE macros.
 1.16  05-May-2008  ad branches: 1.16.8;
- Convert hashinit() to use kmem_alloc(). The hash tables can be large
and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.
 1.15  30-Jan-2008  ad branches: 1.15.6; 1.15.8; 1.15.10;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
 1.14  25-Jan-2008  ad - Make new vnode construction MPSAFE.
- Replace use of lockmgr().
 1.13  24-Jan-2008  ad specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
vnode can describe a block device. Instead, prohibit concurrent opens of
block devices. As a bonus remove the unreliable code that prevents
multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
goes away, instead of abusing vnode::v_usecount to tell if the device is
open.
 1.12  02-Jan-2008  ad Merge vmlocking2 to head.
 1.11  08-Dec-2007  pooka branches: 1.11.4;
Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.10  26-Nov-2007  pooka branches: 1.10.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.9  10-Oct-2007  ad branches: 1.9.4;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.8  21-Jul-2007  ad branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10;
Don't depend on uvm_extern.h pulling in proc.h.
 1.7  14-May-2006  elad branches: 1.7.18; 1.7.28;
integrate kauth.
 1.6  13-Apr-2006  christos Strip the chrooted portion of the path from the reported pty path. Reported
and tested by Lasse Kliemann. Thanks!
 1.5  11-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10; 1.5.12;
merge ktrace-lwp.
 1.4  12-Sep-2005  christos don't play with ctime directly anymore.
 1.3  12-Sep-2005  christos Fix the CHANGE part too.
 1.2  11-Nov-2004  jdolecek branches: 1.2.2; 1.2.14;
update #include path to fs/ptyfs/
 1.1  11-Nov-2004  jdolecek move ptyfs off sys/miscfs/ptyfs/ to sys/fs/ptyfs/
 1.2.14.6  04-Feb-2008  yamt sync with head.
 1.2.14.5  21-Jan-2008  yamt sync with head
 1.2.14.4  07-Dec-2007  yamt sync with head
 1.2.14.3  27-Oct-2007  yamt sync with head.
 1.2.14.2  03-Sep-2007  yamt sync with head.
 1.2.14.1  21-Jun-2006  yamt sync with head.
 1.2.2.3  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.2  14-Nov-2004  skrll Sync with HEAD.
 1.2.2.1  11-Nov-2004  skrll file ptyfs_subr.c was added on branch ktrace-lwp on 2004-11-14 08:15:57 +0000
 1.5.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.10.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.5.10.2  19-Apr-2006  elad sync with head.
 1.5.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.5.8.1  24-May-2006  yamt sync with head.
 1.5.6.2  01-Jun-2006  kardel Sync with head.
 1.5.6.1  22-Apr-2006  simonb Sync with head.
 1.5.4.1  09-Sep-2006  rpaulo sync with head
 1.7.28.1  15-Aug-2007  skrll Sync with HEAD.
 1.7.18.6  23-Oct-2007  ad Sync with head.
 1.7.18.5  09-Oct-2007  ad Sync with head.
 1.7.18.4  16-Sep-2007  ad Checkpoint work in progress on the vnode lifecycle and reference counting
stuff. This makes it work properly without kernel_lock and fixes a few
quite old bugs. See vfs_subr.c 1.283.2.17 for details.
 1.7.18.3  17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.7.18.2  05-Apr-2007  ad Compile fixes.
 1.7.18.1  13-Mar-2007  ad Pull in the initial set of changes for the vmlocking branch.
 1.8.10.2  21-Jul-2007  ad Don't depend on uvm_extern.h pulling in proc.h.
 1.8.10.1  21-Jul-2007  ad file ptyfs_subr.c was added on branch matt-mips64 on 2007-07-21 19:06:22 +0000
 1.8.8.1  14-Oct-2007  yamt sync with head.
 1.8.6.3  23-Mar-2008  matt sync with HEAD
 1.8.6.2  09-Jan-2008  matt sync with HEAD
 1.8.6.1  06-Nov-2007  matt sync with HEAD
 1.8.4.3  09-Dec-2007  jmcneill Sync with HEAD.
 1.8.4.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.8.4.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.9.4.3  18-Feb-2008  mjf Sync with HEAD.
 1.9.4.2  27-Dec-2007  mjf Sync with HEAD.
 1.9.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.10.2.2  26-Dec-2007  ad Sync with head.
 1.10.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.11.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.15.10.3  11-Aug-2010  yamt sync with head.
 1.15.10.2  04-May-2009  yamt sync with head.
 1.15.10.1  16-May-2008  yamt sync with head.
 1.15.8.1  18-May-2008  yamt sync with head.
 1.15.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.15.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.16.8.2  28-Apr-2009  skrll Sync with HEAD.
 1.16.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.17.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.4.4  19-May-2011  rmind Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.
 1.18.4.3  05-Mar-2011  rmind sync with head
 1.18.4.2  03-Jul-2010  rmind sync with head
 1.18.4.1  16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.18.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.22.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.23.12.3  03-Dec-2017  jdolecek update from HEAD
 1.23.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.23.8.1  31-Oct-2012  riz Pull up following revision(s) (requested by christos in ticket #639):
sys/fs/ptyfs/ptyfs_subr.c: revision 1.24
fix the mystery of the bad directory times.
 1.23.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.23.2.1  30-Oct-2012  yamt sync with head
 1.25.2.1  18-May-2014  rmind sync with head
 1.29.4.1  17-Aug-2014  riz Pull up following revision(s) (requested by hannken in ticket #29):
sbin/mount_ptyfs/mount_ptyfs.8: revision 1.14
sys/fs/ptyfs/ptyfs_vnops.c: revision 1.48
sys/fs/ptyfs/ptyfs_vnops.c: revision 1.49
sys/fs/ptyfs/ptyfs_subr.c: revision 1.30
sys/fs/ptyfs/ptyfs_subr.c: revision 1.31
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.51
sys/fs/ptyfs/ptyfs_subr.c: revision 1.32
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.52
sys/fs/ptyfs/ptyfs_vfsops.c: revision 1.53
sys/fs/ptyfs/ptyfs.h: revision 1.13
sys/fs/ptyfs/ptyfs.h: revision 1.14
Needs HASH_SLIST, not HASH_LIST.
Change ptyfs to vcache.
- Use (type, minor) as key.
- Change ptyfs_allocvp to return a referenced vnode and lock where needed.
- Remove unneeded vnode backpointer ptyfs_vnode.
- Keep a single hashlist for pty nodes to make their attributes persistent.
OK: Christos Zoulas
Overflow if *data_len == OSIZE and args->version >= PTYFS_ARGSVERSION.
Sent on tech-kern@, ok christos@
Adapt to reality -- already open BSD style nodes do not appear on
ptyfs mounts (this changed some months ago).
- Add a map of active controlling ptys per mount and no longer abuse
the vnode lifecycle.
- No longer set "recycle" on VOP_INACTIVE().
- Make ptyfs_used_get() private to ptyfs_subr.c
- Stop copying device attributes from traditional ptys on first allocation.
- Remove unneeded argument "lwp" from ptyfs_allocvp() and ptyfs_free_get().
OK: Christos Zoulas
 1.33.32.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed