mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
bcachefs: Fix for an assertion on filesystem error
Normally the in memory i_size is always greater than or equal to i_size on disk; this doesn't hold on filesystem error. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
b5a5c4c103
commit
c45d473df7
1 changed files with 9 additions and 0 deletions
|
@ -2255,6 +2255,15 @@ int bch2_truncate(struct bch_inode_info *inode, struct iattr *iattr)
|
||||||
ret = PTR_ERR_OR_ZERO(iter);
|
ret = PTR_ERR_OR_ZERO(iter);
|
||||||
bch2_trans_exit(&trans);
|
bch2_trans_exit(&trans);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check this before next assertion; on filesystem error our normal
|
||||||
|
* invariants are a bit broken (truncate has to truncate the page cache
|
||||||
|
* before the inode).
|
||||||
|
*/
|
||||||
|
ret = bch2_journal_error(&c->journal);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue