==== Error log =====
fcntl24 1 TFAIL : fcntl24.c:148: fcntl(tfile_7254, F_SETLEASE, F_WRLCK) Failed, errno=11 : Resource temporarily unavailable
fcntl25 1 TFAIL : fcntl25.c:149: fcntl(tfile_7255, F_SETLEASE, F_WRLCK) Failed, errno=11 : Resource temporarily unavailable
fcntl26 1 TFAIL : fcntl26.c:149: fcntl(tfile_7256, F_SETLEASE, F_WRLCK) Failed, errno=11 : Resource temporarily unavailable
fcntl33.c:118: FAIL: fcntl() failed to set lease: EAGAIN/EWOULDBLOCK
fcntl33.c:118: FAIL: fcntl() failed to set lease: EAGAIN/EWOULDBLOCK
fcntl33.c:118: FAIL: fcntl() failed to set lease: EAGAIN/EWOULDBLOCK
fcntl33.c:118: FAIL: fcntl() failed to set lease: EAGAIN/EWOULDBLOCK
Reported-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Li Wang <liwang@redhat.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Ye Chao <cye@redhat.com>
---
include/tst_fs.h | 1 +
lib/tst_fs_type.c | 2 ++
testcases/kernel/syscalls/fcntl/fcntl24.c | 12 +++++++++---
testcases/kernel/syscalls/fcntl/fcntl25.c | 12 +++++++++---
testcases/kernel/syscalls/fcntl/fcntl26.c | 12 +++++++++---
testcases/kernel/syscalls/fcntl/fcntl33.c | 8 +++++++-
6 files changed, 37 insertions(+), 10 deletions(-)
@@ -41,6 +41,7 @@
#define TST_F2FS_MAGIC 0xF2F52010
#define TST_NILFS_MAGIC 0x3434
#define TST_EXOFS_MAGIC 0x5DF5
+#define TST_OVERLAYFS_MAGIC 0x794c7630
enum {
TST_BYTES = 1,
@@ -82,6 +82,8 @@ const char *tst_fs_type_name(long f_type)
return "NILFS";
case TST_EXOFS_MAGIC:
return "EXOFS";
+ case TST_OVERLAYFS_MAGIC:
+ return "OVERLAYFS";
default:
return "Unknown";
}
@@ -143,9 +143,15 @@ int main(int ac, char **av)
/* check return code */
if (TEST_RETURN == -1) {
- tst_resm(TFAIL,
- "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
- fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ if (type == TST_OVERLAYFS_MAGIC && TEST_ERRNO == EAGAIN) {
+ tst_resm(TINFO | TTERRNO,
+ "fcntl(F_SETLEASE, F_WRLCK) "
+ "failed on overlapfs as expected");
+ } else {
+ tst_resm(TFAIL,
+ "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
+ fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ }
} else {
TEST(fcntl(fd, F_GETLEASE));
if (TEST_RETURN != F_WRLCK)
@@ -144,9 +144,15 @@ int main(int ac, char **av)
/* check return code */
if (TEST_RETURN == -1) {
- tst_resm(TFAIL,
- "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
- fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ if (type == TST_OVERLAYFS_MAGIC && TEST_ERRNO == EAGAIN) {
+ tst_resm(TINFO | TTERRNO,
+ "fcntl(F_SETLEASE, F_WRLCK) "
+ "failed on overlapfs as expected");
+ } else {
+ tst_resm(TFAIL,
+ "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
+ fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ }
} else {
TEST(fcntl(fd, F_GETLEASE));
if (TEST_RETURN != F_WRLCK)
@@ -144,9 +144,15 @@ int main(int ac, char **av)
/* check return code */
if (TEST_RETURN == -1) {
- tst_resm(TFAIL,
- "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
- fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ if (type == TST_OVERLAYFS_MAGIC && TEST_ERRNO == EAGAIN) {
+ tst_resm(TINFO | TTERRNO,
+ "fcntl(F_SETLEASE, F_WRLCK) "
+ "failed on overlapfs as expected");
+ } else {
+ tst_resm(TFAIL,
+ "fcntl(%s, F_SETLEASE, F_WRLCK) Failed, errno=%d : %s",
+ fname, TEST_ERRNO, strerror(TEST_ERRNO));
+ }
} else {
TEST(fcntl(fd, F_GETLEASE));
if (TEST_RETURN != F_WRLCK)
@@ -115,7 +115,13 @@ static void do_test(unsigned int i)
TEST(fcntl(fd, F_SETLEASE, test_cases[i].lease_type));
if (TST_RET == -1) {
- tst_res(TFAIL | TTERRNO, "fcntl() failed to set lease");
+ if (type == TST_OVERLAYFS_MAGIC && TST_ERR == EAGAIN) {
+ tst_res(TINFO | TTERRNO,
+ "fcntl(F_SETLEASE, F_WRLCK) "
+ "failed on overlapfs as expected");
+ } else {
+ tst_res(TFAIL | TTERRNO, "fcntl() failed to set lease");
+ }
goto exit;
}