Skip to content

Commit

Permalink
ceph: fix symbol versioning for ceph_monc_do_statfs
Browse files Browse the repository at this point in the history
The genksyms helper in the kernel cannot parse a type definition
like "typeof(((type *)0)->keyfld)" that is used in the DEFINE_RB_FUNCS
helper, causing the following EXPORT_SYMBOL() statement to be ignored
when computing the crcs, and triggering a warning about this:

WARNING: "ceph_monc_do_statfs" [fs/ceph/ceph.ko] has no CRC

To work around the problem, we can rewrite the type to reference
an undefined 'extern' symbol instead of a NULL pointer. This is
evidently ok for genksyms, and it no longer complains about the
line when calling it with 'genksyms -w'.

I've looked briefly into extending genksyms instead, but it seems
really hard to do. Jan Beulich introduced basic support for 'typeof'
a while ago in dc53324 ("genksyms: fix typeof() handling"),
but that is not sufficient for the expression we have here.

Signed-off-by: Arnd Bergmann <[email protected]>
Fixes: fcd00b6 ("libceph: DEFINE_RB_FUNCS macro")
Cc: Jan Beulich <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
arndb authored and idryomov committed Jul 28, 2016
1 parent 955818c commit a0f2b65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/ceph/libceph.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ static void erase_##name(struct rb_root *root, type *t) \
}

#define DEFINE_RB_LOOKUP_FUNC(name, type, keyfld, nodefld) \
extern type __lookup_##name##_key; \
static type *lookup_##name(struct rb_root *root, \
typeof(((type *)0)->keyfld) key) \
typeof(__lookup_##name##_key.keyfld) key) \
{ \
struct rb_node *n = root->rb_node; \
\
Expand Down

0 comments on commit a0f2b65

Please sign in to comment.