summaryrefslogtreecommitdiffstats
path: root/sys/tools
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-02-21 19:02:50 +0000
committerjhb <jhb@FreeBSD.org>2013-02-21 19:02:50 +0000
commitca1e2e0739fbad3590a92aca668f4659d9e48b52 (patch)
tree089655cb610bf1daca917a806eaed3dfb2554455 /sys/tools
parent42e7ffdbc0cbb18e0dd9c588a2b26d27773a90a1 (diff)
downloadFreeBSD-src-ca1e2e0739fbad3590a92aca668f4659d9e48b52.zip
FreeBSD-src-ca1e2e0739fbad3590a92aca668f4659d9e48b52.tar.gz
Further refine the handling of stop signals in the NFS client. The
changes in r246417 were incomplete as they did not add explicit calls to sigdeferstop() around all the places that previously passed SBDRY to _sleep(). In addition, nfs_getcacheblk() could trigger a write RPC from getblk() resulting in sigdeferstop() recursing. Rather than manually deferring stop signals in specific places, 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 are 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. PR: kern/176179 Reported by: Russell Cattelan (sigdeferstop() recursion) Reviewed by: kib MFC after: 1 month
Diffstat (limited to 'sys/tools')
-rw-r--r--sys/tools/vnode_if.awk3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
index c991458..2347004 100644
--- a/sys/tools/vnode_if.awk
+++ b/sys/tools/vnode_if.awk
@@ -172,6 +172,7 @@ if (cfile) {
"#include <sys/kernel.h>\n" \
"#include <sys/mount.h>\n" \
"#include <sys/sdt.h>\n" \
+ "#include <sys/signalvar.h>\n" \
"#include <sys/systm.h>\n" \
"#include <sys/vnode.h>\n" \
"\n" \
@@ -365,10 +366,12 @@ while ((getline < srcfile) > 0) {
add_debug_code(name, args[i], "Entry", "\t");
printc("\tKTR_START" ctrstr);
add_pre(name);
+ printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);")
printc("\tif (vop->"name" != NULL)")
printc("\t\trc = vop->"name"(a);")
printc("\telse")
printc("\t\trc = vop->vop_bypass(&a->a_gen);")
+ printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);")
printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n");
printc("\tif (rc == 0) {");
for (i = 0; i < numargs; ++i)
OpenPOWER on IntegriCloud