]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gfs2: Turn gfs2_withdraw into a void function
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Aug 2025 17:51:47 +0000 (19:51 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 12 Sep 2025 10:02:12 +0000 (12:02 +0200)
Since commit 601ef0d52e96 ("gfs2: Force withdraw to replay journals and
wait for it to finish"), gfs2_withdraw() always returns -1, so turn it
into a straight void function.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
fs/gfs2/util.c
fs/gfs2/util.h

index 24864a66074b2a92ecfb80384743fef0842a2485..020dd21ad51e2bc628617d1d8a2957eadf10370b 100644 (file)
@@ -309,7 +309,7 @@ void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)
        va_end(args);
 }
 
-int gfs2_withdraw(struct gfs2_sbd *sdp)
+void gfs2_withdraw(struct gfs2_sbd *sdp)
 {
        struct lm_lockstruct *ls = &sdp->sd_lockstruct;
        const struct lm_lockops *lm = ls->ls_ops;
@@ -322,7 +322,7 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
                                wait_on_bit(&sdp->sd_flags,
                                            SDF_WITHDRAW_IN_PROG,
                                            TASK_UNINTERRUPTIBLE);
-                               return -1;
+                               return;
                        }
                        new = old | BIT(SDF_WITHDRAWN) | BIT(SDF_WITHDRAW_IN_PROG);
                } while (unlikely(!try_cmpxchg(&sdp->sd_flags, &old, new)));
@@ -350,8 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
 
        if (sdp->sd_args.ar_errors == GFS2_ERRORS_PANIC)
                panic("GFS2: fsid=%s: panic requested\n", sdp->sd_fsname);
-
-       return -1;
 }
 
 /*
@@ -481,16 +479,14 @@ int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
                       const char *function, char *file,
                       unsigned int line)
 {
-       int me;
-
        gfs2_lm(sdp,
                "fatal: invalid metadata block - "
                "bh = %llu (bad magic number), "
                "function = %s, file = %s, line = %u\n",
                (unsigned long long)bh->b_blocknr,
                function, file, line);
-       me = gfs2_withdraw(sdp);
-       return (me) ? -1 : -2;
+       gfs2_withdraw(sdp);
+       return -1;
 }
 
 /*
@@ -503,16 +499,14 @@ int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
                           u16 type, u16 t, const char *function,
                           char *file, unsigned int line)
 {
-       int me;
-
        gfs2_lm(sdp,
                "fatal: invalid metadata block - "
                "bh = %llu (type: exp=%u, found=%u), "
                "function = %s, file = %s, line = %u\n",
                (unsigned long long)bh->b_blocknr, type, t,
                function, file, line);
-       me = gfs2_withdraw(sdp);
-       return (me) ? -1 : -2;
+       gfs2_withdraw(sdp);
+       return -1;
 }
 
 /*
@@ -528,7 +522,8 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
                "fatal: I/O error - "
                "function = %s, file = %s, line = %u\n",
                function, file, line);
-       return gfs2_withdraw(sdp);
+       gfs2_withdraw(sdp);
+       return -1;
 }
 
 /*
index 27d03b641024185f518ac2f063bc9c8359e18178..2a8a1fac611afe92770e856f19a348eb1c722c47 100644 (file)
@@ -228,6 +228,6 @@ gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)
 
 __printf(2, 3)
 void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...);
-int gfs2_withdraw(struct gfs2_sbd *sdp);
+void gfs2_withdraw(struct gfs2_sbd *sdp);
 
 #endif /* __UTIL_DOT_H__ */