From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Alexander Larsson <alexl@redhat.com>, linux-unionfs@vger.kernel.org
Subject: [PATCH 1/5] ovl: remove unneeded goto instructions
Date: Wed, 12 Apr 2023 16:54:08 +0300 [thread overview]
Message-ID: <20230412135412.1684197-2-amir73il@gmail.com> (raw)
In-Reply-To: <20230412135412.1684197-1-amir73il@gmail.com>
There is nothing in the out goto target of ovl_get_layers().
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/overlayfs/super.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 6e4231799b86..7742aef3f3b3 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1586,10 +1586,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
int err;
unsigned int i;
- err = -ENOMEM;
ofs->fs = kcalloc(numlower + 1, sizeof(struct ovl_sb), GFP_KERNEL);
if (ofs->fs == NULL)
- goto out;
+ return -ENOMEM;
/* idx/fsid 0 are reserved for upper fs even with lower only overlay */
ofs->numfs++;
@@ -1603,7 +1602,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
err = get_anon_bdev(&ofs->fs[0].pseudo_dev);
if (err) {
pr_err("failed to get anonymous bdev for upper fs\n");
- goto out;
+ return err;
}
if (ovl_upper_mnt(ofs)) {
@@ -1616,9 +1615,9 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
struct inode *trap;
int fsid;
- err = fsid = ovl_get_fsid(ofs, &stack[i]);
- if (err < 0)
- goto out;
+ fsid = ovl_get_fsid(ofs, &stack[i]);
+ if (fsid < 0)
+ return fsid;
/*
* Check if lower root conflicts with this overlay layers before
@@ -1629,13 +1628,13 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
*/
err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir");
if (err)
- goto out;
+ return err;
if (ovl_is_inuse(stack[i].dentry)) {
err = ovl_report_in_use(ofs, "lowerdir");
if (err) {
iput(trap);
- goto out;
+ return err;
}
}
@@ -1644,7 +1643,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
if (IS_ERR(mnt)) {
pr_err("failed to clone lowerpath\n");
iput(trap);
- goto out;
+ return err;
}
/*
@@ -1694,9 +1693,7 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
ofs->xino_mode);
}
- err = 0;
-out:
- return err;
+ return 0;
}
static int ovl_get_lowerstack(struct super_block *sb, struct ovl_entry *oe,
--
2.34.1
next prev parent reply other threads:[~2023-04-12 13:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 13:54 [PATCH 0/5] Overlayfs lazy lookup of lowerdata Amir Goldstein
2023-04-12 13:54 ` Amir Goldstein [this message]
2023-04-18 11:37 ` [PATCH 1/5] ovl: remove unneeded goto instructions Alexander Larsson
2023-04-12 13:54 ` [PATCH 2/5] ovl: introduce data-only lower layers Amir Goldstein
2023-04-18 12:02 ` Alexander Larsson
2023-04-18 13:33 ` Amir Goldstein
2023-04-18 14:20 ` Alexander Larsson
2023-04-18 15:29 ` Amir Goldstein
2023-04-12 13:54 ` [PATCH 3/5] ovl: implement lookup in data-only layers Amir Goldstein
2023-04-18 12:40 ` Alexander Larsson
2023-04-18 13:41 ` Amir Goldstein
2023-04-18 14:00 ` Alexander Larsson
2023-04-18 14:07 ` Amir Goldstein
2023-04-12 13:54 ` [PATCH 4/5] ovl: prepare for lazy lookup of lowerdata inode Amir Goldstein
2023-04-18 12:53 ` Alexander Larsson
2023-04-26 14:56 ` Miklos Szeredi
2023-04-27 11:12 ` Amir Goldstein
2023-04-27 11:43 ` Amir Goldstein
2023-04-12 13:54 ` [PATCH 5/5] ovl: implement lazy lookup of lowerdata in data-only layers Amir Goldstein
2023-04-18 13:06 ` Alexander Larsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230412135412.1684197-2-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=alexl@redhat.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox