Skip to contentSkip to conversation

syscalls/lseek11: take EOPNOTSUPP as not supported too

PATCH New Eryu Guan 3 participants 3 messages May 24, 2017 – May 26, 2017

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/1 syscalls/lseek11: take EOPNOTSUPP as not supported too

Filesystems could set errno to EOPNOTSUPP to indicate SEEK_DATA/HOLE operations are not supported by this fs, e.g. NFSv4.0/v4.1, so exit test with TCONF when EOPNOTSUPP is returned.

---
 testcases/kernel/syscalls/lseek/lseek11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/lseek/lseek11.c +1 -1
index 47987c1..54d5da6 100644
@@ -119,7 +119,7 @@ static void get_blocksize(void)
 		SAFE_FSYNC(fd);
 		pos = lseek(fd, 0, SEEK_DATA);
 		if (pos == -1) {
-			if (errno == EINVAL) {
+			if (errno == EINVAL || errno == EOPNOTSUPP) {
 				tst_brk(TCONF | TERRNO, "SEEK_DATA "
 					"and SEEK_HOLE not implemented");
 			}
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/1 syscalls/lseek11: take EOPNOTSUPP as not supported too

Quoted 3 lines · Eryu Guan

Filesystems could set errno to EOPNOTSUPP to indicate SEEK_DATA/HOLE operations are not supported by this fs, e.g. NFSv4.0/v4.1, so exit test with TCONF when EOPNOTSUPP is returned.

Wow, I didn't test on NFS-4.X when I wrote this case, thanks for finding this.

Thanks,
Zorro

Quoted 22 lines
---
 testcases/kernel/syscalls/lseek/lseek11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/lseek/lseek11.c +1 -1
index 47987c1..54d5da6 100644
@@ -119,7 +119,7 @@ static void get_blocksize(void)
 		SAFE_FSYNC(fd);
 		pos = lseek(fd, 0, SEEK_DATA);
 		if (pos == -1) {
-			if (errno == EINVAL) {
+			if (errno == EINVAL || errno == EOPNOTSUPP) {
 				tst_brk(TCONF | TERRNO, "SEEK_DATA "
 					"and SEEK_HOLE not implemented");
 			}
Signature · 1 line
2.9.4