Hi, This patch fixes fcntl27 and fcntl28 test cases failures seen on RHEL 4 kernel (2.6.9 based).
# ./fcntl27 fcntl27 1 FAIL : fcntl(tfile_1206, F_SETLEASE, F_RDLCK) failed with errno 11 : Resource temporarily unavailable # ./fcntl28 fcntl28 1 FAIL : fcntl(tfile_1213, F_SETLEASE, F_RDLCK) failed with errno 11 : Resource temporarily unavailable It because the expected result in incorrect. There is a kernel version comparison code in both tests. if ((results=tst_kvercmp(2,6,10)) >= 0) { expected_result = -1; } else if( ((results=tst_kvercmp(2,4,0)) >= 0)&&\ ((results=tst_kvercmp(2,6,0))< 0) ) { expected_result = 1; } else if( ((results=tst_kvercmp(2,6,0)) >= 0)&&\ ((results=tst_kvercmp(2,6,10))< 0) ) { expected_result = 0; } else { expected_result = -1; } Because it is kernel 2.6.9, the "expected_result" will be 0. However, the actual return code is the same as other kernels like 2.6.18, as it only allow F_RDLCK option to be placed on a read-only file descriptor (man fcntl). # strace ./fcntl27 ... open("tfile_1453", O_RDWR|O_CREAT, 0777) = 3 ... fcntl(3, 0x400 /* F_??? */, 0) = -1 EAGAIN (Resource temporarily unavailable) I have no idea where is the above kernel version and expected code mapping originally came from. I have searched the manpage of fcntl(), but not found any mention of 2.6.10. Since there is a check already, #ifdef F_SETLEASE I have removed the above code like other fcntl* test cases, but I am willing to listen other options. Signed-off-by: CAI Qian <caiq...@cclom.cn> --- ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl27.c.orig 2009-01-15 04:12:02.000000000 -0500 +++ ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl27.c 2009-01-15 04:18:01.000000000 -0500 @@ -116,8 +116,6 @@ int lc,expected_result = -1; /* loop counter, expected */ /* result from system call */ char *msg; /* message returned from parse_opts */ - int results; /* Stores the result of the */ - /* kernel comparison test */ /*************************************************************** * parse standard options ***************************************************************/ @@ -131,24 +129,7 @@ TEST_EXP_ENOS(exp_enos); - if( (results=tst_kvercmp(2,6,10)) >= 0) - { - expected_result = -1; - } - else if( ((results=tst_kvercmp(2,4,0)) >= 0)&&\ - ((results=tst_kvercmp(2,6,0))< 0) ) - { - expected_result = 1; - } - else if( ((results=tst_kvercmp(2,6,0)) >= 0)&&\ - ((results=tst_kvercmp(2,6,10))< 0) ) - { - expected_result = 0; - } - else - { - expected_result = -1; - } + expected_result = -1; /*************************************************************** * check looping state if -c option given --- ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl28.c.orig 2009-01-15 04:12:08.000000000 -0500 +++ ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl28.c 2009-01-15 04:17:47.000000000 -0500 @@ -112,7 +112,6 @@ int lc,expected_result = -1; /* loop counter, expected resul*/ /* from system call */ char *msg; /* message returned from parse_opts */ - int results; /* stores result of kernel comparison */ /*************************************************************** * parse standard options ***************************************************************/ @@ -127,24 +126,7 @@ /* set the expected errnos... */ TEST_EXP_ENOS(exp_enos); - if ((results=tst_kvercmp(2,6,10)) >= 0) - { - expected_result = -1; - } - else if( ((results=tst_kvercmp(2,4,0)) >= 0)&&\ - ((results=tst_kvercmp(2,6,0))< 0) ) - { - expected_result = 1; - } - else if( ((results=tst_kvercmp(2,6,0)) >= 0)&&\ - ((results=tst_kvercmp(2,6,10))< 0) ) - { - expected_result = 0; - } - else - { - expected_result = -1; - } + expected_result = -1; /*************************************************************** * check looping state if -c option given ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list