Skip to content

Commit fbcf244

Browse files
Cypresslinmetan-ucw
authored andcommitted
syscalls/utimensat01: add exception for Ubuntu 4.4 kernel
Ubuntu 4.4 kernel got this patch (b3b4283) since 4.4.0-48.69, therefore it will return EPERM instead of EACCES. Without this fix, the test will fail on Ubuntu 4.4 kernel with: FAIL: 18: utimensat() failed with incorrect error, expected EACCES: EPERM (1) FAIL: 19: utimensat() failed with incorrect error, expected EACCES: EPERM (1) Signed-off-by: Po-Hsu Lin <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent e2e60a3 commit fbcf244

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

testcases/kernel/syscalls/utimensat/utimensat01.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ static void tst_multi_set_time(enum tst_ts_type type, struct mytime *mytime)
158158

159159
static void update_error(struct test_case *tc)
160160
{
161+
static struct tst_kern_exv kvers[] = {
162+
/* Ubuntu kernel has patch b3b4283 since 4.4.0-48.69 */
163+
{ "UBUNTU", "4.4.0-48.69" },
164+
};
165+
161166
if (tc->exp_err != -1)
162167
return;
163168

@@ -167,7 +172,7 @@ static void update_error(struct test_case *tc)
167172
* This patch has also been merged to stable 4.4 with
168173
* b3b4283 ("vfs: move permission checking into notify_change() for utimes(NULL)")
169174
*/
170-
if (tst_kvercmp(4, 4, 27) < 0)
175+
if (tst_kvercmp2(4, 4, 27, kvers) < 0)
171176
tc->exp_err = EACCES;
172177
else
173178
tc->exp_err = EPERM;

0 commit comments

Comments
 (0)