diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2014-01-22 19:36:58 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2014-01-22 19:36:58 +0100 |
commit | 063ec1e595f8a82b5a8fd0acb3e88c8b49a1e6c1 (patch) | |
tree | d4ac853aa7b0a4e65464e1dd22c830ca9aa13f40 /fs/fuse/dev.c | |
parent | 28a625cbc2a14f17b83e47ef907b2658576a32aa (diff) | |
download | op-kernel-dev-063ec1e595f8a82b5a8fd0acb3e88c8b49a1e6c1.zip op-kernel-dev-063ec1e595f8a82b5a8fd0acb3e88c8b49a1e6c1.tar.gz |
fuse: fix SetPageUptodate() condition in STORE
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>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index fa8cb4b..0a648bb 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -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); |