Home
last modified time | relevance | path

Searched hist:"3 ad216ee" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/fs/afs/
H A Dwrite.c3ad216ee Sat Nov 14 11:27:57 CST 2020 David Howells <dhowells@redhat.com> afs: Fix afs_write_end() when called with copied == 0 [ver #3]

When afs_write_end() is called with copied == 0, it tries to set the
dirty region, but there's no way to actually encode a 0-length region in
the encoding in page->private.

"0,0", for example, indicates a 1-byte region at offset 0. The maths
miscalculates this and sets it incorrectly.

Fix it to just do nothing but unlock and put the page in this case. We
don't actually need to mark the page dirty as nothing presumably
changed.

Fixes: 65dd2d6072d3 ("afs: Alter dirty range encoding in page->private")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3ad216ee Sat Nov 14 11:27:57 CST 2020 David Howells <dhowells@redhat.com> afs: Fix afs_write_end() when called with copied == 0 [ver #3]

When afs_write_end() is called with copied == 0, it tries to set the
dirty region, but there's no way to actually encode a 0-length region in
the encoding in page->private.

"0,0", for example, indicates a 1-byte region at offset 0. The maths
miscalculates this and sets it incorrectly.

Fix it to just do nothing but unlock and put the page in this case. We
don't actually need to mark the page dirty as nothing presumably
changed.

Fixes: 65dd2d6072d3 ("afs: Alter dirty range encoding in page->private")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>