-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [EMAIL PROTECTED] wrote: > Jeff Mahoney: >> sysaufs_sbinfo is a pretty ugly hack. It has a refcount, a kset, some >> attributes, and a way to track if it's been added. This is pretty much >> what a kobject was designed to do. >> >> Rather than duplicating all the code inside aufs, we can leverage the >> kobject code to do all of that for us. >> >> For the attribute functions, we don't need to search for anything anymore >> because the kobject can be used to reach a properly protected and >> refcounted sbinfo structure. > > Is this case safe too? > - a user opens /sys/fs/aufs/sbi_*/mntpnt1 > - anothere user unmount the same aufs > - the first user reads mntpnt1 which was opened previously > > I am afraid your approach may corrupt the file structure because of the > lifetime of sysaufs_sbinfo structutre. Your patch makes it freed when > the aufs is unmounted. > This scenario is similar to your approach for sysaufs_br.
No, it doesn't. I'll test it to be sure, but the idea of using the kobject is that it becomes responsible for the reference counting. The object doesn't get freed until the last reference is dropped. If the file is opened in sysfs, then the kobject's reference count is bumped. Unmounting the file system will remove the file, but the object itself won't be freed until the file is closed. It's the same idea as the inode not going away when a file is removed until it's closed. - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFIAqEXLPWxlyuTD7IRAiWKAJ9oJkfi9dRpTFpKTF+d6vtgGoH/OACZARM9 bD9+yti31j1rQwcB6DdRR5o= =K+tX -----END PGP SIGNATURE----- ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
