From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbcAFGWI (ORCPT ); Wed, 6 Jan 2016 01:22:08 -0500 Received: from mbob.nabble.com ([162.253.133.15]:60795 "EHLO mbob.nabble.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750845AbcAFGWG (ORCPT ); Wed, 6 Jan 2016 01:22:06 -0500 X-Greylist: delayed 483 seconds by postgrey-1.27 at vger.kernel.org; Wed, 06 Jan 2016 01:22:06 EST Date: Tue, 5 Jan 2016 22:26:02 -0700 (MST) From: sangeetha Busangari To: linux-kernel@vger.kernel.org Message-ID: <1452057962347-1273362.post@n7.nabble.com> In-Reply-To: <20150320132914.GA1749@ws.net.home> References: <20150320132914.GA1749@ws.net.home> Subject: Re: d_path() and overlay fs MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am new to Linux kernel programming. i am trying to print current working directory of process which are running under containers. i have written code in kernel as below to get pwd ********************************************************************* struct path pwd; char *buf,*cwd; uid_t process_uid = (current->cred)->uid.val; pwd = current->fs->pwd; path_get(&pwd);//it gets the reference to path. which is argument to d_path if((buf = (char *)kmalloc(100*sizeof(char),GFP_KERNEL))!=NULL) { //GFP_KERNEL is a flag specifies the behavior of the memory allocator cwd = d_path(&pwd,buf,100*sizeof(char)); // returns pointer to buffer printk("process name %s (pid = %d)pwd= %s and (uid=%u)\n",current->comm, current->pid,cwd,process_uid); } //printk("check pwd\n"); kfree(buf); ************************************************************************** it is printing pwd correctly in host machine. but unable to start docker containers root@sangeetha:/var/lib/docker# docker start 58e9277a7e8c Error response from daemon: Cannot start container 58e9277a7e8c: [8] System error: failed to add interface vethebc8876 to sandbox: failed in prefunc: failed to set namespace on link "vethebc8876": invalid argument Error: failed to start containers: [58e9277a7e8c] if i comment d_path line, then i am able to start containers.can you please help to understand the problem and how to resolve it? docker version: Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:12:04 UTC 2015 OS/Arch: linux/amd64 Server: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:12:04 UTC 2015 OS/Arch: linux/amd64 ******************************************* uname -a Linux sangeetha 3.14.57 #56 SMP Wed Jan 6 09:37:22 IST 2016 x86_64 x86_64 x86_64 GNU/Linux **************************************************8 in logs process name docker (pid = 3754)pwd= /var/lib/docker and (uid=0) [ 1743.097731] docker0: port 1(vethcf36114) entered forwarding state [ 1743.097744] docker0: port 1(vethcf36114) entered forwarding state [ 1743.100084] docker0: port 1(vethcf36114) entered disabled state [ 1743.271360] process name docker (pid = 1667)pwd= / and (uid=0) [ 1743.276427] process name docker (pid = 1507)pwd= / and (uid=0) [ 1743.496652] docker0: port 1(vethcf36114) entered disabled state [ 1743.497330] docker0: port 1(vethcf36114) entered disabled state [ 1799.635904] process name bash (pid = 2894)pwd= /var/lib/docker and (uid=0) [ 2543.229052] process name bash (pid = 2894)pwd= /var/lib/docker and (uid=0) ************************************************************************** devicemapper fs is used for containers. ubuntu 14.04 os Thanks in advance. -- View this message in context: http://linux-kernel.2935.n7.nabble.com/d-path-and-overlay-fs-tp1068779p1273362.html Sent from the Linux Kernel mailing list archive at Nabble.com.