commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=d6992a166c226880ae440a16ab3513dd2530c2a5 branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/2012R1
There is a bug in below scene: 1. create a new file 2. mmap the file and write to it 3. read the file can't get the correct value Because sys_read() > generic_file_aio_read() > simple_readpage() > clear_page() which make the page be zeroed. Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() to make generic_file_aio_read() do not call simple_readpage(). Signed-off-by: Bob Liu <[email protected]> --- fs/ramfs/file-nommu.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index fbb0b47..d5378d0 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c @@ -110,6 +110,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) /* prevent the page from being discarded on memory pressure */ SetPageDirty(page); + SetPageUptodate(page); unlock_page(page); put_page(page);
_______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
