Messages in this thread | | | Date | Mon, 22 Nov 2004 20:08:43 -0800 | From | "Adam J. Richter" <> | Subject | Re: [Patch] Delete sysfs_dirent.s_count, saving ~100kB on my system |
| |
On Mon, 22 Nov 2004 16:53:09 -0600, Maneesh Soni wrote: >There can be open files (live dentries) but files getting removed.
I think you're right. I did have a problem with the test that you suggested. I think I may be able to accomodate the problem though.
I had not realized that file->f_dentry will keep the dentry around even after the file has been removed, at which point file->f_dentry->d_fsdata will point to garbage rather than a valid sysfs_direntry. This is a problem in fs/sysfs/file.c where sysfs_read_file calls fill_read_buffer, which calls to_attr, which tries to read sysfs_direnty->s_element.
I believe I can avoid the need for any of the IO routines to access sysfs_direntry->s_element by having create_file() put a copy in inode->u.generic_ip. If it works, I will send you an updated patch. However, it may be a day before I can do it.
>IMO, >without having ref count for sysfs_dirent, we could end up loosing the >sysfs_dirent and end up in inconsistent sysfs_dirent tree with respect to >dentry tree.
I believe that, with the patch I posted, the sysfs_dirent is still removed from the list of the parent directory's children at exactly the same times as before.
[...] >I will also test the patch tonight.
No need. I hope to have an updated patch for you soon though. Thanks for the quick and detailed response.
__ ______________ Adam J. Richter \ / adam@yggdrasil.com | g g d r a s i l - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |