lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100112173449.GB13506@us.ibm.com>
Date:	Tue, 12 Jan 2010 11:34:49 -0600
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Kay Sievers <kay.sievers@...y.org>,
	linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
	Cornelia Huck <cornelia.huck@...ibm.com>,
	linux-fsdevel@...r.kernel.org,
	Eric Dumazet <eric.dumazet@...il.com>,
	Benjamin LaHaise <bcrl@...et.ca>,
	"Eric W. Biederman" <ebiederm@...stanetworks.com>
Subject: Re: [PATCH 5/7] driver core: Use sysfs_rename_link in device_rename

Quoting Eric W. Biederman (ebiederm@...ssion.com):
> From: Eric W. Biederman <ebiederm@...ssion.com>
> 
> Don't open code the renaming of symlinks in sysfs
> instead use the new helper function sysfs_rename_link
> 
> Signed-off-by: Eric W. Biederman <ebiederm@...stanetworks.com>

Acked-by: Serge Hallyn <serue@...ibm.com>

> ---
>  drivers/base/core.c |   18 ++++++------------
>  1 files changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 2820257..ba66394 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1574,22 +1574,16 @@ int device_rename(struct device *dev, char *new_name)
>  	if (old_class_name) {
>  		new_class_name = make_class_name(dev->class->name, &dev->kobj);
>  		if (new_class_name) {
> -			error = sysfs_create_link_nowarn(&dev->parent->kobj,
> -							 &dev->kobj,
> -							 new_class_name);
> -			if (error)
> -				goto out;
> -			sysfs_remove_link(&dev->parent->kobj, old_class_name);
> +			error = sysfs_rename_link(&dev->parent->kobj,
> +						  &dev->kobj,
> +						  old_class_name,
> +						  new_class_name);
>  		}
>  	}
>  #else
>  	if (dev->class) {
> -		error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj,
> -						 &dev->kobj, dev_name(dev));
> -		if (error)
> -			goto out;
> -		sysfs_remove_link(&dev->class->p->class_subsys.kobj,
> -				  old_device_name);
> +		error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
> +					  &dev->kobj, old_device_name, new_name);
>  	}
>  #endif
> 
> -- 
> 1.6.5.2.143.g8cc62
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ