As Shuang Qiu <[email protected]> reports:
* The 32 bit link count in the inode theoretically maxes out at UINT_MAX.
* Since the pathconf interface is signed, we use 2^31 - 1 instead.
* The old inode format had a 16 bit link count, so its maximum is USHRT_MAX.
#define XFS_MAXLINK             ((1U << 31) - 1U)
#define XFS_MAXLINK_1           65535U
We are not able to reach such limitation.

If the mntpoint is xfs, we skip the setup for EMLINK and return TCONF in the
EMLINK test.

Signed-off-by: Zeng Linggang <[email protected]>
---
 testcases/kernel/syscalls/linkat/linkat02.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/linkat/linkat02.c 
b/testcases/kernel/syscalls/linkat/linkat02.c
index 26a244c..29bc44b 100644
--- a/testcases/kernel/syscalls/linkat/linkat02.c
+++ b/testcases/kernel/syscalls/linkat/linkat02.c
@@ -36,6 +36,7 @@
 #include "linux_syscall_numbers.h"
 #include "safe_macros.h"
 #include "lapi/fcntl.h"
+#include "tst_fs_type.h"
 
 #define DIR_MODE       (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
                         S_IXGRP|S_IROTH|S_IXOTH)
@@ -127,8 +128,15 @@ int main(int ac, char **av)
 
 static void linkat_verify(const struct test_struct *desc)
 {
-       if (desc->setupfunc != NULL)
-               desc->setupfunc();
+       if (desc->setupfunc != NULL) {
+               if (desc->setupfunc == setup_emlink &&
+                   tst_fs_type(cleanup, "mntpoint") == TST_XFS_MAGIC) {
+                       tst_resm(TCONF, "Test skip XFS filesystem.");
+                       return;
+               } else {
+                       desc->setupfunc();
+               }
+       }
 
        TEST(ltp_syscall(__NR_linkat, AT_FDCWD, desc->oldfname,
                         AT_FDCWD, desc->newfname, desc->flags));
@@ -194,6 +202,9 @@ static void setup(void)
 
        SAFE_TOUCH(cleanup, TEST_EMLINK, 0666, NULL);
 
+       if (tst_fs_type(cleanup, "mntpoint") == TST_XFS_MAGIC)
+               return;
+
        while (1) {
                sprintf(lname, "%s%ld", BASENAME, ++link_max);
                TEST(link(TEST_EMLINK, lname));
-- 
1.8.4.2




------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to