All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Liu <wl@xen.org>, Paul Durrant <paul@xen.org>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Elliott Mitchell <ehem+xen@m5p.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Ian Jackson <ian.jackson@citrix.com>
Subject: Re: [XEN RFC for-4.14] Re: use of "stat -"
Date: Thu, 25 Jun 2020 10:16:29 -0400	[thread overview]
Message-ID: <CAKf6xptOma_Xg4=iQ57uLqmmsXabcjEUaiVLQL886Tu+Q_naEw@mail.gmail.com> (raw)
In-Reply-To: <810ea6c8-1ae4-3ecc-3559-fde819f366fe@suse.com>

On Thu, Jun 25, 2020 at 9:48 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 25.06.2020 15:31, Ian Jackson wrote:
> > Jan Beulich writes ("Re: [XEN RFC for-4.14] Re: use of "stat -""):
> >> Looking at vfs_statx() in the kernel, I can't see any provisions to
> >> get at the data without traversing the specified path.
> >
> > The question is what "traversing the path" means.
> >
> > How do you explain this ?
> >
> > $ >t
> > $ exec 3>t
> > $ stat -L -c '%F %i' /dev/stdin <&3
> > regular empty file 421124
> > $ ll /dev/stdin <&3
> > lrwxrwxrwx 1 root root 15 Jun  7 02:01 /dev/stdin -> /proc/self/fd/0
> > $ ll /proc/self/fd/0 <&3
> > l-wx------ 1 ian ian 64 Jun 25 14:29 /proc/self/fd/0 -> /home/ian/t
> > $ mv t u
> > $ ll /proc/self/fd/0 <&3
> > l-wx------ 1 ian ian 64 Jun 25 14:29 /proc/self/fd/0 -> /home/ian/u
> > $ rm u
> > $ ll /proc/self/fd/0 <&3
> > l-wx------ 1 ian ian 64 Jun 25 14:29 /proc/self/fd/0 -> '/home/ian/u (deleted)'
> > $ stat -L -c '%F %i' /dev/stdin <&3
> > regular empty file 421124
> > $ ll -Li /dev/stdin <&3
> > 421124 -rw-rw-r-- 0 ian ian 0 Jun 25 14:28 /dev/stdin
> > $
> >
> > Clearly it isn't actually following this synthetic symlink to
> > "/home/ian/u (deleted)".
>
> Okay, so there's clearly some trickery then which don't know where
> to find.

I can't say I've taken the time to read and understand all this, but
the code in here
https://elixir.bootlin.com/linux/latest/source/fs/proc/fd.c#L147 seems
to lookup FDs to existing structs.

-Jason


  reply	other threads:[~2020-06-25 14:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 10:58 use of "stat -" Jan Beulich
2020-05-12 14:19 ` Wei Liu
2020-05-12 14:33   ` Jan Beulich
2020-05-12 14:47     ` Andrew Cooper
2020-05-12 14:59       ` Jan Beulich
2020-05-12 15:52         ` Jason Andryuk
2020-05-12 19:50           ` Elliott Mitchell
2020-05-12 19:54             ` Andrew Cooper
2020-05-12 22:54               ` Elliott Mitchell
2020-05-14 11:02                 ` Ian Jackson
2020-05-14 12:39                   ` Jan Beulich
2020-05-18 10:34                   ` Jan Beulich
2020-06-24 15:55                     ` Ping: " Jan Beulich
2020-06-24 16:19                     ` [XEN RFC for-4.14] " Ian Jackson
2020-06-25  2:37                       ` Jason Andryuk
2020-06-25  7:05                         ` Jan Beulich
2020-06-25 12:04                           ` Jason Andryuk
2020-06-25 13:31                           ` Ian Jackson
2020-06-25 13:48                             ` Jan Beulich
2020-06-25 14:16                               ` Jason Andryuk [this message]
2020-06-25  7:27                         ` Rich Persaud
2020-06-25 13:27                         ` Ian Jackson
2020-06-25 14:08                           ` Jan Beulich
2020-06-25 14:18                             ` Jason Andryuk
2020-06-25 14:37                               ` Ian Jackson
2020-06-25 14:19                             ` Ian Jackson
2020-06-25  7:03                       ` Paul Durrant

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='CAKf6xptOma_Xg4=iQ57uLqmmsXabcjEUaiVLQL886Tu+Q_naEw@mail.gmail.com' \
    --to=jandryuk@gmail.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=ehem+xen@m5p.com \
    --cc=ian.jackson@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=paul@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.