As Ingo said: This depends on whether CLONE_FS was there at clone(2) time.
If it was, changing the directory would change it for all clones. If it
wasn't, changing it does *not* change it for the other clones, because
they have a copy of proc->fs.
So is this the intended behaviour? The application program can choose
whether it wants to share the cwd with the new clone. This moves policy
out of the kernel, so it seems like a good idea. The application program
cannot make this choice for the cwd individually; it would share the umask
and the root directory as well. This is probably acceptable.
AFAIK, being able to share the cwd between clones is required to implement
Posix threads (please somebody correct me if I'm wrong). So it would be
*wrong* if sys_chdir took clones into account.
Regards,
Martin