[Drbd-dev] drbd sparse warnings

Randy Dunlap rdunlap at xenotime.net
Thu May 27 04:04:03 CEST 2010


Hi,

When I build a Linux kernel with "make C=1" to invoke sparse,
I see 135 sparse warnings like (shorter list):


linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:931:39: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1212:69: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1213:70: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1214:59: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1215:60: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1216:63: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1217:65: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1218:66: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1376:75: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1377:50: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1378:51: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1435:91: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1437:74: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_int.h:1498:61: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_bitmap.c:751:98: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_bitmap.c:815:50: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_bitmap.c:876:42: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_receiver.c:341:54: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_receiver.c:1116:81: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_receiver.c:1356:79: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_actlog.c:547:69: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_main.c:3498:60: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_main.c:3506:63: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_main.c:3714:59: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_nl.c:513:94: error: attribute 'require_context': unknown attribute
linux-2.6.34-git11/drivers/block/drbd/drbd_nl.c:701:77: error: attribute 'require_context': unknown attribute


What is the meaning and usage of require_context in drbd_int.h?

#ifdef __CHECKER__
# define __protected_by(x)       __attribute__((require_context(x,1,999,"rdwr")))
# define __protected_read_by(x)  __attribute__((require_context(x,1,999,"read")))
# define __protected_write_by(x) __attribute__((require_context(x,1,999,"write")))
# define __must_hold(x)       __attribute__((context(x,1,1), require_context(x,1,999,"call")))
#else
# define __protected_by(x)
# define __protected_read_by(x)
# define __protected_write_by(x)
# define __must_hold(x)
#endif


thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


More information about the drbd-dev mailing list