Skip to content
Unverified Commit 8287474a authored by Al Viro's avatar Al Viro Committed by Christian Brauner
Browse files

direct_write_fallback(): on error revert the ->ki_pos update from buffered write



If we fail filemap_write_and_wait_range() on the range the buffered write went
into, we only report the "number of bytes which we direct-written", to quote
the comment in there.  Which is fine, but buffered write has already advanced
iocb->ki_pos, so we need to roll that back.  Otherwise we end up with e.g.
write(2) advancing position by more than the amount it reports having written.

Fixes: 182c25e9 "filemap: update ki_pos in generic_perform_write"
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Message-Id: <20230827214518.GU3390869@ZenIV>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 22515881
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment