Commit eb54d269 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 677bdb73
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);