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

!3103 [sync] PR-3082: fs/dirty_pages: add last read check in seq_read_dirty()

parents 2ff2495d 2be2e11f
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -218,6 +218,9 @@ static ssize_t seq_read_dirty(
	}
	}


	n = min(m->count - m->from, size);
	n = min(m->count - m->from, size);
	/* check if this is the last read */
	if (n == 0)
		goto done;
	n -= copy_to_user(buf, m->buf + m->from, n);
	n -= copy_to_user(buf, m->buf + m->from, n);
	if (unlikely(!n)) {
	if (unlikely(!n)) {
		err = -EFAULT;
		err = -EFAULT;