Skip to content

Commit

Permalink
test: do not support: F_GETLK, F_SETLK, F_SETLKW
Browse files Browse the repository at this point in the history
  • Loading branch information
ldorau committed Jun 20, 2017
1 parent 8f663b9 commit 5235756
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 13 deletions.
37 changes: 24 additions & 13 deletions syscalls-pmemfile.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
PMEMFILE SUPPORT
--------------------------------------------------------------------------
FLAGS - NOT SUPPORTED:

1. FLAGS - NOT SUPPORTED:
--------------------------------------------------------------------------
SYS_renameat2 mostly supported, unsupported flags: RENAME_WHITEOUT
SYS_openat mostly supported, O_ASYNC - unsupported, O_CLOEXEC, O_DIRECT, O_DSYNC, O_NOCTTY, O_SYNC - always enabled, O_NONBLOCK - ignored
SYS_renameat2 mostly supported:
- RENAME_WHITEOUT - unsupported
SYS_openat mostly supported,
- O_ASYNC - unsupported,
- O_CLOEXEC, O_DIRECT, O_DSYNC, O_NOCTTY, O_SYNC - always enabled,
- O_NONBLOCK - ignored
SYS_open see openat
SYS_fallocate partially supported, unsupported flags: FALLOC_FL_COLLAPSE_RANGE, FALLOC_FL_ZERO_RANGE, FALLOC_FL_INSERT_RANGE
SYS_fcntl partially supported, F_GETFL, F_GETFD - works, F_SETFD - not possible to clear FD_CLOEXEC, F_SETLK - does nothing, rest - unsupported
SYS_fallocate partially supported, unsupported flags:
- FALLOC_FL_COLLAPSE_RANGE,
- FALLOC_FL_ZERO_RANGE,
- FALLOC_FL_INSERT_RANGE
SYS_fcntl partially supported:
- F_GETFL, F_GETFD - supported,
- F_SETFD - not possible to clear FD_CLOEXEC,
- rest unsupported: F_GETLK, F_SETLK, F_SETLKW, F_SETOWN,
F_GETOWN, F_SETSIG, F_GETSIG, F_SETOWN_EX, F_GETOWN_EX,
F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW, F_SETLEASE,
F_GETLEASE, F_NOTIFY, F_ADD_SEALS, F_GET_SEALS

--------------------------------------------------------------------------
Does not work at all for relative paths:
2. Does not work at all for relative paths:
--------------------------------------------------------------------------
SYS_chroot
SYS_getxattr
SYS_lgetxattr
SYS_setxattr
SYS_lsetxattr

--------------------------------------------------------------------------
NOT SUPPORTED:
3. NOT SUPPORTED:
--------------------------------------------------------------------------
SYS_chroot not supported, does not work at all for relative paths
SYS_setxattr not supported, does not work at all for relative paths
Expand All @@ -34,8 +47,7 @@ SYS_execveat not supported
SYS_readahead not supported
SYS_name_to_handle_at not supported

--------------------------------------------------------------------------
NOT SUPPORTED _YET_:
4. NOT SUPPORTED _YET_:
--------------------------------------------------------------------------
SYS_dup not supported (yet)
SYS_dup2 not supported (yet)
Expand All @@ -50,8 +62,7 @@ SYS_sendfile not supported (yet?)
SYS_splice not supported (yet?)
SYS_mmap not supported (yet), also affects SYS_mprotect, SYS_munmap, SYS_mremap, SYS_msync

--------------------------------------------------------------------------
SUPPORTED
5. SUPPORTED
--------------------------------------------------------------------------
SYS_getxattr supported, returns no attributes, does not work at all for relative paths
SYS_lgetxattr supported, returns no attributes, does not work at all for relative paths
Expand Down
12 changes: 12 additions & 0 deletions test/antool.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@

# fcntl's flags:
F_SETFD = 2
F_GETLK = 5
F_SETLK = 6
F_SETLKW = 7
F_SETOWN = 8
F_GETOWN = 9
F_SETSIG = 10
Expand Down Expand Up @@ -816,6 +819,15 @@ def check_fcntl_flags(self, n):
if self[n].args[1] == F_SETFD and (self[n].args[2] & FD_CLOEXEC == 0):
self[n].unsupported_flag = "F_SETFD: not possible to clear FD_CLOEXEC flag"
ret = 1
elif self[n].args[1] == F_GETLK:
self[n].unsupported_flag = "F_GETLK"
ret = 1
elif self[n].args[1] == F_SETLK:
self[n].unsupported_flag = "F_SETLK"
ret = 1
elif self[n].args[1] == F_SETLKW:
self[n].unsupported_flag = "F_SETLKW"
ret = 1
elif self[n].args[1] == F_SETOWN:
self[n].unsupported_flag = "F_SETOWN"
ret = 1
Expand Down
3 changes: 3 additions & 0 deletions test/output-15.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Unsupported syscall's flag detected:
fallocate <FALLOC_FL_ZERO_RANGE>
fallocate <FALLOC_FL_INSERT_RANGE>
fcntl <F_SETFD: not possible to clear FD_CLOEXEC flag>
fcntl <F_GETLK>
fcntl <F_SETLK>
fcntl <F_SETLKW>
fcntl <F_SETOWN>
fcntl <F_GETOWN_EX>
fcntl <F_SETSIG>
Expand Down
6 changes: 6 additions & 0 deletions test/output-v-15.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Unsupported syscall's flag detected:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_SETFD: not possible to clear FD_CLOEXEC flag>:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_GETLK>:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_SETLK>:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_SETLKW>:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_SETOWN>:
/tmp/mnt/pmem/file [PMEM]
fcntl <F_GETOWN_EX>:
Expand Down
3 changes: 3 additions & 0 deletions test/output-vv-15.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Unsupported syscall's flag detected:
fallocate /tmp/mnt/pmem/file [PMEM] [unsupported flag:] FALLOC_FL_ZERO_RANGE
fallocate /tmp/mnt/pmem/file [PMEM] [unsupported flag:] FALLOC_FL_INSERT_RANGE
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_SETFD: not possible to clear FD_CLOEXEC flag
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_GETLK
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_SETLK
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_SETLKW
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_SETOWN
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_GETOWN$(*)
fcntl /tmp/mnt/pmem/file [PMEM] [unsupported flag:] F_SETSIG
Expand Down
9 changes: 9 additions & 0 deletions test/test_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,15 @@ test_analyzing_tool(char *dir, char *pmem, char *nonp)
fcntl(fdnonp, F_SETFD, fdfnonp & (~FD_CLOEXEC));
fcntl(fdpmem, F_SETFD, fdfpmem & (~FD_CLOEXEC));

fcntl(fdnonp, F_GETLK, 0);
fcntl(fdpmem, F_GETLK, 0);

fcntl(fdnonp, F_SETLK, 0);
fcntl(fdpmem, F_SETLK, 0);

fcntl(fdnonp, F_SETLKW, 0);
fcntl(fdpmem, F_SETLKW, 0);

fcntl(fdnonp, F_SETOWN, 0);
fcntl(fdpmem, F_SETOWN, 0);

Expand Down

0 comments on commit 5235756

Please sign in to comment.