* WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() @ 2013-01-10 13:59 Jeff Layton 2013-01-14 14:54 ` [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() Jeff Layton 0 siblings, 1 reply; 4+ messages in thread From: Jeff Layton @ 2013-01-10 13:59 UTC (permalink / raw) To: Al Viro; +Cc: Miklos Szeredi, linux-fsdevel Over the last several year or so, we've gotten several reports of this sort of warning message popping up: [34011.669912] ------------[ cut here ]------------ [34011.670473] WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() [34011.671198] Hardware name: Bochs [34011.671564] Root dentry has weird name <> vfsmnt: fs:nfs4 [34011.672195] Modules linked in: nfsv4 auth_rpcgss nfs lockd sunrpc dns_resolver fscache kvm_amd kvm microcode virtio_net virtio_balloon i2c_piix4 cirrus drm_kms_helper ttm virtio_blk drm i2c_core [34011.674464] Pid: 7470, comm: ls Tainted: G W 3.7.0-6.fc19.x86_64 #1 [34011.675417] Call Trace: [34011.675712] [<ffffffff8106892f>] warn_slowpath_common+0x7f/0xc0 [34011.676404] [<ffffffff81068a26>] warn_slowpath_fmt+0x46/0x50 [34011.677058] [<ffffffff8109eb24>] ? lg_local_lock+0x44/0x80 [34011.677675] [<ffffffff811e8f18>] ? prepend_path+0x38/0x200 [34011.678315] [<ffffffff811e90cb>] prepend_path+0x1eb/0x200 [34011.678926] [<ffffffff811e913c>] path_with_deleted+0x5c/0xa0 [34011.679578] [<ffffffff811e976f>] d_path+0xbf/0x100 [34011.680139] [<ffffffff81244bb5>] proc_pid_readlink+0x95/0x100 [34011.680783] [<ffffffff811d8509>] sys_readlinkat+0xa9/0xc0 [34011.681418] [<ffffffff81104a5c>] ? __audit_syscall_entry+0xcc/0x300 [34011.682144] [<ffffffff811d853b>] sys_readlink+0x1b/0x20 [34011.682740] [<ffffffff816fbd19>] system_call_fastpath+0x16/0x1b [34011.683425] ---[ end trace 5e8c789abf4f6e53 ]--- This warning was added in commit 98dc568bc. I've found a way to trigger this at will: Mount up a nfs mount and cd into it from a shell. Do a lazy umount of the mount, and then do this from the shell: $ ls -l /proc/self/cwd That will cause that warning message to fire. The mnt will be detached and will look like the global root, but the d_name.name will be a zero-length string. I'm pretty sure there are other ways to trigger this too -- maybe involving races with shrinkable mounts (not sure on this). My initial thought was to add "(unreachable)" to the string, a'la d_path_with_unreachable(), but the changelog on commit 7b2a69ba70 made me think that that's not such a good idea. Given that this is fairly easy to reproduce, is there any point in keeping this warning around or should we just remove it? -- Jeff Layton <jlayton@redhat.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() 2013-01-10 13:59 WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() Jeff Layton @ 2013-01-14 14:54 ` Jeff Layton 2013-01-14 15:50 ` Miklos Szeredi 0 siblings, 1 reply; 4+ messages in thread From: Jeff Layton @ 2013-01-14 14:54 UTC (permalink / raw) To: viro; +Cc: linux-fsdevel, miklos We've had several reports of this warning over the last year or so: [34011.669912] ------------[ cut here ]------------ [34011.670473] WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() [34011.671198] Hardware name: Bochs [34011.671564] Root dentry has weird name <> vfsmnt: fs:nfs4 [34011.672195] Modules linked in: nfsv4 auth_rpcgss nfs lockd sunrpc dns_resolver fscache kvm_amd kvm microcode virtio_net virtio_balloon i2c_piix4 cirrus drm_kms_helper ttm virtio_blk drm i2c_core [34011.674464] Pid: 7470, comm: ls Tainted: G W 3.7.0-6.fc19.x86_64 #1 [34011.675417] Call Trace: [34011.675712] [<ffffffff8106892f>] warn_slowpath_common+0x7f/0xc0 [34011.676404] [<ffffffff81068a26>] warn_slowpath_fmt+0x46/0x50 [34011.677058] [<ffffffff8109eb24>] ? lg_local_lock+0x44/0x80 [34011.677675] [<ffffffff811e8f18>] ? prepend_path+0x38/0x200 [34011.678315] [<ffffffff811e90cb>] prepend_path+0x1eb/0x200 [34011.678926] [<ffffffff811e913c>] path_with_deleted+0x5c/0xa0 [34011.679578] [<ffffffff811e976f>] d_path+0xbf/0x100 [34011.680139] [<ffffffff81244bb5>] proc_pid_readlink+0x95/0x100 [34011.680783] [<ffffffff811d8509>] sys_readlinkat+0xa9/0xc0 [34011.681418] [<ffffffff81104a5c>] ? __audit_syscall_entry+0xcc/0x300 [34011.682144] [<ffffffff811d853b>] sys_readlink+0x1b/0x20 [34011.682740] [<ffffffff816fbd19>] system_call_fastpath+0x16/0x1b [34011.683425] ---[ end trace 5e8c789abf4f6e53 ]--- I'm able to reproduce this warning at will by mounting up a NFS filesystem, cd'ing into it. If I then lazy unmount the fs and then stat /proc/pid/cwd for the process sitting in the detached mount, this warning will fire. Given that this is fairly easy to reproduce without doing anything too exotic, I don't see much value in keeping this warning around. Cc: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Jeff Layton <jlayton@redhat.com> --- fs/dcache.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 19153a0..08a10a7 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2587,15 +2587,6 @@ out: return error; global_root: - /* - * Filesystems needing to implement special "root names" - * should do so with ->d_dname() - */ - if (IS_ROOT(dentry) && - (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) { - WARN(1, "Root dentry has weird name <%.*s>\n", - (int) dentry->d_name.len, dentry->d_name.name); - } if (!slash) error = prepend(buffer, buflen, "/", 1); if (!error) -- 1.7.11.7 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() 2013-01-14 14:54 ` [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() Jeff Layton @ 2013-01-14 15:50 ` Miklos Szeredi [not found] ` <20130114142458.0c509320@tlielax.poochiereds.net> 0 siblings, 1 reply; 4+ messages in thread From: Miklos Szeredi @ 2013-01-14 15:50 UTC (permalink / raw) To: Jeff Layton; +Cc: viro, linux-fsdevel On Mon, Jan 14, 2013 at 3:54 PM, Jeff Layton <jlayton@redhat.com> wrote: > We've had several reports of this warning over the last year or so: > > [34011.669912] ------------[ cut here ]------------ > [34011.670473] WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() > [34011.671198] Hardware name: Bochs > [34011.671564] Root dentry has weird name <> vfsmnt: fs:nfs4 [...] > I'm able to reproduce this warning at will by mounting up a NFS > filesystem, cd'ing into it. If I then lazy unmount the fs and then stat > /proc/pid/cwd for the process sitting in the detached mount, this > warning will fire. > > Given that this is fairly easy to reproduce without doing anything too > exotic, I don't see much value in keeping this warning around. The value of the warning is in preventing filesystems from doing weird and exotic things without thinking about it. The obvious question here is what is NFS4 doing differently from other filesystems to trigger this warning and why. Thanks, Miklos > > Cc: Miklos Szeredi <miklos@szeredi.hu> > Signed-off-by: Jeff Layton <jlayton@redhat.com> > --- > fs/dcache.c | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/fs/dcache.c b/fs/dcache.c > index 19153a0..08a10a7 100644 > --- a/fs/dcache.c > +++ b/fs/dcache.c > @@ -2587,15 +2587,6 @@ out: > return error; > > global_root: > - /* > - * Filesystems needing to implement special "root names" > - * should do so with ->d_dname() > - */ > - if (IS_ROOT(dentry) && > - (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) { > - WARN(1, "Root dentry has weird name <%.*s>\n", > - (int) dentry->d_name.len, dentry->d_name.name); > - } > if (!slash) > error = prepend(buffer, buflen, "/", 1); > if (!error) > -- > 1.7.11.7 > ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20130114142458.0c509320@tlielax.poochiereds.net>]
* Re: [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() [not found] ` <20130114142458.0c509320@tlielax.poochiereds.net> @ 2013-01-15 0:18 ` Jeff Layton 0 siblings, 0 replies; 4+ messages in thread From: Jeff Layton @ 2013-01-15 0:18 UTC (permalink / raw) To: Jeff Layton; +Cc: Miklos Szeredi, viro, linux-fsdevel On Mon, 14 Jan 2013 14:24:58 -0500 Jeff Layton <jlayton@redhat.com> wrote: > On Mon, 14 Jan 2013 16:50:20 +0100 > Miklos Szeredi <miklos@szeredi.hu> wrote: > > > On Mon, Jan 14, 2013 at 3:54 PM, Jeff Layton <jlayton@redhat.com> wrote: > > > We've had several reports of this warning over the last year or so: > > > > > > [34011.669912] ------------[ cut here ]------------ > > > [34011.670473] WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() > > > [34011.671198] Hardware name: Bochs > > > [34011.671564] Root dentry has weird name <> vfsmnt: fs:nfs4 > > > > [...] > > > > > I'm able to reproduce this warning at will by mounting up a NFS > > > filesystem, cd'ing into it. If I then lazy unmount the fs and then stat > > > /proc/pid/cwd for the process sitting in the detached mount, this > > > warning will fire. > > > > > > Given that this is fairly easy to reproduce without doing anything too > > > exotic, I don't see much value in keeping this warning around. > > > > The value of the warning is in preventing filesystems from doing weird > > and exotic things without thinking about it. > > > > The obvious question here is what is NFS4 doing differently from other > > filesystems to trigger this warning and why. > > > > Thanks, > > Miklos > > > > > > > > Cc: Miklos Szeredi <miklos@szeredi.hu> > > > Signed-off-by: Jeff Layton <jlayton@redhat.com> > > > --- > > > fs/dcache.c | 9 --------- > > > 1 file changed, 9 deletions(-) > > > > > > diff --git a/fs/dcache.c b/fs/dcache.c > > > index 19153a0..08a10a7 100644 > > > --- a/fs/dcache.c > > > +++ b/fs/dcache.c > > > @@ -2587,15 +2587,6 @@ out: > > > return error; > > > > > > global_root: > > > - /* > > > - * Filesystems needing to implement special "root names" > > > - * should do so with ->d_dname() > > > - */ > > > - if (IS_ROOT(dentry) && > > > - (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) { > > > - WARN(1, "Root dentry has weird name <%.*s>\n", > > > - (int) dentry->d_name.len, dentry->d_name.name); > > > - } > > > if (!slash) > > > error = prepend(buffer, buflen, "/", 1); > > > if (!error) > > > -- > > > 1.7.11.7 > > > > > In 3.7-ish kernels, the mnt_root of a NFSv4 mount pointed to a dentry > with a zero-length name. In 3.8-ish kernels that has changed -- the > dentry is called '/'. So yeah, it looks like this patch isn't > necessary. > > The question at this point is why and how that changed. I'm guessing > I'll have to bisect that down to figure it out. Stay tuned... > > Thanks, Ok, found it: commit b911a6bdeef5848c468597d040e3407e0aee04ce Author: NeilBrown <neilb@suse.de> Date: Thu Nov 8 16:09:37 2012 -0800 vfs: d_obtain_alias() needs to use "/" as default name. Looks like Neil Brown already fixed this the right way. My patch can be dropped. Sorry for the noise... Thanks, -- Jeff Layton <jlayton@redhat.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-15 0:18 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-01-10 13:59 WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200() Jeff Layton 2013-01-14 14:54 ` [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path() Jeff Layton 2013-01-14 15:50 ` Miklos Szeredi [not found] ` <20130114142458.0c509320@tlielax.poochiereds.net> 2013-01-15 0:18 ` Jeff Layton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).