This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)


On 06/01/2018 10:38 PM, Adhemerval Zanella wrote:
I think you should mention somewhere that this introduces new cancellation points.

It is not really new, since for architectures with default LFS support this is
transparent and for architectures with non-default LFS my understanding is
functions with *64 suffix are expected to handle cancellation as the non-LFS.

The old condition was:

-  if (cmd == F_SETLKW || cmd == F_SETLKW64)
-    return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);

The new code calls SYSCALL_CANCEL for many more cases, some of which probably are bugs.

I'm also a bit worried about this:

+      case F_GETLK64:
+      case F_OFD_GETLK:
+	{
+	  struct flock *flk = (struct flock *) arg;
+	  struct flock64 flk64 =
+	  {
+	    .l_type = flk->l_type,
+	    .l_whence = flk->l_whence,
+	    .l_start = flk->l_start,
+	    .l_len = flk->l_len,
+	    .l_pid = flk->l_pid
+	  };

Should we really perform translation for F_GETLK64?  That looks like a bug.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]