Le 04/09/2015 15:45, Peter Maydell a écrit : > On 1 September 2015 at 21:27, Laurent Vivier <[email protected]> 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 <[email protected]> >> --- >> 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 <[email protected]> > > (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
