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>
Tue, 13 Nov 2007 01:45:43 +0000 (20:45 -0500)
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/mmap.c

index 24fa02d05197e676a5c05c465ca6721ee2150a93..e5d7e996638f8895f06fa850df67f307bdf93a90 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)