Re: [PATCH v2 15/20] fsnotify: make fsnotify_recalc_mask() unaware of object type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amir,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v4.16]
[cannot apply to linus/master next-20180405]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Amir-Goldstein/fanotify-super-block-mark/20180406-132931
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   fs/notify/mark.c:94:19: sparse: symbol 'fsnotify_mark_connector_cachep' was not declared. Should it be static?
>> fs/notify/mark.c:114:51: sparse: incorrect type in initializer (different address spaces) @@    expected struct fsnotify_mark_connector *conn @@    got struct fsnotify_mstruct fsnotify_mark_connector *conn @@
   fs/notify/mark.c:114:51:    expected struct fsnotify_mark_connector *conn
   fs/notify/mark.c:114:51:    got struct fsnotify_mark_connector [noderef] <asn:4>*marks
   fs/notify/mark.c:147:51: sparse: incorrect type in initializer (different address spaces) @@    expected struct fsnotify_mark_connector *conn @@    got struct fsnotify_mstruct fsnotify_mark_connector *conn @@
   fs/notify/mark.c:147:51:    expected struct fsnotify_mark_connector *conn
   fs/notify/mark.c:147:51:    got struct fsnotify_mark_connector [noderef] <asn:4>*marks
   fs/notify/mark.c:472:13: sparse: incorrect type in initializer (different address spaces) @@    expected struct fsnotify_mark_connector [noderef] <asn:4>*__new @@    got  fsnotify_mark_connector [noderef] <asn:4>*__new @@
   fs/notify/mark.c:472:13:    expected struct fsnotify_mark_connector [noderef] <asn:4>*__new
   fs/notify/mark.c:472:13:    got struct fsnotify_mark_connector *[assigned] conn
   fs/notify/mark.c:237:9: sparse: context imbalance in 'fsnotify_put_mark' - unexpected unlock
   fs/notify/mark.c:323:25: sparse: context imbalance in 'fsnotify_prepare_user_wait' - unexpected unlock
   fs/notify/mark.c:338:9: sparse: context imbalance in 'fsnotify_finish_user_wait' - wrong count at exit
   fs/notify/mark.c:488:39: sparse: context imbalance in 'fsnotify_grab_connector' - different lock contexts for basic block
   fs/notify/mark.c:567:20: sparse: context imbalance in 'fsnotify_add_mark_list' - unexpected unlock
   fs/notify/mark.c:649:25: sparse: context imbalance in 'fsnotify_find_mark' - unexpected unlock
   fs/notify/mark.c:721:17: sparse: context imbalance in 'fsnotify_destroy_marks' - unexpected unlock

vim +114 fs/notify/mark.c

    92	
    93	struct srcu_struct fsnotify_mark_srcu;
  > 94	struct kmem_cache *fsnotify_mark_connector_cachep;
    95	
    96	static DEFINE_SPINLOCK(destroy_lock);
    97	static LIST_HEAD(destroy_list);
    98	static struct fsnotify_mark_connector *connector_destroy_list;
    99	
   100	static void fsnotify_mark_destroy_workfn(struct work_struct *work);
   101	static DECLARE_DELAYED_WORK(reaper_work, fsnotify_mark_destroy_workfn);
   102	
   103	static void fsnotify_connector_destroy_workfn(struct work_struct *work);
   104	static DECLARE_WORK(connector_reaper_work, fsnotify_connector_destroy_workfn);
   105	
   106	void fsnotify_get_mark(struct fsnotify_mark *mark)
   107	{
   108		WARN_ON_ONCE(!refcount_read(&mark->refcnt));
   109		refcount_inc(&mark->refcnt);
   110	}
   111	
   112	static void __fsnotify_recalc_mask(struct fsnotify_obj *obj)
   113	{
 > 114		struct fsnotify_mark_connector *conn = obj->marks;
   115		u32 new_mask = 0;
   116		struct fsnotify_mark *mark;
   117	
   118		assert_spin_locked(&conn->lock);
   119		hlist_for_each_entry(mark, &conn->list, obj_list) {
   120			if (mark->flags & FSNOTIFY_MARK_FLAG_ATTACHED)
   121				new_mask |= mark->mask;
   122		}
   123		obj->mask = new_mask;
   124	}
   125	

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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux