From: Roman Mashak <mrv@mojatatu.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: NETDEV <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrey Vagin <avagin@openvz.org>,
"David S. Miller" <davem@davemloft.net>,
Pavel Emelyanov <xemul@virtuozzo.com>
Subject: Re: [RFC] net/unix_diag: Provide UDIAG_SHOW_VFS2 attribute to fetch complete inode number
Date: Wed, 25 Oct 2017 09:55:07 -0400 [thread overview]
Message-ID: <85bmkvcoxw.fsf@mojatatu.com> (raw)
In-Reply-To: <20171024214814.GO5343@uranus> (Cyrill Gorcunov's message of "Wed, 25 Oct 2017 00:48:14 +0300")
Cyrill Gorcunov <gorcunov@gmail.com> writes:
> Currently unix_diag_vfs structure reports unix socket inode
> as u32 value which of course doesn't fit to ino_t type and
> the number may be trimmed. Lets rather deprecate old UDIAG_SHOW_VFS
> interface and provide UDIAG_SHOW_VFS2 (with one field "__zero" reserved
> which we could extend in future).
>
[...]
> -static int sk_diag_dump_vfs(struct sock *sk, struct sk_buff *nlskb)
> +static int sk_diag_dump_vfs(struct sock *sk, struct sk_buff *nlskb, unsigned int flags)
> {
> struct dentry *dentry = unix_sk(sk)->path.dentry;
>
> if (dentry) {
> - struct unix_diag_vfs uv = {
> - .udiag_vfs_ino = d_backing_inode(dentry)->i_ino,
> - .udiag_vfs_dev = dentry->d_sb->s_dev,
> - };
> -
> - return nla_put(nlskb, UNIX_DIAG_VFS, sizeof(uv), &uv);
> + if (flags & UDIAG_SHOW_VFS2) {
> + struct unix_diag_vfs uv = {
> + .udiag_vfs_ino = d_backing_inode(dentry)->i_ino,
> + .udiag_vfs_dev = dentry->d_sb->s_dev,
> + };
> + return nla_put(nlskb, UNIX_DIAG_VFS, sizeof(uv), &uv);
> + } else {
> + struct unix_diag_vfs2 uv = {
> + .udiag_vfs_ino = d_backing_inode(dentry)->i_ino,
> + .udiag_vfs_dev = dentry->d_sb->s_dev,
> + };
I think __zero should be explicitly set to 0.
[...]
next prev parent reply other threads:[~2017-10-25 13:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 21:48 [RFC] net/unix_diag: Provide UDIAG_SHOW_VFS2 attribute to fetch complete inode number Cyrill Gorcunov
2017-10-25 0:25 ` Andrei Vagin
2017-10-25 7:27 ` Cyrill Gorcunov
2017-10-25 13:55 ` Roman Mashak [this message]
2017-10-25 14:02 ` Cyrill Gorcunov
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=85bmkvcoxw.fsf@mojatatu.com \
--to=mrv@mojatatu.com \
--cc=avagin@openvz.org \
--cc=davem@davemloft.net \
--cc=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xemul@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox