All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saurabh Desai <sdesai@austin.ibm.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH]2.4.19-pre9: fs/locks.c
Date: Fri, 31 May 2002 17:29:39 -0500	[thread overview]
Message-ID: <3CF7F953.7DA13554@austin.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]


     The following patch addresses problem associated with
process locks when called from cloned process created with 
CLONE_THREAD flag. The fcntl locks are per-process and 
creates a dead-lock for cloned (w/CLONE_THREAD) processes.
It should use tgid instead pid (same way as getpid()).

Thanks,
Saurabh Desai  (sdesai@austin.ibm.com)
=======================================

[-- Attachment #2: fcntl-2.4.19-pre9.diff --]
[-- Type: text/plain, Size: 1298 bytes --]

diff -Naur linux-2.4.19-pre9/fs/locks.c linux-2.4.19-pre9-patch/fs/locks.c
--- linux-2.4.19-pre9/fs/locks.c	Thu Oct 11 09:52:18 2001
+++ linux-2.4.19-pre9-patch/fs/locks.c	Fri May 31 13:40:49 2002
@@ -225,7 +225,7 @@
 
 	fl->fl_owner = NULL;
 	fl->fl_file = filp;
-	fl->fl_pid = current->pid;
+	fl->fl_pid = current->tgid;
 	fl->fl_flags = FL_FLOCK;
 	fl->fl_type = type;
 	fl->fl_start = 0;
@@ -284,7 +284,7 @@
 		fl->fl_end = OFFSET_MAX;
 	
 	fl->fl_owner = current->files;
-	fl->fl_pid = current->pid;
+	fl->fl_pid = current->tgid;
 	fl->fl_file = filp;
 	fl->fl_flags = FL_POSIX;
 	fl->fl_notify = NULL;
@@ -324,7 +324,7 @@
 		fl->fl_end = OFFSET_MAX;
 	
 	fl->fl_owner = current->files;
-	fl->fl_pid = current->pid;
+	fl->fl_pid = current->tgid;
 	fl->fl_file = filp;
 	fl->fl_flags = FL_POSIX;
 	fl->fl_notify = NULL;
@@ -353,7 +353,7 @@
 		return -ENOMEM;
 
 	fl->fl_owner = current->files;
-	fl->fl_pid = current->pid;
+	fl->fl_pid = current->tgid;
 
 	fl->fl_file = filp;
 	fl->fl_flags = FL_LEASE;
@@ -719,7 +719,7 @@
 		return -ENOMEM;
 
 	new_fl->fl_owner = current->files;
-	new_fl->fl_pid = current->pid;
+	new_fl->fl_pid = current->tgid;
 	new_fl->fl_file = filp;
 	new_fl->fl_flags = FL_POSIX | FL_ACCESS;
 	new_fl->fl_type = (read_write == FLOCK_VERIFY_WRITE) ? F_WRLCK : F_RDLCK;

                 reply	other threads:[~2002-05-31 22:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CF7F953.7DA13554@austin.ibm.com \
    --to=sdesai@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.