Re: Question about invalidate_inode_pages2_range()

From: Trond Myklebust
Date: Mon Oct 19 2009 - 04:26:40 EST


On Mon, 2009-10-19 at 16:16 +0800, Peng Tao wrote:
> Hi,
>
> I've a question about invalidate_inode_pages2_range().
>
> When does invalidate_inode_pages2_range() returns -EBUSY? It locks and
> writes back the page. Why invalidate_complete_page2() still may fail
> due to page dirtiness?

A lot of those requirements were set by NFS, which uses
invalidate_inode_pages2() in order to invalidate the page cache when it
detects that a file has been changed on the server (either due to an
O_DIRECT write, or due to another client modifying the file).

In such cases, you want to try to keep the dirty data by writing it out
instead of discarding it.

Cheers
Trond

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