public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [xfstests PATCH] renameat2 syscall: turn EEXIST into ENOTEMPTY
@ 2014-04-14 10:49 Miklos Szeredi
  2014-04-16  0:31 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2014-04-14 10:49 UTC (permalink / raw)
  To: xfs

From: Miklos Szeredi <mszeredi@suse.cz>

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.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 src/renameat2.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/src/renameat2.c
+++ b/src/renameat2.c
@@ -88,6 +88,15 @@ int main(int argc, char *argv[])
 			else
 				return 0;
 		}
+		/*
+		 * Turn EEXIST into ENOTEMPTY.  E.g. XFS uses EEXIST, and that
+		 * is also accepted by the standards.
+		 *
+		 * This applies only to plain rename (flags == 0).
+		 */
+		if (!flags && errno == EEXIST)
+			errno = ENOTEMPTY;
+
 		perror("");
 		return 1;
 	}

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [xfstests PATCH] renameat2 syscall: turn EEXIST into ENOTEMPTY
  2014-04-14 10:49 [xfstests PATCH] renameat2 syscall: turn EEXIST into ENOTEMPTY Miklos Szeredi
@ 2014-04-16  0:31 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2014-04-16  0:31 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: xfs

On Mon, Apr 14, 2014 at 12:49:53PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
> 
> 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.
> 
> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>

looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-16  0:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 10:49 [xfstests PATCH] renameat2 syscall: turn EEXIST into ENOTEMPTY Miklos Szeredi
2014-04-16  0:31 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox