All of lore.kernel.org
 help / color / mirror / Atom feed
* [S390] update fs3270 to use a struct pid
@ 2006-09-12 13:42 Cedric Le Goater
  2006-09-12 15:11 ` Eric W. Biederman
  0 siblings, 1 reply; 3+ messages in thread
From: Cedric Le Goater @ 2006-09-12 13:42 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Martin Schwidefsky, Eric W. Biederman, containers

this patch replaces the pid_t value with a struct pid to avoid pid wrap
around problems.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: containers@lists.osdl.org

---
 drivers/s390/char/fs3270.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: 2.6.18-rc6/drivers/s390/char/fs3270.c
===================================================================
--- 2.6.18-rc6.orig/drivers/s390/char/fs3270.c
+++ 2.6.18-rc6/drivers/s390/char/fs3270.c
@@ -28,7 +28,7 @@ struct raw3270_fn fs3270_fn;

 struct fs3270 {
 	struct raw3270_view view;
-	pid_t fs_pid;			/* Pid of controlling program. */
+	struct pid* fs_pid;		/* Pid of controlling program. */
 	int read_command;		/* ccw command to use for reads. */
 	int write_command;		/* ccw command to use for writes. */
 	int attention;			/* Got attention. */
@@ -103,7 +103,7 @@ fs3270_restore_callback(struct raw3270_r
 	fp = (struct fs3270 *) rq->view;
 	if (rq->rc != 0 || rq->rescnt != 0) {
 		if (fp->fs_pid)
-			kill_proc(fp->fs_pid, SIGHUP, 1);
+			kill_pid(fp->fs_pid, SIGHUP, 1);
 	}
 	fp->rdbuf_size = 0;
 	raw3270_request_reset(rq);
@@ -174,7 +174,7 @@ fs3270_save_callback(struct raw3270_requ
 	 */
 	if (rq->rc != 0 || rq->rescnt == 0) {
 		if (fp->fs_pid)
-			kill_proc(fp->fs_pid, SIGHUP, 1);
+			kill_pid(fp->fs_pid, SIGHUP, 1);
 		fp->rdbuf_size = 0;
 	} else
 		fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
@@ -443,7 +443,7 @@ fs3270_open(struct inode *inode, struct
 		return PTR_ERR(fp);

 	init_waitqueue_head(&fp->wait);
-	fp->fs_pid = current->pid;
+	fp->fs_pid = get_pid(task_pid(current));
 	rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
 	if (rc) {
 		fs3270_free_view(&fp->view);
@@ -481,7 +481,8 @@ fs3270_close(struct inode *inode, struct
 	fp = filp->private_data;
 	filp->private_data = NULL;
 	if (fp) {
-		fp->fs_pid = 0;
+		put_pid(fp->fs_pid);
+		fp->fs_pid = NULL;
 		raw3270_reset(&fp->view);
 		raw3270_put_view(&fp->view);
 		raw3270_del_view(&fp->view);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [S390] update fs3270 to use a struct pid
  2006-09-12 13:42 [S390] update fs3270 to use a struct pid Cedric Le Goater
@ 2006-09-12 15:11 ` Eric W. Biederman
  2006-09-12 16:15   ` Cedric Le Goater
  0 siblings, 1 reply; 3+ messages in thread
From: Eric W. Biederman @ 2006-09-12 15:11 UTC (permalink / raw)
  To: Cedric Le Goater
  Cc: Linux Kernel Mailing List, Martin Schwidefsky, containers

Cedric Le Goater <clg@fr.ibm.com> writes:

> this patch replaces the pid_t value with a struct pid to avoid pid wrap
> around problems.

This patch looks good here.
Signed-off-by: Eric Biederman <ebiederm@xmission.com>

Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [S390] update fs3270 to use a struct pid
  2006-09-12 15:11 ` Eric W. Biederman
@ 2006-09-12 16:15   ` Cedric Le Goater
  0 siblings, 0 replies; 3+ messages in thread
From: Cedric Le Goater @ 2006-09-12 16:15 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Linux Kernel Mailing List, Martin Schwidefsky, containers,
	Andrew Morton

Eric W. Biederman wrote:
> Cedric Le Goater <clg@fr.ibm.com> writes:
> 
>> this patch replaces the pid_t value with a struct pid to avoid pid wrap
>> around problems.
> 
> This patch looks good here.
> Signed-off-by: Eric Biederman <ebiederm@xmission.com>

This is a patch for 2.6.18-rc6-mm2.

thanks,

C.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-12 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-12 13:42 [S390] update fs3270 to use a struct pid Cedric Le Goater
2006-09-12 15:11 ` Eric W. Biederman
2006-09-12 16:15   ` Cedric Le Goater

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.