Re: PATCH: rewrite of invalidate_inode_pages

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Thu May 11 2000 - 17:28:35 EST


You seem to assume that invalidate_inode_pages() is supposed to
invalidate *all* pages in the inode. This is NOT the case, and any
rewrite is going to lead to hard lockups if you try to make it so.

Most calls to invalidate_inode_pages() are made while we hold the page
lock for some page that has just been updated (and hence we know is up
to date). The reason is that under NFS, we receive a set of attributes
as part of the result from READ/WRITE/... If this triggers a cache
invalidation, then we do not want to invalidate the page that we know
is safe, hence we call invalidate_inode_pages() before the newly read
in page is unlocked.

Your code of the form

    while (head != head->next) {
...
   }

without some alternative method of exit will therefore lock up under NFS.

Filesystems which want to make sure they clear out locked pages should
use truncate_inode_pages() instead.

Cheers,
  Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:18 EST