Commit 06829ded authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] put_page() uses audited

Audit put_page() uses of pages that may be in the page cache.

Use page_cache_release() instead.
parent 686d6649
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/pagemap.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/param.h> #include <asm/param.h>
...@@ -1249,7 +1250,7 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) ...@@ -1249,7 +1250,7 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file)
flush_page_to_ram(page); flush_page_to_ram(page);
kunmap(page); kunmap(page);
} }
put_page(page); page_cache_release(page);
} }
} }
} }
......
...@@ -105,9 +105,9 @@ smb_readpage(struct file *file, struct page *page) ...@@ -105,9 +105,9 @@ smb_readpage(struct file *file, struct page *page)
int error; int error;
struct dentry *dentry = file->f_dentry; struct dentry *dentry = file->f_dentry;
get_page(page); page_cache_get(page);
error = smb_readpage_sync(dentry, page); error = smb_readpage_sync(dentry, page);
put_page(page); page_cache_release(page);
return error; return error;
} }
...@@ -194,11 +194,11 @@ smb_writepage(struct page *page) ...@@ -194,11 +194,11 @@ smb_writepage(struct page *page)
if (page->index >= end_index+1 || !offset) if (page->index >= end_index+1 || !offset)
return -EIO; return -EIO;
do_it: do_it:
get_page(page); page_cache_get(page);
err = smb_writepage_sync(inode, page, 0, offset); err = smb_writepage_sync(inode, page, 0, offset);
SetPageUptodate(page); SetPageUptodate(page);
unlock_page(page); unlock_page(page);
put_page(page); page_cache_release(page);
return err; return err;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment