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>
This commit is contained in:
parent
5dcfcb715d
commit
2cc98f9ea5
9
mdmon.c
9
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)
|
||||
|
|
Loading…
Reference in New Issue