Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kent Overstreet and committed by
Kent Overstreet
6558e61d eacb2574

+3 -1
+3 -1
fs/bcachefs/btree_update_leaf.c
··· 816 816 } 817 817 818 818 BUG_ON((ret == EINTR || ret == -EAGAIN) && !trans->restarted); 819 - BUG_ON(ret == -ENOSPC && (trans->flags & BTREE_INSERT_NOFAIL)); 819 + BUG_ON(ret == -ENOSPC && 820 + !(trans->flags & BTREE_INSERT_NOWAIT) && 821 + (trans->flags & BTREE_INSERT_NOFAIL)); 820 822 821 823 return ret; 822 824 }