mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
bcachefs: Fix error path of bch2_link_trans()
In bch2_link_trans(), if bch2_inode_nlink_inc() fails, it needs to call bch2_trans_iter_exit() in the error path. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
36aa49d33e
commit
9862022d09
@ -200,12 +200,12 @@ int bch2_link_trans(struct btree_trans *trans,
|
||||
|
||||
ret = bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_intent);
|
||||
if (ret)
|
||||
goto err;
|
||||
return ret;
|
||||
|
||||
inode_u->bi_ctime = now;
|
||||
ret = bch2_inode_nlink_inc(inode_u);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err;
|
||||
|
||||
ret = bch2_inode_peek(trans, &dir_iter, dir_u, dir, BTREE_ITER_intent);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user