All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
@ 2012-04-30  9:46 Sasikantha babu
  2012-04-30 13:51 ` Greg Kroah-Hartman
  2012-05-02 20:10 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Sasikantha babu @ 2012-04-30  9:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Sasikantha babu

Since no one using "dup_name", removed it completely in sysfs_rename, 

Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
---
 fs/sysfs/dir.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 35a36d3..24fa995 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -858,7 +858,6 @@ int sysfs_rename(struct sysfs_dirent *sd,
 	struct sysfs_dirent *new_parent_sd, const void *new_ns,
 	const char *new_name)
 {
-	const char *dup_name = NULL;
 	int error;
 
 	mutex_lock(&sysfs_mutex);
@@ -875,11 +874,11 @@ int sysfs_rename(struct sysfs_dirent *sd,
 	/* rename sysfs_dirent */
 	if (strcmp(sd->s_name, new_name) != 0) {
 		error = -ENOMEM;
-		new_name = dup_name = kstrdup(new_name, GFP_KERNEL);
+		new_name = kstrdup(new_name, GFP_KERNEL);
 		if (!new_name)
 			goto out;
 
-		dup_name = sd->s_name;
+		kfree(sd->s_name);
 		sd->s_name = new_name;
 	}
 
@@ -895,7 +894,6 @@ int sysfs_rename(struct sysfs_dirent *sd,
 	error = 0;
  out:
 	mutex_unlock(&sysfs_mutex);
-	kfree(dup_name);
 	return error;
 }
 
-- 
1.7.3.4


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

* Re: [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
  2012-04-30  9:46 [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename Sasikantha babu
@ 2012-04-30 13:51 ` Greg Kroah-Hartman
  2012-05-01 11:07   ` Sasikanth babu
  2012-05-02 20:10 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-04-30 13:51 UTC (permalink / raw)
  To: Sasikantha babu; +Cc: linux-kernel

On Mon, Apr 30, 2012 at 03:16:56PM +0530, Sasikantha babu wrote:
> Since no one using "dup_name", removed it completely in sysfs_rename, 
> 
> Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
> ---
>  fs/sysfs/dir.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Have you tested this patch and renamed some sysfs files with it with
SLAB_DEBUGGING enabled?  There was some "odd" things with regards to
names that I would like to ensure that is all still working properly
with this patch.

thanks,

greg k-h

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

* Re: [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
  2012-04-30 13:51 ` Greg Kroah-Hartman
@ 2012-05-01 11:07   ` Sasikanth babu
  0 siblings, 0 replies; 5+ messages in thread
From: Sasikanth babu @ 2012-05-01 11:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel

On Mon, Apr 30, 2012 at 7:21 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Mon, Apr 30, 2012 at 03:16:56PM +0530, Sasikantha babu wrote:
>> Since no one using "dup_name", removed it completely in sysfs_rename,
>>
>> Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
>> ---
>>  fs/sysfs/dir.c |    6 ++----
>>  1 files changed, 2 insertions(+), 4 deletions(-)
>
> Have you tested this patch and renamed some sysfs files with it with
> SLAB_DEBUGGING enabled?  There was some "odd" things with regards to
> names that I would like to ensure that is all still working properly
> with this patch.
>
> thanks,
>
> greg k-h

I had enabled SLAB debugging and  tested this patch by modifying few
existing sysfs entries and
newly created entries.

[sasikantha@localhost linux-2.6]$ cat .config | grep SLAB
CONFIG_SLAB=y
CONFIG_SLABINFO=y
CONFIG_DEBUG_SLAB=y
CONFIG_DEBUG_SLAB_LEAK=y
[sasikantha@localhost linux-2.6]$

Did not face any issues while renaming.

Please let me know if there is any specific scenario that needs to be tested.

Thanks
Sasi

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

* Re: [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
  2012-04-30  9:46 [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename Sasikantha babu
  2012-04-30 13:51 ` Greg Kroah-Hartman
@ 2012-05-02 20:10 ` Greg Kroah-Hartman
  2012-05-02 20:54   ` Sasikanth babu
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-05-02 20:10 UTC (permalink / raw)
  To: Sasikantha babu; +Cc: linux-kernel

On Mon, Apr 30, 2012 at 03:16:56PM +0530, Sasikantha babu wrote:
> Since no one using "dup_name", removed it completely in sysfs_rename, 
> 
> Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>

What kernel version did you create this against?  There is some odd fuzz
and offsets aren't right here, you should at the least, make it against
Linus's latest tree, and ideally against linux-next, this one was made
against neither, so I can't really apply it.

Care to refresh it against Linus's tree and resend it so I can apply it?

It makes me wonder how you tested it...

greg k-h

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

* Re: [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
  2012-05-02 20:10 ` Greg Kroah-Hartman
@ 2012-05-02 20:54   ` Sasikanth babu
  0 siblings, 0 replies; 5+ messages in thread
From: Sasikanth babu @ 2012-05-02 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel

On Thu, May 3, 2012 at 1:40 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Mon, Apr 30, 2012 at 03:16:56PM +0530, Sasikantha babu wrote:
>> Since no one using "dup_name", removed it completely in sysfs_rename,
>>
>> Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
>
> What kernel version did you create this against?  There is some odd fuzz
> and offsets aren't right here, you should at the least, make it against
> Linus's latest tree, and ideally against linux-next, this one was made
> against neither, so I can't really apply it.
>
  The patch is against Linus latest tree only.  I got the same offsets after a
  fresh clone.
> Care to refresh it against Linus's tree and resend it so I can apply it?
   Will resend the patch with latest Linus's tree.
>
> It makes me wonder how you tested it...
   Tested on Kernel 3.4-rc5 version.
>
> greg k-h

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

end of thread, other threads:[~2012-05-02 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30  9:46 [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename Sasikantha babu
2012-04-30 13:51 ` Greg Kroah-Hartman
2012-05-01 11:07   ` Sasikanth babu
2012-05-02 20:10 ` Greg Kroah-Hartman
2012-05-02 20:54   ` Sasikanth babu

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.