All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Maneesh Soni <maneesh@in.ibm.com>
Cc: Dmitry Torokhov <dtor_core@ameritech.net>,
	linux-kernel@vger.kernel.org,
	viro@parcelfarce.linux.theplanet.co.uk,
	Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [RFC 2/2] sysfs_rename_dir-cleanup
Date: Tue, 11 May 2004 16:33:51 -0700	[thread overview]
Message-ID: <20040511233350.GC27069@kroah.com> (raw)
In-Reply-To: <20030509153957.A20432@in.ibm.com>

On Fri, May 09, 2003 at 03:39:57PM +0530, Maneesh Soni wrote:
> diff -puN fs/sysfs/dir.c~sysfs_rename_dir-cleanup fs/sysfs/dir.c
> --- linux-2.6.6-rc3-mm2/fs/sysfs/dir.c~sysfs_rename_dir-cleanup	2004-05-05 18:22:39.000000000 +0530
> +++ linux-2.6.6-rc3-mm2-maneesh/fs/sysfs/dir.c	2004-05-05 18:33:54.000000000 +0530
> @@ -162,15 +162,16 @@ restart:
>  	dput(dentry);
>  }
>  
> -void sysfs_rename_dir(struct kobject * kobj, const char *new_name)
> +int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
>  {
> +	int error = 0;
>  	struct dentry * new_dentry, * parent;
>  
>  	if (!strcmp(kobject_name(kobj), new_name))
> -		return;
> +		return -EINVAL;
>  
>  	if (!kobj->parent)
> -		return;
> +		return -EINVAL;
>  
>  	down_write(&sysfs_rename_sem);
>  	parent = kobj->parent->dentry;
> @@ -179,13 +180,16 @@ void sysfs_rename_dir(struct kobject * k
>  	new_dentry = sysfs_get_dentry(parent, new_name);
>  	if (!IS_ERR(new_dentry)) {
>  		if (!new_dentry->d_inode) {
> -			d_move(kobj->dentry, new_dentry);
> -			kobject_set_name(kobj,new_name);
> +			error = kobject_set_name(kobj,new_name);
> +			if (!error)
> +				d_move(kobj->dentry, new_dentry);
>  		}
>  		dput(new_dentry);
>  	}
>  	up(&parent->d_inode->i_sem);	
>  	up_write(&sysfs_rename_sem);
> +
> +	return error;
>  }
>  
>  EXPORT_SYMBOL(sysfs_create_dir);

This second chunk fails miserably.  I don't know what you diffed it
against, as it doesn't look like anything that I currently have in that
function...

Anyway, can you grab the next -mm release and rediff this patch against
the bk-driver-2.6 tree, or even against a clean 2.6.6 tree so that I can
apply it?

thanks,

greg k-h

  reply	other threads:[~2004-05-11 23:45 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13 12:40 [RFC] fix sysfs symlinks Maneesh Soni
2004-04-13 13:36 ` viro
2004-04-14  6:40   ` Maneesh Soni
2004-04-14  7:02     ` viro
2004-04-14  7:17       ` Maneesh Soni
2004-04-14  7:27         ` viro
2004-04-15  8:17       ` Russell King
2004-04-15 10:38         ` viro
2004-04-15 15:19           ` Russell King
2004-04-15 16:10             ` Greg KH
2004-04-15 16:13               ` viro
2004-04-15 19:14                 ` viro
2004-04-15 21:27                   ` Greg KH
2004-04-17  6:15                   ` Rusty Russell
2004-04-17 19:39                     ` viro
2004-04-17 23:45                       ` Rusty Russell
2004-04-15 22:02   ` Greg KH
2004-04-16 15:24     ` viro
2004-04-16 18:03       ` Horst von Brand
2004-04-16 18:07         ` viro
2004-04-16 22:37       ` Greg KH
2004-04-16 23:46         ` viro
2004-04-17  0:03           ` Jeff Garzik
2004-04-17  8:07             ` Russell King
2004-04-17  8:22               ` viro
2004-04-20 16:16                 ` Greg KH
2004-04-21 10:11                   ` Maneesh Soni
2004-04-22 21:37                     ` viro
2004-04-23  8:52                       ` Maneesh Soni
2004-04-23  9:26                         ` viro
2004-04-29 13:03                           ` Maneesh Soni
2004-04-29 15:41                             ` viro
2004-04-30 10:05                               ` Maneesh Soni
2004-04-30 10:13                                 ` [RFC 0/2] kobject_set_name - error handling Maneesh Soni
2004-04-30 10:14                                   ` [RFC 1/2] " Maneesh Soni
2004-04-30 10:17                                     ` [RFC 2/2] " Maneesh Soni
2004-05-04 13:08                                       ` Maneesh Soni
2004-04-30 12:48                                     ` [RFC 1/2] " Dmitry Torokhov
2004-05-04  5:39                                       ` Maneesh Soni
2004-05-04  9:19                                         ` Maneesh Soni
2004-05-07 22:25                                         ` Greg KH
2003-05-09 10:05                                           ` Maneesh Soni
2003-05-09 10:09                                             ` [RFC 2/2] sysfs_rename_dir-cleanup Maneesh Soni
2004-05-11 23:33                                               ` Greg KH [this message]
2004-10-07  5:16                                                 ` Maneesh Soni
2004-10-07  5:38                                                   ` Maneesh Soni
2004-05-14 19:10                                                     ` Greg KH
2004-05-11 23:32                                             ` [RFC 1/2] kobject_set_name - error handling Greg KH
2004-04-17  0:15           ` [RFC] fix sysfs symlinks Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040511233350.GC27069@kroah.com \
    --to=greg@kroah.com \
    --cc=dtor_core@ameritech.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.