Unverified Commit 7196df35 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11397 fuse: Initialize beyond-EOF page contents before setting uptodate

parents d3b25228 6eef5092
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1618,9 +1618,11 @@ static int fuse_notify_store(struct fuse_conn *fc, unsigned int size,

		this_num = min_t(unsigned, num, PAGE_SIZE - offset);
		err = fuse_copy_page(cs, &page, offset, this_num, 0);
		if (!err && offset == 0 &&
		    (this_num == PAGE_SIZE || file_size == end))
		if (!PageUptodate(page) && !err && offset == 0 &&
		    (this_num == PAGE_SIZE || file_size == end)) {
			zero_user_segment(page, this_num, PAGE_SIZE);
			SetPageUptodate(page);
		}
		unlock_page(page);
		put_page(page);