2020-11-20 18:29:12

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH 006/141] gfs2: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple goto statements instead of just
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
fs/gfs2/inode.c | 2 ++
fs/gfs2/recovery.c | 1 +
2 files changed, 3 insertions(+)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 077ccb1b3ccc..9a85214c2505 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -960,6 +960,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
break;
case 0:
error = -EEXIST;
+ goto out_gunlock;
default:
goto out_gunlock;
}
@@ -1500,6 +1501,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
break;
case 0:
error = -EEXIST;
+ goto out_gunlock;
default:
goto out_gunlock;
}
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index c26c68ebd29d..5b2a01d9c463 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -437,6 +437,7 @@ void gfs2_recover_func(struct work_struct *work)
case GLR_TRYFAILED:
fs_info(sdp, "jid=%u: Busy\n", jd->jd_jid);
error = 0;
+ goto fail;

default:
goto fail;
--
2.27.0


2021-04-20 20:30:39

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH 006/141] gfs2: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

On 11/20/20 12:25, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
> warnings by explicitly adding multiple goto statements instead of just
> letting the code fall through to the next case.
>
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---
> fs/gfs2/inode.c | 2 ++
> fs/gfs2/recovery.c | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
> index 077ccb1b3ccc..9a85214c2505 100644
> --- a/fs/gfs2/inode.c
> +++ b/fs/gfs2/inode.c
> @@ -960,6 +960,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
> break;
> case 0:
> error = -EEXIST;
> + goto out_gunlock;
> default:
> goto out_gunlock;
> }
> @@ -1500,6 +1501,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
> break;
> case 0:
> error = -EEXIST;
> + goto out_gunlock;
> default:
> goto out_gunlock;
> }
> diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
> index c26c68ebd29d..5b2a01d9c463 100644
> --- a/fs/gfs2/recovery.c
> +++ b/fs/gfs2/recovery.c
> @@ -437,6 +437,7 @@ void gfs2_recover_func(struct work_struct *work)
> case GLR_TRYFAILED:
> fs_info(sdp, "jid=%u: Busy\n", jd->jd_jid);
> error = 0;
> + goto fail;
>
> default:
> goto fail;
>

2021-04-20 20:41:33

by Andreas Grünbacher

[permalink] [raw]
Subject: Re: [PATCH 006/141] gfs2: Fix fall-through warnings for Clang

Am Di., 20. Apr. 2021 um 22:29 Uhr schrieb Gustavo A. R. Silva
<[email protected]>:
> Friendly ping: who can take this, please?

Oops, that got lost. I've added it to for-next now.

Thanks,
Andreas