Re: [RFC PATCH 4/6] networking: rework socket to fd mapping usingalloc-file

From: Eric Paris
Date: Thu Dec 03 2009 - 18:25:52 EST


On Thu, 2009-12-03 at 14:00 -0800, David Miller wrote:
> From: Eric Paris <eparis@xxxxxxxxxx>
> Date: Thu, 03 Dec 2009 14:59:17 -0500
>
> > Currently the networking code does interesting things allocating its struct
> > file and file descriptors. This patch attempts to unify all of that and
> > simplify the error paths. It is also a part of my patch series trying to get
> > rid of init-file and get-empty_filp and friends.
> >
> > Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
>
> I'm fine with this:
>
> Acked-by: David S. Miller <davem@xxxxxxxxxxxxx>

It's actually busted, I forgot to actually pass back the new file in
sock_alloc_fd(). But I've got a fixed version and will resend the
series once I see other comments....

inc diff below in case anyone is trying to test this series.

diff --git a/net/socket.c b/net/socket.c
index 41ac0b1..6620421 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -390,6 +390,7 @@ static int sock_alloc_fd(struct file **filep, struct
socket *sock, int flags)
goto out_err;
}

+ *filep = file;
sock->file = file;
SOCK_INODE(sock)->i_fop = &socket_file_ops;
file->f_flags = O_RDWR | (flags & O_NONBLOCK);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/