Skip to contentSkip to conversation

utimensat: fix immutable file retcodes for 4.8.0 and newer.

PATCH New Artem Savkov 2 participants 3 messages Sep 1, 2016 – Oct 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utimensat: fix immutable file retcodes for 4.8.0 and newer.

Kernel 4.8.0 contains patch "337684a fs: return EPERM on immutable inode" that makes operations on immutable files return EPERM instead of EACCESS.

Adjust utimensat test to check new retcode for kernels 4.8.0 and newer.

---
 testcases/kernel/syscalls/utimensat/utimensat_tests.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/utimensat/utimensat_tests.sh +13 -4
index 4ae8651..708d454 100755
@@ -30,6 +30,15 @@ if tst_kvercmp 2 6 22 ; then
 	tst_brkm TCONF "System kernel version is less than 2.6.22,cannot execute test"
 fi
 
+# Starting with 4.8.0 operations on immutable files return EPERM instead of
+# EACCES.
+if tst_kvercmp 4 8 0; then
+	imaccess=EACCES
+else
+	imaccess=EPERM
+fi
+
+
 RESULT_FILE=$TMPDIR/utimensat.result
 
 TEST_DIR=$TMPDIR/utimensat_tests
@@ -415,10 +424,10 @@ echo "Testing immutable file, owned by self"
 echo
 
 echo "***** Testing times==NULL case *****"
-run_test -W "" 600 "+i" "" EACCES
+run_test -W "" 600 "+i" "" $imaccess
 
 echo "***** Testing times=={ UTIME_NOW, UTIME_NOW } case *****"
-run_test -W "" 600 "+i" "0 n 0 n" EACCES
+run_test -W "" 600 "+i" "0 n 0 n" $imaccess
 
 echo "***** Testing times=={ UTIME_OMIT, UTIME_OMIT } case *****"
 run_test -W "" 600 "+i" "0 o 0 o" SUCCESS n n
@@ -441,10 +450,10 @@ echo "Testing immutable append-only file, owned by self"
 echo
 
 echo "***** Testing times==NULL case *****"
-run_test -W "" 600 "+ai" "" EACCES
+run_test -W "" 600 "+ai" "" $imaccess
 
 echo "***** Testing times=={ UTIME_NOW, UTIME_NOW } case *****"
-run_test -W "" 600 "+ai" "0 n 0 n" EACCES
+run_test -W "" 600 "+ai" "0 n 0 n" $imaccess
 
 echo "***** Testing times=={ UTIME_OMIT, UTIME_OMIT } case *****"
 run_test -W "" 600 "+ai" "0 o 0 o" SUCCESS n n
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 utimensat: fix immutable file retcodes for 4.8.0 and newer.

----- Original Message -----

Quoted 6 lines

From: "Artem Savkov" <[email protected]>
To: [email protected]
Cc: [email protected], [email protected], "Artem Savkov" <[email protected]>
Sent: Thursday, 1 September, 2016 11:06:13 AM
Subject: [PATCH] utimensat: fix immutable file retcodes for 4.8.0 and newer.

Quoted 8 lines

Kernel 4.8.0 contains patch "337684a fs: return EPERM on immutable inode" that
makes operations on immutable files return EPERM instead of EACCESS.

Adjust utimensat test to check new retcode for kernels 4.8.0 and newer.

---

Looks good. 4.8 hasn't been released yet, so this patch is only in -rc builds so far. We don't try to mirror -rc changes as closely since things are sometimes unstable/get reverted/etc. So as fyi, we'll probably push this only after 4.8 gets released.

Regards,
Jan

#2 lore raw

PATCH 1/1 utimensat: fix immutable file retcodes for 4.8.0 and newer.

In reply to Artem Savkov

----- Original Message -----

Quoted 6 lines

From: "Artem Savkov" <[email protected]>
To: [email protected]
Cc: [email protected], [email protected], "Artem Savkov" <[email protected]>
Sent: Thursday, 1 September, 2016 11:06:13 AM
Subject: [PATCH] utimensat: fix immutable file retcodes for 4.8.0 and newer.

Quoted 7 lines

Kernel 4.8.0 contains patch "337684a fs: return EPERM on immutable inode" that
makes operations on immutable files return EPERM instead of EACCESS.

Adjust utimensat test to check new retcode for kernels 4.8.0 and newer.

Pushed.

Thanks,
Jan