1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

bcachefs: Fix truncate sometimes failing and returning 1

__bch_truncate_folio() may return 1 to indicate dirtyness of the folio
being truncated, needed for fpunch to get the i_size writes correct.

But truncate was forgetting to clear ret, and sometimes returning it as
an error.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-02-26 10:57:26 -05:00
parent 677bdb7346
commit eb54d2695b

View file

@ -466,6 +466,7 @@ int bchfs_truncate(struct mnt_idmap *idmap,
ret = bch2_truncate_folio(inode, iattr->ia_size);
if (unlikely(ret < 0))
goto err;
ret = 0;
truncate_setsize(&inode->v, iattr->ia_size);