mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
renameat2 syscall: turn EEXIST into ENOTEMPTY
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>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
5fba951f43
commit
cd444c6591
@@ -92,6 +92,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user