2015-07-27 10:34:22

by Fengguang Wu

[permalink] [raw]
Subject: [linux-next:master 2506/4558] fs/orangefs/pvfs2-sysfs.c:753:5: sparse: symbol 'sysfs_service_op_show' was not declared. Should it be static?

Hi Mike,

First bad commit (maybe != root cause):

tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 83a5f7f22cae24ea602152424bc9026fdc689ae9
commit: 2b651e05251d9f8149c998f6d2ca341ecb05a5aa [2506/4558] Orangefs: kernel client part 7
reproduce:
# apt-get install sparse
git checkout 2b651e05251d9f8149c998f6d2ca341ecb05a5aa
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> fs/orangefs/pvfs2-sysfs.c:753:5: sparse: symbol 'sysfs_service_op_show' was not declared. Should it be static?
>> fs/orangefs/pvfs2-sysfs.c:1026:5: sparse: symbol 'sysfs_service_op_store' was not declared. Should it be static?
--
>> fs/orangefs/pvfs2-mod.c:50:7: sparse: symbol 'DEBUG_LINE' was not declared. Should it be static?
--
>> fs/orangefs/super.c:272:25: sparse: symbol 'pvfs2_s_ops' was not declared. Should it be static?
>> fs/orangefs/super.c:282:15: sparse: symbol 'pvfs2_fh_to_dentry' was not declared. Should it be static?
>> fs/orangefs/super.c:302:5: sparse: symbol 'pvfs2_encode_fh' was not declared. Should it be static?
>> fs/orangefs/super.c:350:5: sparse: symbol 'pvfs2_fill_sb' was not declared. Should it be static?
--
>> fs/orangefs/devpvfs2-req.c:867:13: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/devpvfs2-req.c:867:13: expected void *__pu_val
fs/orangefs/devpvfs2-req.c:867:13: got void [noderef] <asn:1>*
--
>> fs/orangefs/pvfs2-bufmap.c:31:3: sparse: symbol '__pvfs2_bufmap' was not declared. Should it be static?
>> fs/orangefs/pvfs2-bufmap.c:718:36: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:718:36: expected void *from_kaddr
fs/orangefs/pvfs2-bufmap.c:718:36: got void [noderef] <asn:1>*iov_base
fs/orangefs/pvfs2-bufmap.c:724:36: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:724:36: expected void *from_kaddr
fs/orangefs/pvfs2-bufmap.c:724:36: got void [noderef] <asn:1>*iov_base
fs/orangefs/pvfs2-bufmap.c:730:36: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:730:36: expected void *from_kaddr
fs/orangefs/pvfs2-bufmap.c:730:36: got void [noderef] <asn:1>*iov_base
>> fs/orangefs/pvfs2-bufmap.c:940:34: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:940:34: expected void *to_kaddr
fs/orangefs/pvfs2-bufmap.c:940:34: got void [noderef] <asn:1>*iov_base
fs/orangefs/pvfs2-bufmap.c:946:34: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:946:34: expected void *to_kaddr
fs/orangefs/pvfs2-bufmap.c:946:34: got void [noderef] <asn:1>*iov_base
fs/orangefs/pvfs2-bufmap.c:952:34: sparse: incorrect type in assignment (different address spaces)
fs/orangefs/pvfs2-bufmap.c:952:34: expected void *to_kaddr
fs/orangefs/pvfs2-bufmap.c:952:34: got void [noderef] <asn:1>*iov_base
--
>> fs/orangefs/pvfs2-debugfs.c:73:1: sparse: symbol 'orangefs_debug_lock' was not declared. Should it be static?
--
>> fs/orangefs/waitqueue.c:256:6: sparse: context imbalance in 'pvfs2_clean_up_interrupted_operation' - different lock contexts for basic block

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-27 10:34:33

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH linux-next] Orangefs: sysfs_service_op_show() can be static


Signed-off-by: Fengguang Wu <[email protected]>
---
pvfs2-mod.c | 2 +-
pvfs2-sysfs.c | 4 ++--
super.c | 20 ++++++++++----------
3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/orangefs/pvfs2-mod.c b/fs/orangefs/pvfs2-mod.c
index 9cbc992..d74d131 100644
--- a/fs/orangefs/pvfs2-mod.c
+++ b/fs/orangefs/pvfs2-mod.c
@@ -47,7 +47,7 @@ struct client_debug_mask client_debug_mask = { NULL, 0, 0 };
unsigned int kernel_mask_set_mod_init; /* implicitly false */
int op_timeout_secs = PVFS2_DEFAULT_OP_TIMEOUT_SECS;
int slot_timeout_secs = PVFS2_DEFAULT_SLOT_TIMEOUT_SECS;
-__u32 DEBUG_LINE = 50;
+static __u32 DEBUG_LINE = 50;

MODULE_LICENSE("GPL");
MODULE_AUTHOR("PVFS2 Development Team");
diff --git a/fs/orangefs/pvfs2-sysfs.c b/fs/orangefs/pvfs2-sysfs.c
index 6d0e18b..ea635b5 100644
--- a/fs/orangefs/pvfs2-sysfs.c
+++ b/fs/orangefs/pvfs2-sysfs.c
@@ -750,7 +750,7 @@ out:
/*
* obtain attribute values from userspace with a service operation.
*/
-int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
+static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
{
struct pvfs2_kernel_op_s *new_op = NULL;
int rc = 0;
@@ -1023,7 +1023,7 @@ static ssize_t
* We want to return 1 if we think everything went OK, and
* EINVAL if not.
*/
-int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
+static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
{
struct pvfs2_kernel_op_s *new_op = NULL;
int val = 0;
diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index a854390..c5665aa 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -269,7 +269,7 @@ static void pvfs2_dirty_inode(struct inode *inode, int flags)
SetAtimeFlag(pvfs2_inode);
}

-struct super_operations pvfs2_s_ops = {
+static struct super_operations pvfs2_s_ops = {
.alloc_inode = pvfs2_alloc_inode,
.destroy_inode = pvfs2_destroy_inode,
.dirty_inode = pvfs2_dirty_inode,
@@ -279,10 +279,10 @@ struct super_operations pvfs2_s_ops = {
.show_options = generic_show_options,
};

-struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
- struct fid *fid,
- int fh_len,
- int fh_type)
+static struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
+ struct fid *fid,
+ int fh_len,
+ int fh_type)
{
struct pvfs2_object_kref refn;

@@ -299,10 +299,10 @@ struct dentry *pvfs2_fh_to_dentry(struct super_block *sb,
return d_obtain_alias(pvfs2_iget(sb, &refn));
}

-int pvfs2_encode_fh(struct inode *inode,
- __u32 *fh,
- int *max_len,
- struct inode *parent)
+static int pvfs2_encode_fh(struct inode *inode,
+ __u32 *fh,
+ int *max_len,
+ struct inode *parent)
{
int len = parent ? 10 : 5;
int type = 1;
@@ -347,7 +347,7 @@ static struct export_operations pvfs2_export_ops = {
.fh_to_dentry = pvfs2_fh_to_dentry,
};

-int pvfs2_fill_sb(struct super_block *sb, void *data, int silent)
+static int pvfs2_fill_sb(struct super_block *sb, void *data, int silent)
{
int ret = -EINVAL;
struct inode *root = NULL;

2015-07-29 14:53:53

by Mike Marshall

[permalink] [raw]
Subject: Re: [linux-next:master 2506/4558] fs/orangefs/pvfs2-sysfs.c:753:5: sparse: symbol 'sysfs_service_op_show' was not declared. Should it be static?

I have fixed most of the sparse complaints and posted the patch.

I use "git send-email" and have tried to tie the addendums to the
original patch set with the message-id in "In-Reply-To:" and "References:"
message headers... if "fold the followup patch" means something different,
please let me know <g>...

-Mike

On Mon, Jul 27, 2015 at 6:33 AM, kbuild test robot
<[email protected]> wrote:
> Hi Mike,
>
> First bad commit (maybe != root cause):
>
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 83a5f7f22cae24ea602152424bc9026fdc689ae9
> commit: 2b651e05251d9f8149c998f6d2ca341ecb05a5aa [2506/4558] Orangefs: kernel client part 7
> reproduce:
> # apt-get install sparse
> git checkout 2b651e05251d9f8149c998f6d2ca341ecb05a5aa
> make ARCH=x86_64 allmodconfig
> make C=1 CF=-D__CHECK_ENDIAN__
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> fs/orangefs/pvfs2-sysfs.c:753:5: sparse: symbol 'sysfs_service_op_show' was not declared. Should it be static?
>>> fs/orangefs/pvfs2-sysfs.c:1026:5: sparse: symbol 'sysfs_service_op_store' was not declared. Should it be static?
> --
>>> fs/orangefs/pvfs2-mod.c:50:7: sparse: symbol 'DEBUG_LINE' was not declared. Should it be static?
> --
>>> fs/orangefs/super.c:272:25: sparse: symbol 'pvfs2_s_ops' was not declared. Should it be static?
>>> fs/orangefs/super.c:282:15: sparse: symbol 'pvfs2_fh_to_dentry' was not declared. Should it be static?
>>> fs/orangefs/super.c:302:5: sparse: symbol 'pvfs2_encode_fh' was not declared. Should it be static?
>>> fs/orangefs/super.c:350:5: sparse: symbol 'pvfs2_fill_sb' was not declared. Should it be static?
> --
>>> fs/orangefs/devpvfs2-req.c:867:13: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/devpvfs2-req.c:867:13: expected void *__pu_val
> fs/orangefs/devpvfs2-req.c:867:13: got void [noderef] <asn:1>*
> --
>>> fs/orangefs/pvfs2-bufmap.c:31:3: sparse: symbol '__pvfs2_bufmap' was not declared. Should it be static?
>>> fs/orangefs/pvfs2-bufmap.c:718:36: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:718:36: expected void *from_kaddr
> fs/orangefs/pvfs2-bufmap.c:718:36: got void [noderef] <asn:1>*iov_base
> fs/orangefs/pvfs2-bufmap.c:724:36: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:724:36: expected void *from_kaddr
> fs/orangefs/pvfs2-bufmap.c:724:36: got void [noderef] <asn:1>*iov_base
> fs/orangefs/pvfs2-bufmap.c:730:36: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:730:36: expected void *from_kaddr
> fs/orangefs/pvfs2-bufmap.c:730:36: got void [noderef] <asn:1>*iov_base
>>> fs/orangefs/pvfs2-bufmap.c:940:34: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:940:34: expected void *to_kaddr
> fs/orangefs/pvfs2-bufmap.c:940:34: got void [noderef] <asn:1>*iov_base
> fs/orangefs/pvfs2-bufmap.c:946:34: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:946:34: expected void *to_kaddr
> fs/orangefs/pvfs2-bufmap.c:946:34: got void [noderef] <asn:1>*iov_base
> fs/orangefs/pvfs2-bufmap.c:952:34: sparse: incorrect type in assignment (different address spaces)
> fs/orangefs/pvfs2-bufmap.c:952:34: expected void *to_kaddr
> fs/orangefs/pvfs2-bufmap.c:952:34: got void [noderef] <asn:1>*iov_base
> --
>>> fs/orangefs/pvfs2-debugfs.c:73:1: sparse: symbol 'orangefs_debug_lock' was not declared. Should it be static?
> --
>>> fs/orangefs/waitqueue.c:256:6: sparse: context imbalance in 'pvfs2_clean_up_interrupted_operation' - different lock contexts for basic block
>
> 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