]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix Linux fallocate tests for EOPNOTSUPP
authorAdhemerval Zanella <adhemerval.zanella@linaro.com>
Mon, 17 Oct 2016 18:59:17 +0000 (16:59 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>
Tue, 18 Oct 2016 10:56:22 +0000 (08:56 -0200)
The fallocate syscall might fail on Linux due missing support from
underlying filesystem (for instance some NFS versions).  This patch
adds this check for fallocate tests.  It also moves tst-fallocate{64}
to 'io' folder (since it is on fallocate{64} is built).

Checked on x86_64.

* sysdeps/unix/sysv/linux/Makefile [$(subdir) = math] (tests): Move
tst-fallocate{64}.
* sysdeps/unix/sysv/linux/tst-fallocate-common.c: Check for EOPNOTSUPP
on syscall return.

ChangeLog
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/tst-fallocate-common.c

index 11ee620309255d42b44cfd8f0398d0515589c2c4..adc4df985dc133a16e0bf952bc7b679368068a5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-18  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysv/linux/Makefile [$(subdir) = math] (tests): Move
+       tst-fallocate{64}.
+       * sysdeps/unix/sysv/linux/tst-fallocate-common.c: Check for EOPNOTSUPP
+       on syscall return.
+
 2016-10-17  Carlos O'Donell  <carlos@redhat.com>
 
        [BZ #20689]
index 101e120eb20e0da42e6bdcd2c1ec87d573fdd7e0..e329a6b3f90f36258d46db8b5b9f0450af5fc24b 100644 (file)
@@ -43,7 +43,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
                  bits/mman-linux.h
 
 tests += tst-clone tst-clone2 tst-fanotify tst-personality tst-quota \
-        tst-fallocate tst-fallocate64 tst-sync_file_range
+        tst-sync_file_range
 
 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
 
@@ -173,6 +173,8 @@ ifeq ($(subdir),io)
 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
                   sync_file_range fallocate fallocate64
 sysdep_headers += bits/fcntl-linux.h
+
+tests += tst-fallocate tst-fallocate64
 endif
 
 ifeq ($(subdir),elf)
index 9879488687bd060c738f77f3a799b30ab7ea9a94..d98bf4a3e64ad23ce948cd22890883e6bf07d5b4 100644 (file)
@@ -58,7 +58,13 @@ do_test_with_offset (off_t offset)
      and check if both buffer have the same contents.  */
   ret = fallocate (temp_fd, 0, offset, BLK_SIZE);
   if (ret == -1)
-    FAIL_EXIT1 ("fallocate failed");
+    {
+      /* fallocate might not be fully supported by underlying filesystem (for
+        instance some NFS versions).   */
+      if (errno == EOPNOTSUPP)
+       FAIL_EXIT (77, "fallocate not supported");
+      FAIL_EXIT1 ("fallocate failed");
+    }
 
   ret = fstat (temp_fd, &finfo);
   if (ret == -1)