From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXrJL-0002M8-VP for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXrJI-0006QK-0X for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:45:47 -0400 Received: from mail-vk0-f51.google.com ([209.85.213.51]:33895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXrJH-0006QF-Q4 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 09:45:43 -0400 Received: by vkhf67 with SMTP id f67so11661288vkh.1 for ; Fri, 04 Sep 2015 06:45:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1441139253-6578-1-git-send-email-laurent@vivier.eu> References: <1441139253-6578-1-git-send-email-laurent@vivier.eu> From: Peter Maydell Date: Fri, 4 Sep 2015 14:45:23 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2] linux-user: add name_to_handle_at/open_by_handle_at List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Riku Voipio , QEMU Developers On 1 September 2015 at 21:27, Laurent Vivier 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 > --- > 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 (I guess the signalfd patch needs to be rebased on top of this, since this adds another syscall that returns an fd...) thanks -- PMM