From 2f6e1f07c84184e7b4cdb88ec920e6bada7f051e Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Mon, 12 Nov 2007 20:45:43 -0500 Subject: [PATCH] Unionfs: clear partial read in readpage Signed-off-by: Hugh Dickins Signed-off-by: Erez Zadok --- fs/unionfs/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index 24fa02d0519..e5d7e996638 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -211,7 +211,8 @@ static int unionfs_do_readpage(struct file *file, struct page *page) err = vfs_read(lower_file, page_data, PAGE_CACHE_SIZE, &lower_file->f_pos); set_fs(old_fs); - + if (err >= 0 && err < PAGE_CACHE_SIZE) + memset(page_data + err, 0, PAGE_CACHE_SIZE - err); kunmap(page); if (err < 0) -- 2.43.0