>Or actually we wouldn't >even care if stale pages are added as they would still be cleared in >readpage(). And pages found and uptodate and locked simply need to be >marked dirty and released again and if not uptodate they need to be >cleared first.
You do need some form of locking to make sure someone doesn't add a page, update it, and clean it while you're independently initializing the block under it. The cache locks are usually what coordinate this kind of activity, but I think we've established those locks aren't available at this level (inside a pageout). Maybe a block lock or file lock could serve. I believe modifying a page and its status while it's locked by another process is a violation of page management ethics. I wouldn't dare. If you do figure something out with direct clearing of the block upon pageout of the first page in it, remember to have some reserved memory for the I/O buffer and bio/bh, because you can't wait for memory inside a pageout. >Is your driver's source available to look at? Not easily. An old version is available for download (under GPL) at http://www-1.ibm.com/servers/storage/software/virtualization/sfs/implementation.html . You have to register. I could email a copy (1.2M) to you, but I don't know if it would be worth your time to plow through it. This (Storage Tank) is a multi-disk shared filesystem (multiple computers access the same disks, but the block maps are kept on a separate metadata server) with multiple block size and page size and copy-on-write snapshots. And the same code works in a wide variety of 2.4 and 2.6 Linux kernels. These things all complicate this area of initializing a new block. And it's 20,000 lines of code not counting the metadata server. - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html