xfs
[Top] [All Lists]

Re: [PATCH 2/4] renameat2 syscall: check plain rename

To: Miklos Szeredi <miklos@xxxxxxxxxx>
Subject: Re: [PATCH 2/4] renameat2 syscall: check plain rename
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 14 Apr 2014 12:30:20 +1000
Cc: xfs@xxxxxxxxxxx, Miklos Szeredi <mszeredi@xxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1397231517-4641-2-git-send-email-miklos@xxxxxxxxxx>
References: <1397231517-4641-1-git-send-email-miklos@xxxxxxxxxx> <1397231517-4641-2-git-send-email-miklos@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Apr 11, 2014 at 05:51:55PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@xxxxxxx>
> 
> Check with zero flags.  This is what rename(2) and renameat(2) now call, so
> this actually tests the behavior of these syscalls as well.
> 
> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>

Miklos, this test fails on XFS with the following diff:

$ diff -u tests/generic/023.out 
/home/dave/src/xfstests-dev/results//generic/023.out.bad
--- tests/generic/023.out       2014-04-14 10:44:22.000000000 +1000
+++ /home/dave/src/xfstests-dev/results//generic/023.out.bad    2014-04-14 
12:00:23.000000000 +1000
@@ -18,12 +18,12 @@
 samedir  dire/regu -> Not a directory
 samedir  dire/symb -> Not a directory
 samedir  dire/dire -> none/dire.
-samedir  dire/tree -> Directory not empty
+samedir  dire/tree -> File exists
 samedir  tree/none -> none/tree.
 samedir  tree/regu -> Not a directory
 samedir  tree/symb -> Not a directory
 samedir  tree/dire -> none/tree.
-samedir  tree/tree -> Directory not empty
+samedir  tree/tree -> File exists
 crossdir none/none -> No such file or directory
 crossdir none/regu -> No such file or directory
 crossdir none/symb -> No such file or directory
@@ -43,9 +43,9 @@
 crossdir dire/regu -> Not a directory
 crossdir dire/symb -> Not a directory
 crossdir dire/dire -> none/dire.
-crossdir dire/tree -> Directory not empty
+crossdir dire/tree -> File exists
 crossdir tree/none -> none/tree.
 crossdir tree/regu -> Not a directory
 crossdir tree/symb -> Not a directory
 crossdir tree/dire -> none/tree.
-crossdir tree/tree -> Directory not empty
+crossdir tree/tree -> File exists

IOWs, XFS is returning EEXIST rather than ENOTEMPTY for several of
these rename tests. The rename man page says this about the errors:

       ENOTEMPTY or EEXIST
              newpath is a nonempty directory, that is, contains
              entries other than "." and "..".

Which implies that both errors are valid and so the test should pass
in either case. Can you send a patch to handle these
different-but-valid error returns?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>