qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: add name_to_handle_at/open_by_handle_at
Date: Fri, 4 Sep 2015 18:14:26 +0200	[thread overview]
Message-ID: <55E9C362.9050105@vivier.eu> (raw)
In-Reply-To: <CAFEAcA8=HQcqT7fDEWfsXryOkhDDqJAVHafteK_wKL97p7pyqQ@mail.gmail.com>



Le 04/09/2015 15:45, Peter Maydell a écrit :
> On 1 September 2015 at 21:27, Laurent Vivier <laurent@vivier.eu> wrote:
>> This patch allows to run example given by open_by_handle_at(2):
>>
>>       The following shell session demonstrates the use of these two programs:
>>
>>            $ echo 'Can you please think about it?' > cecilia.txt
>>            $ ./t_name_to_handle_at cecilia.txt > fh
>>            $ ./t_open_by_handle_at < fh
>>            open_by_handle_at: Operation not permitted
>>            $ sudo ./t_open_by_handle_at < fh      # Need CAP_SYS_ADMIN
>>            Read 31 bytes
>>            $ rm cecilia.txt
>>
>>        Now  we delete and (quickly) re-create the file so that it has the same
>>        content and (by chance) the  same  inode.[...]
>>
>>            $ stat --printf="%i\n" cecilia.txt     # Display inode number
>>            4072121
>>            $ rm cecilia.txt
>>            $ echo 'Can you please think about it?' > cecilia.txt
>>            $ stat --printf="%i\n" cecilia.txt     # Check inode number
>>            4072121
>>            $ sudo ./t_open_by_handle_at < fh
>>            open_by_handle_at: Stale NFS file handle
>>
>> See the man page for source code.
>>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>> v2: Rename function parameters, swap fh->handle_type in both functions,
>>     When I have re-tested the patch I have found a bug in the size of
>>     the data, so I fix this too (handle_bytes is the size of f_handle[]
>>     only, not of the whole structure)
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> (I guess the signalfd patch needs to be rebased on top of this,
> since this adds another syscall that returns an fd...)

Yes.

Thank you for the reviews. I'll rework the signalfd one.

Laurent

  reply	other threads:[~2015-09-04 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 20:27 [Qemu-devel] [PATCH v2] linux-user: add name_to_handle_at/open_by_handle_at Laurent Vivier
2015-09-04 13:45 ` Peter Maydell
2015-09-04 16:14   ` Laurent Vivier [this message]
2015-09-28 13:48 ` Riku Voipio

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=55E9C362.9050105@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).