diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-15 17:36:20 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-15 17:36:20 -0800 |
commit | 8481ed61786998185bc8af21c6fed9b133ab3c55 (patch) | |
tree | 45933215164d73726c7cc728281b5d77c12a2fc7 /driver | |
parent | de97911b6b1e48abb42f38175b09e22c93bbfbbd (diff) | |
download | patches-8481ed61786998185bc8af21c6fed9b133ab3c55.tar.gz |
move sysfs patch to proper place
Diffstat (limited to 'driver')
-rw-r--r-- | driver/sysfs_remove_dir-needs-to-invalidate-the-dentry.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/driver/sysfs_remove_dir-needs-to-invalidate-the-dentry.patch b/driver/sysfs_remove_dir-needs-to-invalidate-the-dentry.patch new file mode 100644 index 0000000000000..d7fffc8bef538 --- /dev/null +++ b/driver/sysfs_remove_dir-needs-to-invalidate-the-dentry.patch @@ -0,0 +1,51 @@ +From: Greg Kroah-Hartman <gregkh@suse.de> +Subject: sysfs: sysfs_remove_dir() needs to invalidate the dentry + +When calling sysfs_remove_dir() don't allow any further sysfs functions +to work for this kobject anymore. This fixes a nasty USB cdc-acm oops +on disconnect. + +Many thanks to Bob Copeland and Paul Fulghum for taking the time to +track this down. + + +Cc: Bob Copeland <email@bobcopeland.com> +Cc: Paul Fulghum <paulkf@microgate.com> +Cc: Maneesh Soni <maneesh@in.ibm.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + fs/sysfs/dir.c | 1 + + fs/sysfs/inode.c | 6 +++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- gregkh-2.6.orig/fs/sysfs/dir.c ++++ gregkh-2.6/fs/sysfs/dir.c +@@ -333,6 +333,7 @@ void sysfs_remove_dir(struct kobject * k + * Drop reference from dget() on entrance. + */ + dput(dentry); ++ kobj->dentry = NULL; + } + + int sysfs_rename_dir(struct kobject * kobj, const char *new_name) +--- gregkh-2.6.orig/fs/sysfs/inode.c ++++ gregkh-2.6/fs/sysfs/inode.c +@@ -226,12 +226,16 @@ void sysfs_drop_dentry(struct sysfs_dire + void sysfs_hash_and_remove(struct dentry * dir, const char * name) + { + struct sysfs_dirent * sd; +- struct sysfs_dirent * parent_sd = dir->d_fsdata; ++ struct sysfs_dirent * parent_sd; ++ ++ if (!dir) ++ return; + + if (dir->d_inode == NULL) + /* no inode means this hasn't been made visible yet */ + return; + ++ parent_sd = dir->d_fsdata; + mutex_lock(&dir->d_inode->i_mutex); + list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { + if (!sd->s_element) |