Commit eb602521 authored by Yang Li's avatar Yang Li Committed by Andreas Gruenbacher

gfs2: make function gfs2_make_fs_ro() to void type

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: default avatarAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent a38fd874
...@@ -1539,9 +1539,7 @@ static int gfs2_reconfigure(struct fs_context *fc) ...@@ -1539,9 +1539,7 @@ static int gfs2_reconfigure(struct fs_context *fc)
return -EINVAL; return -EINVAL;
if (fc->sb_flags & SB_RDONLY) { if (fc->sb_flags & SB_RDONLY) {
error = gfs2_make_fs_ro(sdp); gfs2_make_fs_ro(sdp);
if (error)
errorfc(fc, "unable to remount read-only");
} else { } else {
error = gfs2_make_fs_rw(sdp); error = gfs2_make_fs_rw(sdp);
if (error) if (error)
......
...@@ -587,9 +587,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) ...@@ -587,9 +587,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags)
* Returns: errno * 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); int log_write_allowed = test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
gfs2_flush_delete_work(sdp); gfs2_flush_delete_work(sdp);
...@@ -624,8 +623,6 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp) ...@@ -624,8 +623,6 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
if (!log_write_allowed) if (!log_write_allowed)
sdp->sd_vfs->s_flags |= SB_RDONLY; sdp->sd_vfs->s_flags |= SB_RDONLY;
return error;
} }
/** /**
...@@ -637,7 +634,6 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp) ...@@ -637,7 +634,6 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
static void gfs2_put_super(struct super_block *sb) static void gfs2_put_super(struct super_block *sb)
{ {
struct gfs2_sbd *sdp = sb->s_fs_info; struct gfs2_sbd *sdp = sb->s_fs_info;
int error;
struct gfs2_jdesc *jd; struct gfs2_jdesc *jd;
/* No more recovery requests */ /* No more recovery requests */
...@@ -658,9 +654,7 @@ static void gfs2_put_super(struct super_block *sb) ...@@ -658,9 +654,7 @@ static void gfs2_put_super(struct super_block *sb)
spin_unlock(&sdp->sd_jindex_spin); spin_unlock(&sdp->sd_jindex_spin);
if (!sb_rdonly(sb)) { if (!sb_rdonly(sb)) {
error = gfs2_make_fs_ro(sdp); gfs2_make_fs_ro(sdp);
if (error)
gfs2_io_error(sdp);
} }
WARN_ON(gfs2_withdrawing(sdp)); WARN_ON(gfs2_withdrawing(sdp));
......
...@@ -34,7 +34,7 @@ extern int gfs2_lookup_in_master_dir(struct gfs2_sbd *sdp, char *filename, ...@@ -34,7 +34,7 @@ extern int gfs2_lookup_in_master_dir(struct gfs2_sbd *sdp, char *filename,
struct gfs2_inode **ipp); struct gfs2_inode **ipp);
extern int gfs2_make_fs_rw(struct gfs2_sbd *sdp); 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 void gfs2_online_uevent(struct gfs2_sbd *sdp);
extern int gfs2_statfs_init(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, extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
......
...@@ -156,7 +156,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp) ...@@ -156,7 +156,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
ret = 0; ret = 0;
} }
if (!ret) if (!ret)
ret = gfs2_make_fs_ro(sdp); gfs2_make_fs_ro(sdp);
gfs2_freeze_unlock(&freeze_gh); gfs2_freeze_unlock(&freeze_gh);
} }
......
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