From dc630c091b1c06e4b1081181c3f95489f48c333d Mon Sep 17 00:00:00 2001 From: JANAK DESAI Date: Tue, 7 Feb 2006 12:58:59 -0800 Subject: [PATCH] --- yaml --- r: 19992 b: refs/heads/master c: 99d1419d96d7df9cfa56bc977810be831bd5ef64 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/fork.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 0c0067cdb9a1..a199def0e294 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf2e340f4249b781b3d2beb41e891d08581f0e10 +refs/heads/master: 99d1419d96d7df9cfa56bc977810be831bd5ef64 diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 6eb9362775f9..598e5c27242c 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1371,15 +1371,18 @@ static int unshare_thread(unsigned long unshare_flags) } /* - * Unsharing of fs info for tasks created with CLONE_FS is not supported yet + * Unshare the filesystem structure if it is being shared */ static int unshare_fs(unsigned long unshare_flags, struct fs_struct **new_fsp) { struct fs_struct *fs = current->fs; if ((unshare_flags & CLONE_FS) && - (fs && atomic_read(&fs->count) > 1)) - return -EINVAL; + (fs && atomic_read(&fs->count) > 1)) { + *new_fsp = __copy_fs_struct(current->fs); + if (!*new_fsp) + return -ENOMEM; + } return 0; }