The patch titled

     Fix oops in sysfs_hash_and_remove_file()

has been added to the -mm tree.  Its filename is

     fix-oops-in-sysfs_hash_and_remove_file.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

fix-oops-in-sysfs_hash_and_remove_file.patch
fix-klist-semantics-for-lists-which-have-elements-removed.patch
git-scsi-misc-ibmvscsi-fix.patch



From: James Bottomley <[EMAIL PROTECTED]>

The problem arises if an entity in sysfs is created and removed without
ever having been made completely visible.  In SCSI this is triggered by
removing a device while it's initialising.

The problem appears to be that because it was never made visible in sysfs,
the sysfs dentry has a null d_inode which oopses when a reference is made
to it.  The solution is simply to check d_inode and assume the object was
never made visible (and thus doesn't need deleting) if it's NULL.

(akpm: possibly a stopgap for 2.6.13 scsi problems.  May not be the
long-term fix)

Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/sysfs/inode.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN fs/sysfs/inode.c~fix-oops-in-sysfs_hash_and_remove_file 
fs/sysfs/inode.c
--- devel/fs/sysfs/inode.c~fix-oops-in-sysfs_hash_and_remove_file       
2005-08-26 15:05:59.000000000 -0700
+++ devel-akpm/fs/sysfs/inode.c 2005-08-26 15:05:59.000000000 -0700
@@ -228,6 +228,10 @@ void sysfs_hash_and_remove(struct dentry
        struct sysfs_dirent * sd;
        struct sysfs_dirent * parent_sd = dir->d_fsdata;
 
+       if (dir->d_inode == NULL)
+               /* no inode means this hasn't been made visible yet */
+               return;
+
        down(&dir->d_inode->i_sem);
        list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
                if (!sd->s_element)
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to