Commit 9e88f905 authored by Amir Goldstein's avatar Amir Goldstein

ovl: remove unneeded goto instructions

There is nothing in the out goto target of ovl_get_layers().
Reviewed-by: default avatarAlexander Larsson <alexl@redhat.com>
Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent ab1eb5ff
...@@ -1575,10 +1575,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1575,10 +1575,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
int err; int err;
unsigned int i; unsigned int i;
err = -ENOMEM;
ofs->fs = kcalloc(numlower + 1, sizeof(struct ovl_sb), GFP_KERNEL); ofs->fs = kcalloc(numlower + 1, sizeof(struct ovl_sb), GFP_KERNEL);
if (ofs->fs == NULL) if (ofs->fs == NULL)
goto out; return -ENOMEM;
/* idx/fsid 0 are reserved for upper fs even with lower only overlay */ /* idx/fsid 0 are reserved for upper fs even with lower only overlay */
ofs->numfs++; ofs->numfs++;
...@@ -1592,7 +1591,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1592,7 +1591,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
err = get_anon_bdev(&ofs->fs[0].pseudo_dev); err = get_anon_bdev(&ofs->fs[0].pseudo_dev);
if (err) { if (err) {
pr_err("failed to get anonymous bdev for upper fs\n"); pr_err("failed to get anonymous bdev for upper fs\n");
goto out; return err;
} }
if (ovl_upper_mnt(ofs)) { if (ovl_upper_mnt(ofs)) {
...@@ -1605,9 +1604,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1605,9 +1604,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
struct inode *trap; struct inode *trap;
int fsid; int fsid;
err = fsid = ovl_get_fsid(ofs, &stack[i]); fsid = ovl_get_fsid(ofs, &stack[i]);
if (err < 0) if (fsid < 0)
goto out; return fsid;
/* /*
* Check if lower root conflicts with this overlay layers before * Check if lower root conflicts with this overlay layers before
...@@ -1618,13 +1617,13 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1618,13 +1617,13 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
*/ */
err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir"); err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir");
if (err) if (err)
goto out; return err;
if (ovl_is_inuse(stack[i].dentry)) { if (ovl_is_inuse(stack[i].dentry)) {
err = ovl_report_in_use(ofs, "lowerdir"); err = ovl_report_in_use(ofs, "lowerdir");
if (err) { if (err) {
iput(trap); iput(trap);
goto out; return err;
} }
} }
...@@ -1633,7 +1632,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1633,7 +1632,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
if (IS_ERR(mnt)) { if (IS_ERR(mnt)) {
pr_err("failed to clone lowerpath\n"); pr_err("failed to clone lowerpath\n");
iput(trap); iput(trap);
goto out; return err;
} }
/* /*
...@@ -1683,9 +1682,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs, ...@@ -1683,9 +1682,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
ofs->xino_mode); ofs->xino_mode);
} }
err = 0; return 0;
out:
return err;
} }
static struct ovl_entry *ovl_get_lowerstack(struct super_block *sb, static struct ovl_entry *ovl_get_lowerstack(struct super_block *sb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment