On Fri, 2008-04-11 at 21:03 -0700, Andrew Morton wrote:Hahaha, maybe, but I have to be sure it's not just my own lack of understanding giving me grief! I'm not sure but I think there are some special requirements for such a message bus architecture. I've only skimmed the code but it looked like a mutex for each genetlink family or, ideally, for each socket should be possible. We also need to face the fact that this isn't designed to be a drop in replacement for ioctls as it can't provide (and probably can never provide) the not often used independently re-entrant function call like semantic of the ioctl interface. Almost, it is a re-implementation of the existing ioctl interface. It has an extra entry point so we can obtain a file handle to an autofs mount that has been over mounted and another to get owner info for mount re-construction on daemon restart. Which is what we need to be able to solve the active restart problem. I also made a couple of improvements, namely, allow actual failure status to be returned from the daemon to the kernel rather than always using ENOENT (long overdue, still need to update the daemon though) and added an additional entry point to check if a path is a mount point so we can eliminate some of the high overhead mount table scanning in the daemon. There's no question that genetlink is an elegant solution for common case ioctl functions but, as I say, it's not a complete replacement probably because it's primary purpose in life is to be a message bus implementation rather than specifically an ioctl replacement. As is often the case after posting a "please help" message it occurred to me that there is another way I might be able to do this. Instead of sending an independent umount request I could check, and if a candidate is found, set the expiring flag and return a "yes" status to the daemon and have the same function do the umount, then clear the when returning the status. That would eliminate the ugliness in the daemon and the need to use kernel threads but would open the possibility of the "expiring flag" remaining set if the daemon went away. That would prevent lookups (since we wait for expires to complete) and so prevent manual umount cleanup so I'm not sure yet what the implications of this really are. There is one other concern, the expire in the daemon has become far to complex because I enumerate umount candidates, almost for no other reason than to "count" the number of times I need to call the expire ioctl. This involves scanning the mount table which has proven to be a bit of a killer for large maps. I think the best way to improve this is try and get back to the way the expire was done long ago. That is, when an expire comes in for a mount (file handle) continually call back to the daemon until we can't umount any more mounts, then return the appropriate status to the daemon (now we just expire one mount at a time). This changed because we were getting infinite loops on umount fails in some cases but I think my approach to fixing that was just plain wrong. A genetlink implementation will exclude this possibility and due to the requirements of the message bus architecture I don't think that is likely to change any time soon, if ever. All things considered I'm leaning toward using a misc device to route the ioctls. Ian -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Linux 2.6.27-rc8 |
| Trent Piepho | [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Satyam Sharma | Re: 2.6.23-rc4-mm1 "no CRC" MODPOST warnings |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Bill Lear | Dangers of working on a tracking branch |
| Jeff King | Re: What's cooking in git/spearce.git (topics) |
| Jason Garber | git push [rejected] question |
| Maxim Gordienko | [GIT-P4] usage under Windows |
| Richard Stallman | Real men don't attack straw men |
| Leon Dippenaar | New tcp stack attack |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Brandon Lee | DELL PERC 5iR slow performance |
| Jeff Garzik | Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM |
| Paul Moore | [PATCH v7 00/17] Labeled networking patches for 2.6.28 |
| Denys Vlasenko | Re: bnx2 dirver's firmware images |
| Herbert Xu | Re: csum offload and af_packet |
