2015-07-13 20:18:46

by Fengguang Wu

[permalink] [raw]
Subject: [linux-gfs2:for-next 2/2] fs/gfs2/glock.c:79:26: sparse: symbol 'ht_parms' was not declared. Should it be static?

tree: git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 for-next
head: 6afe4c76af372a6b453f33888e664beddc4647b4
commit: 6afe4c76af372a6b453f33888e664beddc4647b4 [2/2] GFS2: Use resizable hash table for glocks
reproduce:
# apt-get install sparse
git checkout 6afe4c76af372a6b453f33888e664beddc4647b4
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> fs/gfs2/glock.c:79:26: sparse: symbol 'ht_parms' was not declared. Should it be static?
fs/gfs2/./trace_gfs2.h:160:1: sparse: odd constant _Bool cast (ffffffffffffffff becomes 1)
fs/gfs2/glock.c:175:9: sparse: context imbalance in 'gfs2_glock_put' - unexpected unlock
fs/gfs2/glock.c:1802:13: sparse: context imbalance in 'gfs2_glock_seq_start' - wrong count at exit
>> fs/gfs2/glock.c:1834:13: sparse: context imbalance in 'gfs2_glock_seq_stop' - unexpected unlock

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


2015-07-13 20:18:36

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH linux-gfs2] GFS2: ht_parms can be static


Signed-off-by: Fengguang Wu <[email protected]>
---
glock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 813de00..1b0dff4 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -76,7 +76,7 @@ static DEFINE_SPINLOCK(lru_lock);
#define GFS2_GL_HASH_SHIFT 15
#define GFS2_GL_HASH_SIZE (1 << GFS2_GL_HASH_SHIFT)

-struct rhashtable_params ht_parms = {
+static struct rhashtable_params ht_parms = {
.nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4,
.key_len = sizeof(struct lm_lockname),
.key_offset = offsetof(struct gfs2_glock, gl_name),

2015-07-14 13:39:39

by Bob Peterson

[permalink] [raw]
Subject: Re: [PATCH linux-gfs2] GFS2: ht_parms can be static

----- Original Message -----
>
> Signed-off-by: Fengguang Wu <[email protected]>
> ---
> glock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index 813de00..1b0dff4 100644
> --- a/fs/gfs2/glock.c
> +++ b/fs/gfs2/glock.c
> @@ -76,7 +76,7 @@ static DEFINE_SPINLOCK(lru_lock);
> #define GFS2_GL_HASH_SHIFT 15
> #define GFS2_GL_HASH_SIZE (1 << GFS2_GL_HASH_SHIFT)
>
> -struct rhashtable_params ht_parms = {
> +static struct rhashtable_params ht_parms = {
> .nelem_hint = GFS2_GL_HASH_SIZE * 3 / 4,
> .key_len = sizeof(struct lm_lockname),
> .key_offset = offsetof(struct gfs2_glock, gl_name),
>

Hi,

Thanks. Now pushed to the for-next branch of the linux-gfs2 tree.

Regards,

Bob Peterson
Red Hat File Systems