bcachefs: Add an assert in inode_write for -ENOENT

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-03-15 19:04:05 -04:00
parent 9edbcc72f6
commit 711bf946d5

View file

@ -105,6 +105,11 @@ int __must_check bch2_write_inode(struct bch_fs *c,
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
goto retry;
bch2_fs_fatal_err_on(ret == -ENOENT, c,
"inode %u:%llu not found when updating",
inode_inum(inode).subvol,
inode_inum(inode).inum);
bch2_trans_exit(&trans);
return ret < 0 ? ret : 0;
}