Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750744AbWA2IoG (ORCPT ); Sun, 29 Jan 2006 03:44:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750749AbWA2IoG (ORCPT ); Sun, 29 Jan 2006 03:44:06 -0500 Received: from elvis.mu.org ([192.203.228.196]:46822 "EHLO elvis.mu.org") by vger.kernel.org with ESMTP id S1750744AbWA2IoF (ORCPT ); Sun, 29 Jan 2006 03:44:05 -0500 Message-ID: <43DC804B.4060900@FreeBSD.org> Date: Sun, 29 Jan 2006 00:43:55 -0800 From: Suleiman Souhlal User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051204) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Eric W. Biederman" CC: linux-kernel@vger.kernel.org, vserver@list.linux-vserver.org, Herbert Poetzl , "Serge E. Hallyn" , Alan Cox , Dave Hansen , Arjan van de Ven , Hubertus Franke , Cedric Le Goater , Kyle Moffett Subject: Re: [PATCH 5/5] file: Modify struct fown_struct to contain a tref References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1091 Lines: 35 Eric W. Biederman wrote: > @@ -317,7 +326,9 @@ static long do_fcntl(int fd, unsigned in > * current syscall conventions, the only way > * to fix this will be in libc. > */ > - err = filp->f_owner.pid; > + err = 0; > + if (filp->f_owner.tref->task) > + err = filp->f_owner.pid; Probably not very important, but why don't you use filp->f_owner.tref->task->pid? This way you could completely get rid of the pid field in fown_struct. > --- a/net/socket.c > +++ b/net/socket.c > @@ -855,7 +855,10 @@ static long sock_ioctl(struct file *file > break; > case FIOGETOWN: > case SIOCGPGRP: > - err = put_user(sock->file->f_owner.pid, (int __user *)argp); > + pid = 0; > + if (sock->file->f_owner.tref->task) > + pid = sock->file->f_owner.pid; > + err = put_user(pid, (int __user *)argp); Same here. -- Suleiman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/