]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC 246417,247116,248584:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 30 May 2013 19:24:29 +0000 (19:24 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 30 May 2013 19:24:29 +0000 (19:24 +0000)
commitc105662cf0c42f1daddcec11ea9f8549f2408178
tree813503ff15daa0910211d9c9018fac0caf5e9b62
parent1688fc8a4d53df0fa780e091e5acb4db6cdef847
MFC 246417,247116,248584:
Rework the handling of stop signals in the NFS client.  The changes in
195702, 195703, and 195821 prevented a thread from suspending while holding
locks inside of NFS by forcing the thread to fail sleeps with EINTR or
ERESTART but defer the thread suspension to the user boundary.  However,
this had the effect that stopping a process during an NFS request could
abort the request and trigger EINTR errors that were visible to userland
processes (previously the thread would have suspended and completed the
request once it was resumed).

This change instead effectively masks stop signals while in the NFS client.
It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot
be masked directly.  Instead of setting PBDRY on individual sleeps, change
the VFS_*() and VOP_*() methods to defer stop signals for filesystems which
request this behavior via a new VFCF_SBDRY flag.  Note that this has to be
a VFC flag rather than a MNTK flag so that it works properly with
VFS_MOUNT() when the mount is not yet fully constructed.  For now, only the
NFS clients set this new flag in VFS_SET().

A few other related changes:
- Add an assertion to ensure that TDF_SBDRY doesn't leak to userland.
- When a lookup request uses VOP_READLINK() to follow a symlink, mark
  the request as being on behalf of the thread performing the lookup
  (cnp_thread) rather than using a NULL thread pointer.  This causes
  NFS to properly handle signals during this VOP on an interruptible
  mount.
- Ignore thread suspend requests due to SIGSTOP if stop signals are
  currently deferred.  This can occur if a process is stopped via
  SIGSTOP while a thread is running or runnable but before it has set
  TDF_SBDRY.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
14 files changed:
sys/fs/nfs/nfs_commonkrpc.c
sys/fs/nfsclient/nfs_clvfsops.c
sys/gnu/fs/ext2fs/ext2_alloc.c
sys/kern/kern_sig.c
sys/kern/kern_thread.c
sys/kern/subr_sleepqueue.c
sys/kern/subr_trap.c
sys/kern/vfs_export.c
sys/kern/vfs_lookup.c
sys/nfsclient/nfs_krpc.c
sys/nfsclient/nfs_vfsops.c
sys/sys/mount.h
sys/sys/signalvar.h
sys/tools/vnode_if.awk