bcachefs: Fix an assertion

bch2_trans_commit() can legitimately return -ENOSPC with
BTREE_INSERT_NOFAIL set if BTREE_INSERT_NOWAIT was also set.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-01-02 22:24:43 -05:00 committed by Kent Overstreet
parent eacb2574f0
commit 6558e61dfe

View File

@ -816,7 +816,9 @@ int bch2_trans_commit_error(struct btree_trans *trans,
}
BUG_ON((ret == EINTR || ret == -EAGAIN) && !trans->restarted);
BUG_ON(ret == -ENOSPC && (trans->flags & BTREE_INSERT_NOFAIL));
BUG_ON(ret == -ENOSPC &&
!(trans->flags & BTREE_INSERT_NOWAIT) &&
(trans->flags & BTREE_INSERT_NOFAIL));
return ret;
}