Re: [RFC] sysfs_rename_link() and its usage

2014-01-16 Thread Eric W. Biederman
Veaceslav Falico writes: > On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: >>Tejun Heo writes: >> >>> Hey, Veaceslav, Eric. > > Hi Tejun, Eric, > >>> >>> On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: >>> >>This works like a charm. However, if I want

Re: [RFC] sysfs_rename_link() and its usage

2014-01-16 Thread Eric W. Biederman
Veaceslav Falico vfal...@redhat.com writes: On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: Tejun Heo t...@kernel.org writes: Hey, Veaceslav, Eric. Hi Tejun, Eric, On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: This works like a charm. However, if

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Veaceslav Falico
On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: Tejun Heo writes: Hey, Veaceslav, Eric. Hi Tejun, Eric, On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: >>> >>This works like a charm. However, if I want to use (obviously, with the >>> >>symlink

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Tejun Heo
Hey, Eric. On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: > diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c > index 3ae3f1bf1a09..651444a9d1c5 100644 > --- a/fs/sysfs/symlink.c > +++ b/fs/sysfs/symlink.c > @@ -194,12 +194,10 @@ EXPORT_SYMBOL_GPL(sysfs_remove_link); > *

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Eric W. Biederman
Tejun Heo writes: > Hey, Veaceslav, Eric. > > On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: >> >>> >>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),

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Tejun Heo
Hey, Veaceslav, Eric. On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: > >>> >>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); > >>> > > >>>

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Tejun Heo
Hey, Veaceslav, Eric. On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: 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

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Eric W. Biederman
Tejun Heo t...@kernel.org writes: Hey, Veaceslav, Eric. On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: 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);

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Tejun Heo
Hey, Eric. On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index 3ae3f1bf1a09..651444a9d1c5 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -194,12 +194,10 @@ EXPORT_SYMBOL_GPL(sysfs_remove_link); *

Re: [RFC] sysfs_rename_link() and its usage

2014-01-15 Thread Veaceslav Falico
On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote: Tejun Heo t...@kernel.org writes: Hey, Veaceslav, Eric. Hi Tejun, Eric, On Tue, Jan 14, 2014 at 05:35:23PM -0800, Eric W. Biederman wrote: This works like a charm. However, if I want to use (obviously, with the symlink

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Ding Tianhong
On 2014/1/15 1:17, Veaceslav Falico wrote: > Hi, > > I'm hitting a strange issue and/or I'm completely lost in sysfs internals. > > Consider having two net_device *a, *b; which are registered normally. > Now, to create a link from /sys/class/net/a->name/linkname to b, one should > use: > >

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Eric W. Biederman
Veaceslav Falico writes: > On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: >>On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: >>> On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: >>> >On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: >>> >>Hi,

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 10:06:10PM +0100, Veaceslav Falico wrote: > On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: > >On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: > >>On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: > >>>On Tue, Jan 14, 2014 at 06:17:40PM

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: >On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: >>Hi, >> >>I'm hitting a strange issue and/or

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: > On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: > >On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: > >>Hi, > >> > >>I'm hitting a strange issue and/or I'm completely lost in sysfs internals. > >> >

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: > Hi, > > I'm hitting a strange issue and/or I'm completely lost in sysfs internals. > > Consider having two net_device *a, *b; which are registered normally. > Now, to create a link from /sys/class/net/a->name/linkname to b, one

[RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link from /sys/class/net/a->name/linkname to b, one should use: sysfs_create_link(&(a->dev.kobj), &(b->dev.kobj), linkname); To

[RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link from /sys/class/net/a-name/linkname to b, one should use: sysfs_create_link((a-dev.kobj), (b-dev.kobj), linkname); To

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link from /sys/class/net/a-name/linkname to b, one should

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Veaceslav Falico
On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Greg KH
On Tue, Jan 14, 2014 at 10:06:10PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100,

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Eric W. Biederman
Veaceslav Falico vfal...@redhat.com writes: On Tue, Jan 14, 2014 at 11:31:39AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 08:12:08PM +0100, Veaceslav Falico wrote: On Tue, Jan 14, 2014 at 10:21:35AM -0800, Greg KH wrote: On Tue, Jan 14, 2014 at 06:17:40PM +0100, Veaceslav Falico wrote: Hi,

Re: [RFC] sysfs_rename_link() and its usage

2014-01-14 Thread Ding Tianhong
On 2014/1/15 1:17, Veaceslav Falico wrote: Hi, I'm hitting a strange issue and/or I'm completely lost in sysfs internals. Consider having two net_device *a, *b; which are registered normally. Now, to create a link from /sys/class/net/a-name/linkname to b, one should use: