Unverified Commit 1c1cfbaa authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8711 ubifs: Set page uptodate in the correct place

parents d8a3bc61 ff812e19
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -262,9 +262,6 @@ static int write_begin_slow(struct address_space *mapping,
				return err;
			}
		}

		SetPageUptodate(page);
		ClearPageError(page);
	}

	if (PagePrivate(page))
@@ -463,9 +460,6 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,
				return err;
			}
		}

		SetPageUptodate(page);
		ClearPageError(page);
	}

	err = allocate_budget(c, page, ui, appending);
@@ -475,10 +469,8 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,
		 * If we skipped reading the page because we were going to
		 * write all of it, then it is not up to date.
		 */
		if (skipped_read) {
		if (skipped_read)
			ClearPageChecked(page);
			ClearPageUptodate(page);
		}
		/*
		 * Budgeting failed which means it would have to force
		 * write-back but didn't, because we set the @fast flag in the
@@ -569,6 +561,9 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
		goto out;
	}

	if (len == PAGE_SIZE)
		SetPageUptodate(page);

	if (!PagePrivate(page)) {
		attach_page_private(page, (void *)1);
		atomic_long_inc(&c->dirty_pg_cnt);