| ★ wanayoo — archive 1999 http://www.kernelnotes.org/patch/21-p0601.html | Nouvelle recherche | Portail wanayoo |
|
Bill Hawes (whawes@star.net) Sun Jun 29 13:19:00 1997 |
[Home] [Linux 2.0] [Linux 2.1] [Information] [Software] [Distributions] [Links] |
|
There seem to be a number of unprotected race conditions caused by the fact that clear_inode may block under some circumstances. This is especially true in the 2.0.xx tree and up through 2.1.42; it may not be an issue after 2.1.43, but I'm not sure yet.As one of the causes of clear_inode blocking is the call to truncate_inode_pages, I've written a non-blocking replacement. It works requeueing any locked pages to a special inode, where they can be reaped later by shrink_mmap. This avoids the need to wait for the page IO to complete so that the truncate call doesn't have to block.
I've tested this under 2.1.42 by forcing it to requeue pages and verifying that they get released by shrink_mmap. I've also tested it a little under 2.0.30 with no problems.
With this patch in place all of the kernel calls to clear_inode that first check that the inode isn't locked should never block, and potentially nasty race conditions will be averted.