Received: from eggs.gnu.org ([2001:4830:134:3::10]:56757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXtdS-0006hx-9x for qemu-devel@nongnu.org; Fri, 04 Sep 2015 12:14:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXtdP-0007YH-2d for qemu-devel@nongnu.org; Fri, 04 Sep 2015 12:14:42 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:57029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXtdO-0007Y4-T1 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 12:14:39 -0400 References: <1441139253-6578-1-git-send-email-laurent@vivier.eu> From: Laurent Vivier Message-ID: <55E9C362.9050105@vivier.eu> Date: Fri, 4 Sep 2015 18:14:26 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Peter Maydell Cc: Riku Voipio , QEMU Developers Le 04/09/2015 15:45, Peter Maydell a écrit : > 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...) Yes. Thank you for the reviews. I'll rework the signalfd one. Laurent