Skip to content

Commit 1a1c93e

Browse files
author
Kent Overstreet
committed
bcachefs: Fix missing bch2_err_class() calls
We aren't supposed to be leaking our private error codes outside of fs/bcachefs/. Fixes: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 7b508b3 commit 1a1c93e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/bcachefs/fs.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static int bch2_link(struct dentry *old_dentry, struct inode *vdir,
435435
bch2_subvol_is_ro(c, inode->ei_subvol) ?:
436436
__bch2_link(c, inode, dir, dentry);
437437
if (unlikely(ret))
438-
return ret;
438+
return bch2_err_class(ret);
439439

440440
ihold(&inode->v);
441441
d_instantiate(dentry, &inode->v);
@@ -487,8 +487,9 @@ static int bch2_unlink(struct inode *vdir, struct dentry *dentry)
487487
struct bch_inode_info *dir= to_bch_ei(vdir);
488488
struct bch_fs *c = dir->v.i_sb->s_fs_info;
489489

490-
return bch2_subvol_is_ro(c, dir->ei_subvol) ?:
490+
int ret = bch2_subvol_is_ro(c, dir->ei_subvol) ?:
491491
__bch2_unlink(vdir, dentry, false);
492+
return bch2_err_class(ret);
492493
}
493494

494495
static int bch2_symlink(struct mnt_idmap *idmap,
@@ -523,7 +524,7 @@ static int bch2_symlink(struct mnt_idmap *idmap,
523524
return 0;
524525
err:
525526
iput(&inode->v);
526-
return ret;
527+
return bch2_err_class(ret);
527528
}
528529

529530
static int bch2_mkdir(struct mnt_idmap *idmap,
@@ -641,7 +642,7 @@ static int bch2_rename2(struct mnt_idmap *idmap,
641642
src_inode,
642643
dst_inode);
643644

644-
return ret;
645+
return bch2_err_class(ret);
645646
}
646647

647648
static void bch2_setattr_copy(struct mnt_idmap *idmap,

0 commit comments

Comments
 (0)