]> www.infradead.org Git - users/hch/dma-mapping.git/commitdiff
bcachefs: fix restart handling in bch2_rename2()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 15 Oct 2024 02:18:12 +0000 (22:18 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 18 Oct 2024 04:49:47 +0000 (00:49 -0400)
This should be impossible to hit in practice; the first lookup within a
transaction won't return a restart due to lock ordering, but we're
adding fault injection for transaction restarts and shaking out bugs.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c

index 857175f4bbbed4ef15493caacae4f23d85e17e4e..d5d16d12e03ad11216e18963ce7063cfaef7678b 100644 (file)
@@ -871,7 +871,7 @@ static int bch2_rename2(struct mnt_idmap *idmap,
        ret   = bch2_subvol_is_ro_trans(trans, src_dir->ei_inum.subvol) ?:
                bch2_subvol_is_ro_trans(trans, dst_dir->ei_inum.subvol);
        if (ret)
-               goto err;
+               goto err_tx_restart;
 
        if (inode_attr_changing(dst_dir, src_inode, Inode_opt_project)) {
                ret = bch2_fs_quota_transfer(c, src_inode,