aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2020-07-20 10:37:43 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-20 11:23:24 +0100
commit8efb082863ff0ceec7b7e46f9a44750e12f48039 (patch)
tree4b2d6c00a79f046849e7eb11c8e12cda83c03faf
parent067950bd9415fafcafb2bf32c0e10df4f2ac936c (diff)
downloadpseudo-8efb082863ff0ceec7b7e46f9a44750e12f48039.tar.gz
pseudo-8efb082863ff0ceec7b7e46f9a44750e12f48039.tar.bz2
pseudo-8efb082863ff0ceec7b7e46f9a44750e12f48039.zip
Handle OFD lock flags
Linux 3.15 and newer introduced new open file description locks. Currently pseudo prints a warning if fcntl is used with OFD locks: unknown fcntl argument 37, assuming long argument. However, calls to fcntl with a OFC lock set need a struct flock pointer. Treat F_OFD_GETLK (and friends) like F_GETLK (and friends). This issue has been observed with ostree. Comparing strace output between two runs with/without this patch shows the same fcntl calls, hence it seems not to matter in practice. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--ports/linux/guts/fcntl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/linux/guts/fcntl.c b/ports/linux/guts/fcntl.c
index 4dd9796..434c7f3 100644
--- a/ports/linux/guts/fcntl.c
+++ b/ports/linux/guts/fcntl.c
@@ -52,6 +52,11 @@
case F_GETLK:
case F_SETLK:
case F_SETLKW:
+#ifdef F_OFD_GETLK
+ case F_OFD_GETLK:
+ case F_OFD_SETLK:
+ case F_OFD_SETLKW:
+#endif
rc = real_fcntl(fd, cmd, lock);
break;
#if defined(F_GETLK64) && (F_GETLK64 != F_GETLK)