From: zhaogongyi via ltp <ltp@lists.linux.it>
To: "rpalethorpe@suse.de" <rpalethorpe@suse.de>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] syscalls/fork02: new test for fork()
Date: Wed, 16 Nov 2022 02:51:53 +0000 [thread overview]
Message-ID: <515431fcd75945108f09f98babcffef9@huawei.com> (raw)
Hi!
>
> Hello,
>
> Zhao Gongyi via ltp <ltp@lists.linux.it> writes:
>
> > Verify that current workdir correctly inherited by child.
>
> I'm not convinced by Cyrils comments that this should be included. I doubt
> LTP would work if the CWD wasn't inherited by children. At least in the
> common case. The test needs to do something more IMO.
>
> Perhaps there has been a kernel bug involving fork and CWD? Perhaps
> relating to new file systems and mount options. I doubt we will see issues
> on a common setup. This isn't adding any test coverage in that case.
>
> Also the path to the CWD and the CWD are two different things. The
> kernel generates the path on each invocation of getcwd IIRC.
>
> Marking this as changes requested in patchwork. Although really, I think
> effort should be directed at clone3 which is lacking a lot of coverage.
>
> --
> Thank you,
> Richard.
the pwd is one member of fs_struct:
struct fs_struct {
int users;
spinlock_t lock;
seqcount_spinlock_t seq;
int umask;
int in_exec;
struct path root, pwd;
} __randomize_layout;
And fs_struct is one member of struct task_struct:
/* Filesystem information: */
struct fs_struct *fs;
In my opinion, the pwd will inherit from parent naturally if there is no a explicit change in fork.
Regards,
Gongyi
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2022-11-16 2:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 2:51 zhaogongyi via ltp [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-11-01 1:05 [LTP] [PATCH] syscalls/fork02: new test for fork() zhaogongyi via ltp
2022-11-02 9:06 ` Cyril Hrubis
2022-10-25 2:30 zhaogongyi via ltp
2022-10-31 13:46 ` Cyril Hrubis
2022-10-21 6:50 Zhao Gongyi via ltp
2022-10-25 2:18 ` xuyang2018.jy
2022-11-07 10:49 ` Richard Palethorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=515431fcd75945108f09f98babcffef9@huawei.com \
--to=ltp@lists.linux.it \
--cc=rpalethorpe@suse.de \
--cc=zhaogongyi@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.