From: Wang Chen <wangchen@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Alexey Dobriyan <adobriyan@sw.ru>
Subject: Re: [PATCH 03/15] [SUNRPC]: Use proc_create() to setup ->proc_fops first
Date: Fri, 29 Feb 2008 16:35:17 +0800 [thread overview]
Message-ID: <47C7C3C5.3000905@cn.fujitsu.com> (raw)
In-Reply-To: <47C79793.8060108@cn.fujitsu.com>
Wang Chen said the following on 2008-2-29 13:26:
> David Miller said the following on 2008-2-29 6:02:
>> From: Wang Chen <wangchen@cn.fujitsu.com>
>> Date: Thu, 28 Feb 2008 18:55:40 +0800
>>
>>> Use proc_create() to make sure that ->proc_fops be setup before gluing
>>> PDE to main tree.
>>>
>>> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>> Applied.
>>
>>> @@ -229,9 +229,8 @@ do_register(const char *name, void *data, const struct file_operations *fops)
>>> rpc_proc_init();
>>> dprintk("RPC: registering /proc/net/rpc/%s\n", name);
>>>
>>> - ent = create_proc_entry(name, 0, proc_net_rpc);
>>> + ent = proc_create(name, 0, proc_net_rpc, fops);
>>> if (ent) {
>>> - ent->proc_fops = fops;
>>> ent->data = data;
>>> }
>>> return ent;
>> For this case it appears that ent->data has the same kind of
>> visibility problem that ent->proc_fops does.
>>
>
> Thanks Dave, I will check whether ->data also has the visibility problem.
>
I have looked at the proc_create().
The reason for why we need to setup pde->proc_fops in proc_create() before
the pde be visible, is that proc_fops will be setuped in proc_register() and
and NULL of proc_fops will make proc_register() give pde an improper fops.
But, ->data and ->owner will not be affected by this instance.
So, it's safe to setup ->data and ->owner after visibility of pde.
next prev parent reply other threads:[~2008-02-29 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-28 10:55 [PATCH 03/15] [SUNRPC]: Use proc_create() to setup ->proc_fops first Wang Chen
2008-02-28 22:02 ` David Miller
2008-02-29 5:26 ` Wang Chen
2008-02-29 8:35 ` Wang Chen [this message]
2008-02-29 9:32 ` Alexey Dobriyan
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=47C7C3C5.3000905@cn.fujitsu.com \
--to=wangchen@cn.fujitsu.com \
--cc=adobriyan@sw.ru \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).