xfstests generic/299 turned up a data corruption when we do a short
write because of -ENOSPC - when we truncate the write we might no longer
be doing a full write to a !uptodate folio, which then needs to be read
in.

Amusingly, fixing this turned up a bug in fio where verify mode behaves
badly in the presence of short writes, which took longer to figure out
than the original bug...

Kent Overstreet (3):
  bcachefs: fix disk reservation accounting in bch2_folio_reservation_get()
  bcachefs: bch2_folio_reservation_get_partial() is now better behaved
  bcachefs: Fix data corruption on -ENOSPC in buffered write path

 fs/bcachefs/buckets.c         |  7 +++-
 fs/bcachefs/buckets.h         | 12 +++---
 fs/bcachefs/fs-io-buffered.c  |  6 +++
 fs/bcachefs/fs-io-pagecache.c | 70 ++++++++++++++++++++++-------------
 4 files changed, 63 insertions(+), 32 deletions(-)

-- 
2.45.2


Reply via email to