From ad26d2999ecaa27a0c5f70ebe9600421c17d7859 Mon Sep 17 00:00:00 2001 From: Yiannis Pericleous Date: Fri, 27 Apr 2007 18:13:29 -0400 Subject: [PATCH] mmap: file revalidation --- fs/unionfs/mmap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index 57792d584378..7d27bd8018d2 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -162,6 +162,9 @@ int unionfs_readpage(struct file *file, struct page *page) { int err; + if ((err = unionfs_file_revalidate(file, 0))) + goto out_err; + err = unionfs_do_readpage(file, page); /* @@ -170,6 +173,7 @@ int unionfs_readpage(struct file *file, struct page *page) * it */ +out_err: unlock_page(page); return err; @@ -178,7 +182,7 @@ int unionfs_readpage(struct file *file, struct page *page) int unionfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) { - return 0; + return unionfs_file_revalidate(file, 1); } int unionfs_commit_write(struct file *file, struct page *page, unsigned from, @@ -194,6 +198,9 @@ int unionfs_commit_write(struct file *file, struct page *page, unsigned from, BUG_ON(file == NULL); + if ((err = unionfs_file_revalidate(file, 1))) + goto out; + inode = page->mapping->host; /* CPW: Moved below print_entry_location */ lower_inode = unionfs_lower_inode(inode); -- 2.43.0