public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gfs2: make function gfs2_make_fs_ro() to void type
@ 2021-03-04  9:37 Yang Li
  2021-03-04 15:22 ` Bob Peterson
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-03-04  9:37 UTC (permalink / raw)
  To: rpeterso; +Cc: agruenba, cluster-devel, linux-kernel, Yang Li

It fixes the following warning detected by coccinelle:
./fs/gfs2/super.c:592:5-10: Unneeded variable: "error". Return "0" on
line 628

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 fs/gfs2/ops_fstype.c | 4 +---
 fs/gfs2/super.c      | 9 +++------
 fs/gfs2/super.h      | 2 +-
 fs/gfs2/util.c       | 2 +-
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 74c7d01..aa41360 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1539,9 +1539,7 @@ static int gfs2_reconfigure(struct fs_context *fc)
 			return -EINVAL;
 
 		if (fc->sb_flags & SB_RDONLY) {
-			error = gfs2_make_fs_ro(sdp);
-			if (error)
-				errorfc(fc, "unable to remount read-only");
+			gfs2_make_fs_ro(sdp);
 		} else {
 			error = gfs2_make_fs_rw(sdp);
 			if (error)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 861ed5f..6e2588f 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -587,9 +587,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags)
  * Returns: errno
  */
 
-int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
+void gfs2_make_fs_ro(struct gfs2_sbd *sdp)
 {
-	int error = 0;
 	int log_write_allowed = test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
 
 	gfs2_flush_delete_work(sdp);
@@ -625,7 +624,7 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
 	if (!log_write_allowed)
 		sdp->sd_vfs->s_flags |= SB_RDONLY;
 
-	return error;
+	return;
 }
 
 /**
@@ -658,9 +657,7 @@ static void gfs2_put_super(struct super_block *sb)
 	spin_unlock(&sdp->sd_jindex_spin);
 
 	if (!sb_rdonly(sb)) {
-		error = gfs2_make_fs_ro(sdp);
-		if (error)
-			gfs2_io_error(sdp);
+		gfs2_make_fs_ro(sdp);
 	}
 	WARN_ON(gfs2_withdrawing(sdp));
 
diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h
index 08e502d..ec4affb3 100644
--- a/fs/gfs2/super.h
+++ b/fs/gfs2/super.h
@@ -34,7 +34,7 @@ extern int gfs2_lookup_in_master_dir(struct gfs2_sbd *sdp, char *filename,
 				     struct gfs2_inode **ipp);
 
 extern int gfs2_make_fs_rw(struct gfs2_sbd *sdp);
-extern int gfs2_make_fs_ro(struct gfs2_sbd *sdp);
+extern void gfs2_make_fs_ro(struct gfs2_sbd *sdp);
 extern void gfs2_online_uevent(struct gfs2_sbd *sdp);
 extern int gfs2_statfs_init(struct gfs2_sbd *sdp);
 extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 8d3c670..5874331 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -156,7 +156,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
 				ret = 0;
 		}
 		if (!ret)
-			ret = gfs2_make_fs_ro(sdp);
+			gfs2_make_fs_ro(sdp);
 		gfs2_freeze_unlock(&freeze_gh);
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gfs2: make function gfs2_make_fs_ro() to void type
  2021-03-04  9:37 [PATCH] gfs2: make function gfs2_make_fs_ro() to void type Yang Li
@ 2021-03-04 15:22 ` Bob Peterson
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Peterson @ 2021-03-04 15:22 UTC (permalink / raw)
  To: Yang Li; +Cc: agruenba, cluster-devel, linux-kernel

----- Original Message -----
> It fixes the following warning detected by coccinelle:
> ./fs/gfs2/super.c:592:5-10: Unneeded variable: "error". Return "0" on
> line 628
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  fs/gfs2/ops_fstype.c | 4 +---
>  fs/gfs2/super.c      | 9 +++------
>  fs/gfs2/super.h      | 2 +-
>  fs/gfs2/util.c       | 2 +-
>  4 files changed, 6 insertions(+), 11 deletions(-)

Thanks. Your patch is now pushed to linux-gfs2/for-next.
I did one minor cleanup: Function gfs2_put_super in super.c no longer
needed the variable "error" so I removed it to avoid warnings.

https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=0e787a0bfabb8be323f575d5cdda48e607840eb5

Regards,

Bob Peterson


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-04 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04  9:37 [PATCH] gfs2: make function gfs2_make_fs_ro() to void type Yang Li
2021-03-04 15:22 ` Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox