Unionfs: clear partial read in readpage
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 13 Nov 2007 01:45:43 +0000 (20:45 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:48:57 +0000 (23:48 -0400)
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/mmap.c

index cb45e856484393cec43f3a54c9dce7bc3c33a20d..4cec2b5e85939c0a6330d0feb6d874fc3b251a86 100644 (file)
@@ -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)