[Devel] Re: [PATCH] Teach cifs about network namespaces (take 2)

Rob Landley rlandley at parallels.com
Thu Jan 13 10:55:19 PST 2011


On 01/11/2011 03:30 PM, Jeff Layton wrote:
> On Tue, 11 Jan 2011 12:04:54 -0600
> Rob Landley <rlandley at parallels.com> wrote:
> 
>> From: Rob Landley <rlandley at parallels.com>
>>
>> Teach cifs about network namespaces, so mounting uses adresses/routing
>> visible from the container rather than from init context.
>>
>> Signed-off-by: Rob Landley <rlandley at parallels.com>
>> ---
>>
>> Updated with Matt's feedback and to apply to current linus-git.
>>
>>  fs/cifs/cifsglob.h |   37 +++++++++++++++++++++++++++++++++++++
>>  fs/cifs/connect.c  |   14 ++++++++++++--
>>  2 files changed, 49 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
>> index 606ca8b..8175d31 100644
>> --- a/fs/cifs/cifsglob.h
>> +++ b/fs/cifs/cifsglob.h
>> @@ -165,6 +165,9 @@ struct TCP_Server_Info {
>>  	struct socket *ssocket;
>>  	struct sockaddr_storage dstaddr;
>>  	struct sockaddr_storage srcaddr; /* locally bind to this IP */
>> +#ifdef CONFIG_NET_NS
>> +	struct net *net;
>> +#endif
>>  	wait_queue_head_t response_q;
>>  	wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
>>  	struct list_head pending_mid_q;
>> @@ -224,6 +227,40 @@ struct TCP_Server_Info {
>>  };
>>  
> 
> I've got a patch queued that rearranges some fields in TCP_Server_Info
> according to pahole's recommendations. You may want to base this patch
> on that.

I confirmed that where it is just misses being affected by your patch
(offset but no fuzz), and it follows struct sockaddr_storage which
include/linux/socket.h A) pads to 128 bytes, B) adds an alignment
compiler directive to just to be sure.

So it seems reasonable to leave it where it is for the moment.

Rob
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list