bcachefs: Fix swallowing of data in buffered write path
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 15 Aug 2023 02:29:41 +0000 (22:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:11 +0000 (17:10 -0400)
commit62898dd12ba017c56c39a74ef891845118b0c190
treed93799799e1528e4e1d8a4b102cc40babadea42f
parent8c9b0f7bdc4183573d57f0442693d99cc9758617
bcachefs: Fix swallowing of data in buffered write path

In __bch2_buffered_write, if we fail to write to an entire !uptodate
folio, we have to back out the write, bail out and retry.

But we were missing an iov_iter_revert() call, so the data written to
the folio was lost and the rest of the write shifted to the wrong
offset.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io-buffered.c