Thread (2 messages) flat view 2 messages, 2 authors, 2014-01-15

Re: [RFC] sysfs_rename_link() and its usage

From: Tejun Heo <tj@kernel.org>
Date: 2014-01-15 14:16:27
Also in: lkml

Hey, Veaceslav, Eric.

On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote:
quoted
quoted
quoted
quoted
quoted
This works like a charm. However, if I want to use (obviously, with the
symlink present):

sysfs_rename_link(&(a->dev.kobj), &(b->dev.kobj), oldname, newname);
You forgot the namespace option to this call, what kernel version are
you using here?
It's git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next ,
3.13-rc6 with some networking patches on top of it.
Does this work on 3.12?  How about Greg's driver-core-next?  Do you
have a minimal test case that I can use to reproduce the issue?
sysfs_rename_link was originally written to infer figure everything out
based on the target device.  Because symlinks only make sense being in
the same namespace of their devices.  Tejun broke the inference and now
you are having hard time using the code.
I wouldn't be surprised if I broke it but
The commit that broke things was:

commit 4b30ee58ee64c64f59fd876e4afa6ed82caef3a4
Author: Tejun Heo [off-list ref]
Date:   Wed Sep 11 22:29:06 2013 -0400

    sysfs: remove ktype->namespace() invocations in symlink code
I'm not so sure about the above commit.  The warning is from rename
failing to locate the existing node while the above patch updates the
target ns to rename to.  The old_ns part stays the same before and
after the commit.

Veaceslav, please confirm whether the issue is reproducible w/ v3.12.

Thanks.

-- 
tejun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help