@@ -10,7 +10,7 @@ BEGIN {
$basedir =~ s|(.*)/[^/]*|$1|;
$fs = `stat -f --print %T $basedir`;
- $test_fibmap = ( $fs ne "btrfs" and $fs ne "nfs" );
+ $test_fibmap = ( $fs ne "btrfs" and $fs ne "nfs" and $fs ne "overlayfs" );
$test_count = 7;
if ($test_fibmap) {
@@ -27,11 +27,21 @@ int main(int argc, char **argv)
exit(1);
}
- /* This one should hit the FILE__GETATTR or FILE__IOCTL test */
+ /*
+ * This one should hit the FILE__GETATTR or FILE__IOCTL test.
+ * FIGETBSZ is not available on overlayfs,
+ * and FS_IOC_GETFLAGS is not available on NFS.
+ */
rc = ioctl(fd, FIGETBSZ, &val);
if( rc < 0 ) {
- perror("test_ioctl:FIGETBSZ");
- exit(1);
+ if(errno == EINVAL) {
+ rc = ioctl(fd, FS_IOC_GETFLAGS, &val);
+ }
+
+ if( rc < 0 ) {
+ perror("test_ioctl:FIGETBSZ/FS_IOC_GETFLAGS");
+ exit(1);
+ }
}
/* This one should hit the FILE__IOCTL test */
@@ -43,10 +43,17 @@ int main(int argc, char **argv)
exit(1);
}
- /* This one should hit the FILE__IOCTL or FILE__GETATTR test and fail. */
+ /*
+ * This one should hit the FILE__GETATTR or FILE__IOCTL test.
+ * FIGETBSZ is not available on overlayfs,
+ * and FS_IOC_GETFLAGS is not available on NFS.
+ */
rc = ioctl(fd, FIGETBSZ, &val);
+ if( rc == -1 && errno == EINVAL ) {
+ rc = ioctl(fd, FS_IOC_GETFLAGS, &val);
+ }
if( rc == 0 ) {
- printf("test_noioctl:FIGETBSZ");
+ printf("test_ioctl:FIGETBSZ/FS_IOC_GETFLAGS");
exit(1);
}
@@ -9,14 +9,15 @@ BEGIN {
chop($seuser);
$seuser =~ s|^(\w+):.*$|$1|;
- $isnfs = `stat -f --print %T $basedir`;
+ $fs = `stat -f --print %T $basedir`;
# check if kernel supports overlayfs and SELinux labeling
if ( system("grep -q security_inode_copy_up /proc/kallsyms") ) {
plan skip_all => "overlayfs not supported with SELinux in this kernel";
}
- elsif ( $isnfs eq "nfs" ) {
- plan skip_all => "overlayfs upperdir not supported on NFS";
+ elsif ( $fs eq "nfs" or $fs eq "overlayfs" ) {
+ plan skip_all =>
+ "overlayfs upperdir not supported on NFS and OverlayFS";
}
else {
plan tests => 119;