]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fuse: fix SetPageUptodate() condition in STORE
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 22 Jan 2014 18:36:58 +0000 (19:36 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 22 Jan 2014 18:36:58 +0000 (19:36 +0100)
As noticed by Coverity the "num != 0" condition never triggers.  Instead it
should check for a complete page.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/dev.c

index fa8cb4b7b8fee8f38dfb81c7f6f0c9e3e7a6e6e4..0a648bb455ae70b5a84e55ad9209c5894822d1be 100644 (file)
@@ -1587,7 +1587,8 @@ static int fuse_notify_store(struct fuse_conn *fc, unsigned int size,
 
                this_num = min_t(unsigned, num, PAGE_CACHE_SIZE - offset);
                err = fuse_copy_page(cs, &page, offset, this_num, 0);
-               if (!err && offset == 0 && (num != 0 || file_size == end))
+               if (!err && offset == 0 &&
+                   (this_num == PAGE_CACHE_SIZE || file_size == end))
                        SetPageUptodate(page);
                unlock_page(page);
                page_cache_release(page);