Skip to content

Commit 27c3b41

Browse files
committed
GFS2: Fix up some sparse warnings
This patch cleans up various pieces of GFS2 to avoid sparse errors. This doesn't fix them all, but it fixes several. The first error, in function glock_hash_walk was a genuine bug where the rhashtable could be started and not stopped. Signed-off-by: Bob Peterson <[email protected]>
1 parent 561b796 commit 27c3b41

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

fs/gfs2/glock.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,14 +1550,15 @@ static void glock_hash_walk(glock_examiner examiner, const struct gfs2_sbd *sdp)
15501550

15511551
do {
15521552
gl = ERR_PTR(rhashtable_walk_start(&iter));
1553-
if (gl)
1554-
continue;
1553+
if (IS_ERR(gl))
1554+
goto walk_stop;
15551555

15561556
while ((gl = rhashtable_walk_next(&iter)) && !IS_ERR(gl))
1557-
if ((gl->gl_name.ln_sbd == sdp) &&
1557+
if (gl->gl_name.ln_sbd == sdp &&
15581558
lockref_get_not_dead(&gl->gl_lockref))
15591559
examiner(gl);
15601560

1561+
walk_stop:
15611562
rhashtable_walk_stop(&iter);
15621563
} while (cond_resched(), gl == ERR_PTR(-EAGAIN));
15631564

@@ -1940,6 +1941,7 @@ static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
19401941
}
19411942

19421943
static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)
1944+
__acquires(RCU)
19431945
{
19441946
struct gfs2_glock_iter *gi = seq->private;
19451947
loff_t n = *pos;
@@ -1972,6 +1974,7 @@ static void *gfs2_glock_seq_next(struct seq_file *seq, void *iter_ptr,
19721974
}
19731975

19741976
static void gfs2_glock_seq_stop(struct seq_file *seq, void *iter_ptr)
1977+
__releases(RCU)
19751978
{
19761979
struct gfs2_glock_iter *gi = seq->private;
19771980

fs/gfs2/lock_dlm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include "sys.h"
2424
#include "trace_gfs2.h"
2525

26-
extern struct workqueue_struct *gfs2_control_wq;
27-
2826
/**
2927
* gfs2_update_stats - Update time based stats
3028
* @mv: Pointer to mean/variance structure to update
@@ -1176,7 +1174,7 @@ static void gdlm_recovery_result(struct gfs2_sbd *sdp, unsigned int jid,
11761174
spin_unlock(&ls->ls_recover_spin);
11771175
}
11781176

1179-
const struct dlm_lockspace_ops gdlm_lockspace_ops = {
1177+
static const struct dlm_lockspace_ops gdlm_lockspace_ops = {
11801178
.recover_prep = gdlm_recover_prep,
11811179
.recover_slot = gdlm_recover_slot,
11821180
.recover_done = gdlm_recover_done,

fs/gfs2/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ extern struct kmem_cache *gfs2_rgrpd_cachep;
151151
extern struct kmem_cache *gfs2_quotad_cachep;
152152
extern struct kmem_cache *gfs2_qadata_cachep;
153153
extern mempool_t *gfs2_page_pool;
154+
extern struct workqueue_struct *gfs2_control_wq;
154155

155156
static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt,
156157
unsigned int *p)

fs/gfs2/xattr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "meta_io.h"
2626
#include "quota.h"
2727
#include "rgrp.h"
28+
#include "super.h"
2829
#include "trans.h"
2930
#include "util.h"
3031

0 commit comments

Comments
 (0)