All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]sysfs: Don't emit a warning when sysfs_rename_link() fails.
@ 2008-09-17 11:08 Cornelia Huck
  2008-09-17 18:55 ` Eric W. Biederman
  0 siblings, 1 reply; 9+ messages in thread
From: Cornelia Huck @ 2008-09-17 11:08 UTC (permalink / raw)
  To: Greg K-H, Eric W. Biederman; +Cc: linux-kernel

Hi Greg, hi Eric,

the recent sysfs tagged directory changes switched device_rename() to
sysfs_rename_link() - which is a good thing but AFAICS re-introduces
the scary warnings when a netdevice is renamed to something that
already exists (which I tried to fix with
36ce6dad6e3cb3f050ed41e0beac0070d2062b25).

The following patch switches sysfs_rename_link() to non-warning symlink
creation again. It is on top of the current driver core series.

sysfs: Don't emit a warning when sysfs_rename_link() fails.

From: Cornelia Huck <cornelia.huck@de.ibm.com>

sysfs_rename_link() will be printing a scary looking warning
if a link of the same name already exists. Callers of
device_rename() don't want to see this warning since they
already handle the failure themselves, so let's use the not
warning variant of sysfs_do_create_link().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

---
 fs/sysfs/symlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/fs/sysfs/symlink.c
===================================================================
--- linux-2.6.orig/fs/sysfs/symlink.c
+++ linux-2.6/fs/sysfs/symlink.c
@@ -135,7 +135,7 @@ int sysfs_rename_link(struct kobject *ko
 			const char *old, const char *new)
 {
 	sysfs_delete_link(kobj, targ, old);
-	return sysfs_create_link(kobj, targ, new);
+	return sysfs_do_create_link(kobj, targ, new, 0);
 }
 
 static int sysfs_get_target_path(struct sysfs_dirent *parent_sd,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-10-07  7:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17 11:08 [PATCH]sysfs: Don't emit a warning when sysfs_rename_link() fails Cornelia Huck
2008-09-17 18:55 ` Eric W. Biederman
2008-09-18  7:07   ` Cornelia Huck
2008-09-18 10:00     ` Eric W. Biederman
2008-09-18 10:50       ` Cornelia Huck
2008-09-18 11:37         ` Eric W. Biederman
2008-09-18 12:28           ` [PATCH] sysfs: Remove sysfs_do_create_link() Cornelia Huck
2008-10-07  4:19             ` Greg KH
2008-10-07  7:23               ` Cornelia Huck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.