summaryrefslogtreecommitdiff
path: root/mdmon.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-07-14 14:59:39 -0700
committerDan Williams <dan.j.williams@intel.com>2008-07-14 14:59:39 -0700
commit2cc98f9ea58485e1f539f77ba3eb5d9788908ae6 (patch)
treee07d80049e976020e3becae5ea593f4cf8f26783 /mdmon.c
parent5dcfcb715d91f7d2f45afaaabb93ad311e384ea6 (diff)
mdmon: close small window of invalid mon_tid
There is a small chance that the manager tries to wake the monitor before mon_tid is set. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdmon.c')
-rw-r--r--mdmon.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/mdmon.c b/mdmon.c
index 99f2f2c4..c7d7f680 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -52,7 +52,6 @@ int run_child(void *v)
{
struct supertype *c = v;
- mon_tid = syscall(SYS_gettid);
do_monitor(c);
return 0;
}
@@ -60,16 +59,14 @@ int run_child(void *v)
int clone_monitor(struct supertype *container)
{
static char stack[4096];
- int rv;
-
- rv = clone(run_child, stack+4096-64,
+ mon_tid = clone(run_child, stack+4096-64,
CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
container);
mgr_tid = syscall(SYS_gettid);
-
- return rv;
+
+ return mon_tid;
}
static struct superswitch *find_metadata_methods(char *vers)