Lock warning cleanups
Subsystems (20)
cover Lock warning cleanups
This patch series adds missing annotations to various functions, that register warnings of context imbalance when built with Sparse tool. The adds fix the warnings, improve on readability odf the code and give better insight or directive on what the functions are actually doing.
Jules Irenge (30):
btrfs: Add missing annotation for release_extent_buffer()
dax: Add missing annotations ofr dax_read_lock() and dax_read_unlock()
xfs: Add missing annotation to xfs_ail_check()
sctp: Add missing annotation for sctp_err_finish()
sctp: Add missing annotation for sctp_transport_walk_start()
sctp: Add missing annotation for sctp_transport_walk_stop()
net: Add missing annotation for llc_seq_start()
netrom: Add missing annotation for nr_info_start()
netrom: Add missing annotation for nr_info_stop()
net: netrom: Add missing annotation for nr_node_start()
net: netrom: Add missing annotation for nr_node_stop()
net: netrom: Add missing annotation for nr_neigh_start()
net: netrom: Add missing annotation for nr_neigh_stop()
dccp: Add missing annotation for dccp_child_process()
af_unix: Add missing annotation for unix_wait_for_peer()
proc: Add missing annotation for close_pdeo()
mm/zsmalloc: Add missing annotation for zs_map_object() mm/zsmalloc: Add missing annotation for zs_unmap_object() mm/zsmalloc: Add missing annotation for migrate_write_lock() mm/zsmalloc: Add missing annotation for migrate_write_unlock()
scsi: csiostor: Add missing annotation for csio_scsi_cleanup_io_q()
ACPI: OSL: Add missing annotation for acpi_os_acquire_lock()
ACPI: OSL: Add missing annotation for acpi_os_release_lock()
dmaengine: mic_x100_dma: Add missing annotation for
mic_dma_tx_submit_unlock()
zram: Add missing annotatin for zram_slot_lock()
zram: Add missing annotatin for zram_slot_unlock()
habanalabs: Add missing annotation for goya_hw_queues_lock()
habanalabs: Add missing annotation for goya_hw_queues_unlock()
sgi-xp: Add missing annotation for xpc_disconnect_channel()
sgi-xp: Add missing annotation for ocfs2_inode_cache_lock() and
ocfs2_inode_cache_unlock()
drivers/acpi/osl.c | 2 ++ drivers/block/zram/zram_drv.c | 2 ++ drivers/dax/super.c | 4 ++-- drivers/dma/mic_x100_dma.c | 1 + drivers/misc/habanalabs/goya/goya.c | 2 ++ drivers/misc/sgi-xp/xpc_channel.c | 1 + drivers/scsi/csiostor/csio_scsi.c | 1 + fs/btrfs/extent_io.c | 1 + fs/ocfs2/inode.c | 2 ++ fs/proc/inode.c | 1 + fs/xfs/xfs_trans_ail.c | 1 + mm/zsmalloc.c | 4 ++++ net/dccp/minisocks.c | 1 + net/llc/llc_proc.c | 2 +- net/netrom/af_netrom.c | 2 ++ net/netrom/nr_route.c | 4 ++++ net/sctp/input.c | 1 + net/sctp/socket.c | 4 ++-- net/unix/af_unix.c | 1 + 19 files changed, 32 insertions(+), 5 deletions(-)
Signature · 1 line
2.24.1
PATCH 1/30 btrfs: Add missing annotation for release_extent_buffer()
Sparse reports a warning at release_extent_buffer()
warning: context imbalance in release_extent_buffer() - unexpected unlock
The root cause is the missing annotation at release_extent_buffer() Add the missing __releases(&eb->refs_lock) annotation
--- fs/btrfs/extent_io.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/extent_io.c +1 -0
@@ -5230,6 +5230,7 @@ static inline void btrfs_release_extent_buffer_rcu(struct rcu_head *head) }static int release_extent_buffer (struct extent_buffer *eb) + __releases(&eb->refs_lock) {lockdep_assert_held (&eb->refs_lock);
Signature · 1 line
2.24.1
Re: [PATCH 01/30] btrfs: Add missing annotation for release_extent_buffer()
Quoted 7 lines · Jules Irenge
Sparse reports a warning at
release_extent_buffer()
warning: context imbalance inrelease_extent_buffer()- unexpected unlockThe root cause is the missing annotation at
release_extent_buffer()Add the missing__releases(&eb->refs_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Re: [PATCH 01/30] btrfs: Add missing annotation for release_extent_buffer()
In reply to Jules IrengeQuoted 7 lines · Jules Irenge
Sparse reports a warning at
release_extent_buffer()
warning: context imbalance inrelease_extent_buffer()- unexpected unlockThe root cause is the missing annotation at
release_extent_buffer()Add the missing__releases(&eb->refs_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Added to misc-next, thanks.
PATCH 2/30 dax: Add missing annotations ofr dax_read_lock() and dax_read_unlock()
In reply to Jules IrengeSparse reports warning at dax_read_lock() and at dax_read_unlock()
warning: context imbalance in dax_read_lock() - wrong count at exit
warning: context imbalance in dax_read_unlock() - unexpected unlock
The root cause is the mnissing annotations at dax_read_lock()
and dax_read_unlock()
Add the missing __acquires(&dax_srcu) notations to dax_read_lock() Add the missing __releases(&dax_srcu) annotation to dax_read_unlock()
--- drivers/dax/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dax/super.c +2 -2
@@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly;static struct hlist_head dax_host_list[DAX_HASH_SIZE ];static DEFINE_SPINLOCK (dax_host_lock); -int dax_read_lock (void ) +int dax_read_lock(void) __acquires(&dax_srcu) {return srcu_read_lock (&dax_srcu); }EXPORT_SYMBOL_GPL (dax_read_lock); -void dax_read_unlock (int id) +void dax_read_unlock(int id) __releases(&dax_srcu) {srcu_read_unlock (&dax_srcu, id); }
Signature · 4 lines
2.24.1 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Re: [PATCH 02/30] dax: Add missing annotations ofr dax_read_lock() and dax_read_unlock()
Quoted 7 lines · Jules Irenge
Sparse reports warning at
dax_read_lock()and atdax_read_unlock()warning: context imbalance in
dax_read_lock()- wrong count at exit
warning: context imbalance indax_read_unlock()- unexpected unlockThe root cause is the mnissing annotations at
dax_read_lock()
anddax_read_unlock()
s/mnissing/missing
Quoted 28 lines
Add the missing
__acquires(&dax_srcu)notations todax_read_lock()Add the missing__releases(&dax_srcu)annotation todax_read_unlock()Signed-off-by Jules Irenge <[email protected]>--- drivers/dax/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/dax/super.c +2
-2@@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly;static struct hlist_head dax_host_list[DAX_HASH_SIZE ];static DEFINE_SPINLOCK (dax_host_lock); -int dax_read_lock (void ) +int dax_read_lock(void) __acquires(&dax_srcu) {return srcu_read_lock (&dax_srcu); }EXPORT_SYMBOL_GPL (dax_read_lock); -void dax_read_unlock (int id) +void dax_read_unlock(int id) __releases(&dax_srcu) {srcu_read_unlock (&dax_srcu, id); }
PATCH 3/30 xfs: Add missing annotation to xfs_ail_check()
In reply to Jules IrengeSparse reports a warning at xfs_ail_check()
warning: context imbalance in xfs_ail_check() - unexpected unlock
The root cause is the missing annotation at xfs_ail_check()
Add the missing __must_hold(&ailp->ail_lock) annotation
--- fs/xfs/xfs_trans_ail.c | 1 + 1 file changed, 1 insertion(+)
fs/xfs/xfs_trans_ail.c +1 -0
@@ -32,6 +32,7 @@ STATIC voidxfs_ail_check ( struct xfs_ail *ailp, struct xfs_log_item *lip) + __must_hold(&ailp->ail_lock) { struct xfs_log_item *prev_lip;struct xfs_log_item *next_lip;
Signature · 1 line
2.24.1
Re: [PATCH 03/30] xfs: Add missing annotation to xfs_ail_check()
Quoted 9 lines · Jules Irenge
Sparse reports a warning at
xfs_ail_check()warning: context imbalance in
xfs_ail_check()- unexpected unlockThe root cause is the missing annotation at
xfs_ail_check()Add the missing
__must_hold(&ailp->ail_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Seems reasonable, though I'm wondering if this is a treewide change you seek to apply yourself, or merely a large patch series to merge through the individual subsystem maintainers?
--D
Quoted 19 lines
--- fs/xfs/xfs_trans_ail.c | 1 + 1 file changed, 1 insertion(+)fs/xfs/xfs_trans_ail.c +1
-0@@ -32,6 +32,7 @@ STATIC voidxfs_ail_check ( struct xfs_ail *ailp, struct xfs_log_item *lip) + __must_hold(&ailp->ail_lock) { struct xfs_log_item *prev_lip;struct xfs_log_item *next_lip;Signature · 1 line
2.24.1
PATCH 4/30 sctp: Add missing annotation for sctp_err_finish()
In reply to Jules IrengeSparse reports a warning at sctp_err_finish()
warning: context imbalance in sctp_err_finish() - unexpected unlock
The root cause is a missing annotation at sctp_err_finish() Add the missing __releases(&((__sk)->sk_lock.slock)) annotation
--- net/sctp/input.c | 1 + 1 file changed, 1 insertion(+)
net/sctp/input.c +1 -0
@@ -548,6 +548,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,/* Common cleanup code for icmp/icmpv6 error handler. */ void sctp_err_finish (struct sock *sk,struct sctp_transport *t) + __releases(&((__sk)->sk_lock.slock)) {bh_unlock_sock (sk);sctp_transport_put (t);
Signature · 1 line
2.24.1
Re: [PATCH 04/30] sctp: Add missing annotation for sctp_err_finish()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:45 +0000
Quoted 7 lines
Sparse reports a warning at
sctp_err_finish()
warning: context imbalance insctp_err_finish()- unexpected unlockThe root cause is a missing annotation at
sctp_err_finish()Add the missing __releases(&((__sk)->sk_lock.slock)) annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 5/30 sctp: Add missing annotation for sctp_transport_walk_start()
In reply to Jules IrengeSparse reports a warning at sctp_transport_walk_start()
warning: context imbalance in sctp_transport_walk_start
- wrong count at exit
The root cause is the missing annotation at sctp_transport_walk_start() Add the missing __acquires(RCU) annotation
--- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -1
@@ -5333,7 +5333,7 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc,EXPORT_SYMBOL_GPL (sctp_get_sctp_info);/* use callback to avoid exporting the core structure */ -void sctp_transport_walk_start (struct rhashtable_iter *iter) +void sctp_transport_walk_start (struct rhashtable_iter *iter)__acquires (RCU ) {rhltable_walk_enter (&sctp_transport_hashtable, iter);
Signature · 1 line
2.24.1
Re: [PATCH 05/30] sctp: Add missing annotation for sctp_transport_walk_start()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:46 +0000
Quoted 9 lines
Sparse reports a warning at
sctp_transport_walk_start()warning: context imbalance in
sctp_transport_walk_start
- wrong count at exitThe root cause is the missing annotation at
sctp_transport_walk_start()Add the missing__acquires(RCU)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 6/30 sctp: Add missing annotation for sctp_transport_walk_stop()
In reply to Jules IrengeSparse reports a warning at sctp_transport_walk_stop()
warning: context imbalance in sctp_transport_walk_stop
- wrong count at exit
The root cause is the missing annotation at sctp_transport_walk_stop() Add the missing __releases(RCU) annotation
--- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -1
@@ -5340,7 +5340,7 @@ void sctp_transport_walk_start(struct rhashtable_iter *iter) __acquires(RCU)rhashtable_walk_start (iter); } -void sctp_transport_walk_stop (struct rhashtable_iter *iter) +void sctp_transport_walk_stop (struct rhashtable_iter *iter)__releases (RCU ) {rhashtable_walk_stop (iter);rhashtable_walk_exit (iter);
Signature · 1 line
2.24.1
Re: [PATCH 06/30] sctp: Add missing annotation for sctp_transport_walk_stop()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:47 +0000
Quoted 9 lines
Sparse reports a warning at
sctp_transport_walk_stop()warning: context imbalance in
sctp_transport_walk_stop
- wrong count at exitThe root cause is the missing annotation at
sctp_transport_walk_stop()Add the missing__releases(RCU)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 7/30 net: Add missing annotation for llc_seq_start()
In reply to Jules IrengeSparse reports a warning at llc_seq_start()
warning: context imbalance in llc_seq_start() - wrong count at exit The root cause is the msiing annotation at llc_seq_start()
Add the missing __acquires(RCU) annotation
--- net/llc/llc_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/llc/llc_proc.c +1 -1
@@ -56,7 +56,7 @@ static struct sock *llc_get_sk_idx(loff_t pos)return sk; } -static void *llc_seq_start (struct seq_file *seq,loff_t *pos) +static void *llc_seq_start (struct seq_file *seq,loff_t *pos)__acquires (RCU ) {loff_t l = *pos;
Signature · 1 line
2.24.1
Re: [PATCH 07/30] net: Add missing annotation for llc_seq_start()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:48 +0000
Quoted 8 lines
Sparse reports a warning at
llc_seq_start()warning: context imbalance in
llc_seq_start()- wrong count at exit The root cause is the msiing annotation atllc_seq_start()Add the missing
__acquires(RCU)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 8/30 netrom: Add missing annotation for nr_info_start()
In reply to Jules IrengeSparse reports a warning at nr_info_start()
warning: context imbalance in nr_info_start() - wrong count at exit The root cause is the missing annotation at nr_info_start() Add the missing __acquires(&nr_list_lock)
--- net/netrom/af_netrom.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/af_netrom.c +1 -0
@@ -1230,6 +1230,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)#ifdef CONFIG_PROC_FS static void *nr_info_start (struct seq_file *seq,loff_t *pos) + __acquires(&nr_list_lock) {spin_lock_bh (&nr_list_lock);return seq_hlist_start_head (&nr_list, *pos);
Signature · 1 line
2.24.1
Re: [PATCH 08/30] netrom: Add missing annotation for nr_info_start()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:49 +0000
Quoted 6 lines
Sparse reports a warning at
nr_info_start()
warning: context imbalance innr_info_start()- wrong count at exit The root cause is the missing annotation atnr_info_start()Add the missing__acquires(&nr_list_lock)Signed-off-by Jules Irenge <[email protected]>
Applied.
PATCH 9/30 netrom: Add missing annotation for nr_info_stop()
In reply to Jules IrengeSparse reports a warning at nr_info_stop()
warning: context imbalance in nr_info_stop() - unexpected unlock The root cause is the missing annotation at nr_info_stop() Add the missing __releases(&nr_list_lock)
--- net/netrom/af_netrom.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/af_netrom.c +1 -0
@@ -1242,6 +1242,7 @@ static void *nr_info_next(struct seq_file *seq, void *v, loff_t *pos) }static void nr_info_stop (struct seq_file *seq,void *v) + __releases(&nr_list_lock) {spin_unlock_bh (&nr_list_lock); }
Signature · 1 line
2.24.1
Re: [PATCH 09/30] netrom: Add missing annotation for nr_info_stop()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:50 +0000
Quoted 6 lines
Sparse reports a warning at
nr_info_stop()
warning: context imbalance innr_info_stop()- unexpected unlock The root cause is the missing annotation atnr_info_stop()Add the missing__releases(&nr_list_lock)Signed-off-by Jules Irenge <[email protected]>
Applied.
PATCH 10/30 net: netrom: Add missing annotation for nr_node_start()
In reply to Jules IrengeSparse reports a warning at nr_node_start()
warning: context imbalance in nr_node_start() - wrong count at exit The root cause is the missing annotation at nr_node_start() Add the missing __acquires(&nr_node_list_lock) annotation
--- net/netrom/nr_route.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/nr_route.c +1 -0
@@ -838,6 +838,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)#ifdef CONFIG_PROC_FS static void *nr_node_start (struct seq_file *seq,loff_t *pos) + __acquires(&nr_node_list_lock) {spin_lock_bh (&nr_node_list_lock);return seq_hlist_start_head (&nr_node_list, *pos);
Signature · 1 line
2.24.1
Re: [PATCH 10/30] net: netrom: Add missing annotation for nr_node_start()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:51 +0000
Quoted 6 lines
Sparse reports a warning at
nr_node_start()
warning: context imbalance innr_node_start()- wrong count at exit The root cause is the missing annotation atnr_node_start()Add the missing__acquires(&nr_node_list_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 11/30 net: netrom: Add missing annotation for nr_node_stop()
In reply to Jules IrengeSparse reports a warning at nr_node_stop()
warning: context imbalance in nr_node_stop() - wrong count at exit The root cause is the missing annotation at nr_node_stop() Add the missing __releases(&nr_node_list_lock) annotation
--- net/netrom/nr_route.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/nr_route.c +1 -0
@@ -850,6 +850,7 @@ static void *nr_node_next(struct seq_file *seq, void *v, loff_t *pos) }static void nr_node_stop (struct seq_file *seq,void *v) + __releases(&nr_node_list_lock) {spin_unlock_bh (&nr_node_list_lock); }
Signature · 1 line
2.24.1
Re: [PATCH 11/30] net: netrom: Add missing annotation for nr_node_stop()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:52 +0000
Quoted 6 lines
Sparse reports a warning at
nr_node_stop()
warning: context imbalance innr_node_stop()- wrong count at exit The root cause is the missing annotation atnr_node_stop()Add the missing__releases(&nr_node_list_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 12/30 net: netrom: Add missing annotation for nr_neigh_start()
In reply to Jules IrengeSparse reports a warning at nr_neigh_start()
warning: context imbalance in nr_neigh_start() - wrong count at exit The root cause is the missing annotation at nr_neigh_start() Add the missing __acquires(&nr_neigh_list_lock) annotation
--- net/netrom/nr_route.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/nr_route.c +1 -0
@@ -895,6 +895,7 @@ const struct seq_operations nr_node_seqops = { };static void *nr_neigh_start (struct seq_file *seq,loff_t *pos) + __acquires(&nr_neigh_list_lock) {spin_lock_bh (&nr_neigh_list_lock);return seq_hlist_start_head (&nr_neigh_list, *pos);
Signature · 1 line
2.24.1
Re: [PATCH 12/30] net: netrom: Add missing annotation for nr_neigh_start()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:53 +0000
Quoted 6 lines
Sparse reports a warning at
nr_neigh_start()
warning: context imbalance innr_neigh_start()- wrong count at exit The root cause is the missing annotation atnr_neigh_start()Add the missing__acquires(&nr_neigh_list_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 13/30 net: netrom: Add missing annotation for nr_neigh_stop()
In reply to Jules IrengeSparse reports a warning at nr_neigh_stop()
warning: context imbalance in nr_neigh_stop() - unexpected unlock The root cause is the missing annotation at nr_neigh_stop() Add the missing __releases(&nr_neigh_list_lock) annotation
--- net/netrom/nr_route.c | 1 + 1 file changed, 1 insertion(+)
net/netrom/nr_route.c +1 -0
@@ -907,6 +907,7 @@ static void *nr_neigh_next(struct seq_file *seq, void *v, loff_t *pos) }static void nr_neigh_stop (struct seq_file *seq,void *v) + __releases(&nr_neigh_list_lock) {spin_unlock_bh (&nr_neigh_list_lock); }
Signature · 1 line
2.24.1
Re: [PATCH 13/30] net: netrom: Add missing annotation for nr_neigh_stop()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:54 +0000
Quoted 6 lines
Sparse reports a warning at
nr_neigh_stop()
warning: context imbalance innr_neigh_stop()- unexpected unlock The root cause is the missing annotation atnr_neigh_stop()Add the missing__releases(&nr_neigh_list_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Applied.
PATCH 15/30 af_unix: Add missing annotation for unix_wait_for_peer()
In reply to Jules IrengeSparse reports a warning unix_wait_for_peer()
warning: context imbalance in unix_wait_for_peer() - unexpected unlock
The root cause is the missing annotation at unix_wait_for_peer() Add the missing annotation __releases(&unix_sk(other)->lock)
--- net/unix/af_unix.c | 1 + 1 file changed, 1 insertion(+)
net/unix/af_unix.c +1 -0
@@ -1207,6 +1207,7 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr, }static long unix_wait_for_peer (struct sock *other,long timeo) + __releases(&unix_sk(other)->lock) {struct unix_sock *u =unix_sk (other);int sched;
Signature · 1 line
2.24.1
Re: [PATCH 15/30] af_unix: Add missing annotation for unix_wait_for_peer()
From: Jules Irenge <[email protected]>
Date: Sun, 23 Feb 2020 23:16:56 +0000
Quoted 8 lines
Sparse reports a warning
unix_wait_for_peer()warning: context imbalance in
unix_wait_for_peer()- unexpected unlockThe root cause is the missing annotation at
unix_wait_for_peer()Add the missing annotation __releases(&unix_sk(other)->lock)Signed-off-by Jules Irenge <[email protected]>
Applied.
PATCH 16/30 proc: Add missing annotation for close_pdeo()
In reply to Jules IrengeSparse reports a warning at close_pdeo()
warning: context imbalance in close_pdeo() - unexpected unlock The root cause is the missing annotation at close_pdeo() Add the missing __releases(&pde->pde_unload_lock) annotation
--- fs/proc/inode.c | 1 + 1 file changed, 1 insertion(+)
fs/proc/inode.c +1 -0
@@ -139,6 +139,7 @@ static void unuse_pde(struct proc_dir_entry *pde)/* pde is locked on entry, unlocked on exit */ static void close_pdeo (struct proc_dir_entry *pde,struct pde_opener *pdeo) + __releases(&pde->pde_unload_lock) {/* * close() (proc_reg_release()) can't delete an entry and proceed:
Signature · 1 line
2.24.1
PATCH 17/30 mm/zsmalloc: Add missing annotation for zs_map_object()
In reply to Jules IrengeSparse reports a warning at zs_map_object() context imbalance in zs_map_object() - wrong count at exit The root cause is the missing annotation at zs_map_object() Add the missing __acquires(zspage)
--- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+)
mm/zsmalloc.c +1 -0
@@ -1290,6 +1290,7 @@ EXPORT_SYMBOL_GPL(zs_get_total_pages);*/ void *zs_map_object (struct zs_pool *pool,unsigned long handle,enum zs_mapmode mm) +__acquires (zspage) {struct zspage *zspage;struct page *page;
Signature · 1 line
2.24.1
PATCH 18/30 mm/zsmalloc: Add missing annotation for zs_unmap_object()
In reply to Jules IrengeSparse reports a warning at zs_unmap_object() context imbalance in zs_unmap_object() - unexpected unlock The root cause is the missing annotation at zs_unmap_object() Add the missing __releases(zspage)
--- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+)
mm/zsmalloc.c +1 -0
@@ -1349,6 +1349,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,EXPORT_SYMBOL_GPL (zs_map_object);void zs_unmap_object (struct zs_pool *pool,unsigned long handle) +__releases (zspage) {struct zspage *zspage;struct page *page;
Signature · 1 line
2.24.1
PATCH 19/30 mm/zsmalloc: Add missing annotation for migrate_write_lock()
In reply to Jules IrengeSparse reports a warning at migrate_write_lock()
warning: context imbalance in migrate_write_lock() - wrong count at exit The root cause is the missing annotation at migrate_write_lock() Add the missing __acquires(&zspage->lock)
--- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+)
mm/zsmalloc.c +1 -0
@@ -1846,6 +1846,7 @@ static void migrate_read_unlock(struct zspage *zspage) __releases(&zspage->lock) }static void migrate_write_lock (struct zspage *zspage) + __acquires(&zspage->lock) {write_lock (&zspage->lock); }
Signature · 1 line
2.24.1
PATCH 20/30 mm/zsmalloc: Add missing annotation for migrate_write_unlock()
In reply to Jules IrengeSparse reports a warning at migrate_write_unlock()
warning: context imbalance in migrate_write_unlock() - unexpected unlock The root cause is the missing annotation at migrate_write_unlock() Add the missing __releases(&zspage->lock)
--- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+)
mm/zsmalloc.c +1 -0
@@ -1852,6 +1852,7 @@ static void migrate_write_lock(struct zspage *zspage) }static void migrate_write_unlock (struct zspage *zspage) + __releases(&zspage->lock) {write_unlock (&zspage->lock); }
Signature · 1 line
2.24.1
PATCH 21/30 scsi: csiostor: Add missing annotation for csio_scsi_cleanup_io_q()
In reply to Jules IrengeSparse reports a warning at csio_scsi_cleanup_io_q()
warning: context imbalance in csio_scsi_cleanup_io_q() - unexpected unlock
The root cause is the missing annotation at csio_scsi_cleanup_io_q() Add the missing __must_hold(&hw->lock)
--- drivers/scsi/csiostor/csio_scsi.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/csiostor/csio_scsi.c +1 -0
@@ -1157,6 +1157,7 @@ csio_scsi_cmpl_handler(struct csio_hw *hw, void *wr, uint32_t len,*/ void csio_scsi_cleanup_io_q (struct csio_scsim *scm,struct list_head *q) + __must_hold(&hw->lock) {struct csio_hw *hw = scm->hw;struct csio_ioreq *ioreq;
Signature · 1 line
2.24.1
PATCH 22/30 ACPI: OSL: Add missing annotation for acpi_os_acquire_lock()
In reply to Jules IrengeSparse reports a warning at acpi_os_acquire_lock()
warning: context imbalance in acpi_os_acquire_lock() - unexpected unlock
The root cause is the missing annotation at acpi_os_acquire_lock() Add the missing annotation __acquires(lockp)
--- drivers/acpi/osl.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/osl.c +1 -0
@@ -1598,6 +1598,7 @@ void acpi_os_delete_lock(acpi_spinlock handle)*/ acpi_cpu_flags acpi_os_acquire_lock (acpi_spinlock lockp) +__acquires (lockp) {acpi_cpu_flags flags;spin_lock_irqsave (lockp, flags);
Signature · 1 line
2.24.1
Re: [PATCH 22/30] ACPI: OSL: Add missing annotation for acpi_os_acquire_lock()
Quoted 18 lines · CET Jules Irenge
Sparse reports a warning at
acpi_os_acquire_lock()warning: context imbalance in
acpi_os_acquire_lock()- unexpected unlockThe root cause is the missing annotation at
acpi_os_acquire_lock()Add the missing annotation__acquires(lockp)Signed-off-by Jules Irenge <[email protected]>--- drivers/acpi/osl.c | 1 + 1 file changed, 1 insertion(+)drivers/acpi/osl.c +0
-0
drivers/acpi/osl.c void acpi_os_delete_lock(acpi_spinlock handle) · line 1604
Quoted 7 lines
drivers/acpi/osl.c +1
-0@@ -1598,6 +1598,7 @@ void acpi_os_delete_lock(acpi_spinlock handle)*/ acpi_cpu_flags acpi_os_acquire_lock (acpi_spinlock lockp) +__acquires (lockp) {acpi_cpu_flags flags;spin_lock_irqsave (lockp, flags);
Merged with the [23/30] and applied with modified subject and changelog as 5.7 material.
Thanks!
PATCH 23/30 ACPI: OSL: Add missing annotation for acpi_os_release_lock()
In reply to Jules IrengeSparse reports a warning at acpi_os_release_lock()
warning: context imbalance in acpi_os_release_lock() - unexpected unlock
The root cause is the missing annotation at acpi_os_release_lock() Add the missing annotation __releases(lockp)
--- drivers/acpi/osl.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/osl.c +1 -0
@@ -1610,6 +1610,7 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)*/ void acpi_os_release_lock (acpi_spinlock lockp,acpi_cpu_flags flags) +__releases (lockp) {spin_unlock_irqrestore (lockp, flags); }
Signature · 1 line
2.24.1
PATCH 24/30 dmaengine: mic_x100_dma: Add missing annotation for mic_dma_tx_submit_unlock()
In reply to Jules IrengeSparse reports a warning dma_cookie_t mic_dma_tx_submit_unlock()
warning: context imbalance in mic_dma_tx_submit_unlock()
- unexpected unlock
The root cause is the missing annotation at mic_dma_tx_submit_unlock() Add the missing annotation __releases(&mic_ch->prep_lock)
--- drivers/dma/mic_x100_dma.c | 1 + 1 file changed, 1 insertion(+)
drivers/dma/mic_x100_dma.c +1 -0
@@ -236,6 +236,7 @@ static inline void mic_dma_update_pending(struct mic_dma_chan *ch) }static dma_cookie_t mic_dma_tx_submit_unlock (struct dma_async_tx_descriptor *tx) + __releases(&mic_ch->prep_lock) {struct mic_dma_chan *mic_ch =to_mic_dma_chan (tx->chan);dma_cookie_t cookie;
Signature · 1 line
2.24.1
PATCH 25/30 zram: Add missing annotatin for zram_slot_lock()
In reply to Jules IrengeSparse reports a warning at zram_slot_lock()
warning: context imbalance in zram_slot_lock() - wrong count at exit The root cause is the missing annotation at zram_slot_lock() Add the missing __acquires(ZRAM_LOCK) annotation
--- drivers/block/zram/zram_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/zram/zram_drv.c +1 -0
@@ -62,6 +62,7 @@ static int zram_slot_trylock(struct zram *zram, u32 index) }static void zram_slot_lock (struct zram *zram,u32 index) +__acquires (ZRAM_LOCK ) {bit_spin_lock (ZRAM_LOCK , &zram->table[index].flags); }
Signature · 1 line
2.24.1
PATCH 26/30 zram: Add missing annotatin for zram_slot_unlock()
In reply to Jules IrengeSparse reports a warning at zram_slot_unlock()
warning: context imbalance in zram_slot_unlock() - unexpected unlock The root cause is the missing annotation at zram_slot_unlock() Add the missing __releases(ZRAM_LOCK) annotation
--- drivers/block/zram/zram_drv.c | 1 + 1 file changed, 1 insertion(+)
drivers/block/zram/zram_drv.c +1 -0
@@ -68,6 +68,7 @@ static void zram_slot_lock(struct zram *zram, u32 index) }static void zram_slot_unlock (struct zram *zram,u32 index) +__releases (ZRAM_LOCK ) {bit_spin_unlock (ZRAM_LOCK , &zram->table[index].flags); }
Signature · 1 line
2.24.1
PATCH 27/30 habanalabs: Add missing annotation for goya_hw_queues_lock()
In reply to Jules IrengeSparse reports a warning at goya_hw_queues_lock()
warning: context imbalance in goya_hw_queues_lock() - wrong count at exit The root cause is a missing annotation at goya_hw_queues_lock() Add the missing __acquires(&goya->hw_queues_lock) annotation
--- drivers/misc/habanalabs/goya/goya.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/goya/goya.c +1 -0
@@ -5073,6 +5073,7 @@ static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask, }static void goya_hw_queues_lock (struct hl_device *hdev) + __acquires(&goya->hw_queues_lock) {struct goya_device *goya = hdev->asic_specific;
Signature · 1 line
2.24.1
Re: [PATCH 27/30] habanalabs: Add missing annotation for goya_hw_queues_lock()
Quoted 24 lines · Jules Irenge
Sparse reports a warning at
goya_hw_queues_lock()
warning: context imbalance ingoya_hw_queues_lock()- wrong count at exit The root cause is a missing annotation atgoya_hw_queues_lock()Add the missing__acquires(&goya->hw_queues_lock)annotationSigned-off-by Jules Irenge <[email protected]>--- drivers/misc/habanalabs/goya/goya.c | 1 + 1 file changed, 1 insertion(+)drivers/misc/habanalabs/goya/goya.c +1
-1@@ -5073,6 +5073,7 @@ static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask, }static void goya_hw_queues_lock (struct hl_device *hdev) + __acquires(&goya->hw_queues_lock) {struct goya_device *goya = hdev->asic_specific; --
Quoted 2 lines
2.24.1
This patch is:
Applied to -next
Thanks,
Oded
PATCH 28/30 habanalabs: Add missing annotation for goya_hw_queues_unlock()
In reply to Jules IrengeSparse reports a warning at goya_hw_queues_unlock()
warning: context imbalance in goya_hw_queues_unlock() - unexpected unlock The root cause is a missing annotation at goya_hw_queues_unlock() Add the missing __releases(&goya->hw_queues_lock) annotation
--- drivers/misc/habanalabs/goya/goya.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/goya/goya.c +1 -0
@@ -5081,6 +5081,7 @@ static void goya_hw_queues_lock(struct hl_device *hdev) }static void goya_hw_queues_unlock (struct hl_device *hdev) + __releases(&goya->hw_queues_lock) {struct goya_device *goya = hdev->asic_specific;
Signature · 1 line
2.24.1
Re: [PATCH 28/30] habanalabs: Add missing annotation for goya_hw_queues_unlock()
Quoted 24 lines · Jules Irenge
Sparse reports a warning at
goya_hw_queues_unlock()
warning: context imbalance ingoya_hw_queues_unlock()- unexpected unlock The root cause is a missing annotation atgoya_hw_queues_unlock()Add the missing__releases(&goya->hw_queues_lock)annotationSigned-off-by Jules Irenge <[email protected]>--- drivers/misc/habanalabs/goya/goya.c | 1 + 1 file changed, 1 insertion(+)drivers/misc/habanalabs/goya/goya.c +1
-1@@ -5081,6 +5081,7 @@ static void goya_hw_queues_lock(struct hl_device *hdev) }static void goya_hw_queues_unlock (struct hl_device *hdev) + __releases(&goya->hw_queues_lock) {struct goya_device *goya = hdev->asic_specific; --
Quoted 2 lines
2.24.1
This patch is:
Applied to -next
Thanks,
Oded
PATCH 29/30 sgi-xp: Add missing annotation for xpc_disconnect_channel()
In reply to Jules IrengeSparse reports a warning at xpc_disconnect_channel()
warning: context imbalance in xpc_disconnect_channel() - unexpected unlock The root cause is a missing annotation at xpc_disconnect_channel() Add the missing __must_hold(&ch->lock) annotation
--- drivers/misc/sgi-xp/xpc_channel.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/sgi-xp/xpc_channel.c +1 -0
@@ -752,6 +752,7 @@ xpc_initiate_disconnect(int ch_number)void xpc_disconnect_channel (const int line,struct xpc_channel *ch,enum xp_retval reason,unsigned long *irq_flags) + __must_hold(&ch->lock) {u32 channel_was_connected = (ch->flags &XPC_C_CONNECTED );
Signature · 1 line
2.24.1
Re: [PATCH 29/30] sgi-xp: Add missing annotation for xpc_disconnect_channel()
Quoted 7 lines · Jules Irenge
Sparse reports a warning at
xpc_disconnect_channel()
warning: context imbalance inxpc_disconnect_channel()- unexpected unlock The root cause is a missing annotation atxpc_disconnect_channel()Add the missing__must_hold(&ch->lock)annotationSigned-off-by Jules Irenge <[email protected]>
PATCH 30/30 sgi-xp: Add missing annotation for ocfs2_inode_cache_lock() and ocfs2_inode_cache_unlock()
In reply to Jules IrengeSparse reports a warning at ocfs2_inode_cache_lock() and ocfs2_inode_cache_unlock()
warning: context imbalance in ocfs2_inode_cache_lock()
- wrong count at exit
warning: context imbalance in ocfs2_inode_cache_unlock()
- unexpected unlock
The root cause is a missing annotation at ocfs2_inode_cache_lock() and at ocfs2_inode_cache_unlock()
Add the missing __acquires(&oi->ip_lock) annotation Add the missing __releases(&oi->ip_lock) annotation
--- fs/ocfs2/inode.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ocfs2/inode.c +2 -0
@@ -1623,6 +1623,7 @@ static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info }static void ocfs2_inode_cache_lock (struct ocfs2_caching_info *ci) + __acquires(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);
@@ -1630,6 +1631,7 @@ static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) }static void ocfs2_inode_cache_unlock (struct ocfs2_caching_info *ci) + __releases(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);
Signature · 1 line
2.24.1
Joseph Qi
maintainerRe: [PATCH 30/30] sgi-xp: Add missing annotation for ocfs2_inode_cache_lock() and ocfs2_inode_cache_unlock()
Quoted 10 lines · Jules Irenge
Sparse reports a warning at
ocfs2_inode_cache_lock()andocfs2_inode_cache_unlock()
warning: context imbalance inocfs2_inode_cache_lock()
- wrong count at exitwarning: context imbalance in
ocfs2_inode_cache_unlock()
- unexpected unlock
The root cause is a missing annotation atocfs2_inode_cache_lock()and atocfs2_inode_cache_unlock()
Quoted 4 lines
Add the missing
__acquires(&oi->ip_lock)annotation Add the missing__releases(&oi->ip_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Looks good.
BTW, there are another co_cache_[lock|unlock] implementations also miss the annotations:ocfs2_refcount_cache_lockocfs2_refcount_cache_unlock
So could we add the missing annotations as well?
Thanks,
Joseph
Quoted 25 lines
--- fs/ocfs2/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/ocfs2/inode.c +2
-0@@ -1623,6 +1623,7 @@ static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info }static void ocfs2_inode_cache_lock (struct ocfs2_caching_info *ci) + __acquires(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);@@ -1630,6 +1631,7 @@ static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) }static void ocfs2_inode_cache_unlock (struct ocfs2_caching_info *ci) + __releases(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);
Re: [PATCH 30/30] sgi-xp: Add missing annotation for ocfs2_inode_cache_lock() and ocfs2_inode_cache_unlock()
In reply to Jules IrengeQuoted 10 lines · Jules Irenge
Sparse reports a warning at
ocfs2_inode_cache_lock()andocfs2_inode_cache_unlock()
warning: context imbalance inocfs2_inode_cache_lock()
- wrong count at exitwarning: context imbalance in
ocfs2_inode_cache_unlock()
- unexpected unlock
The root cause is a missing annotation atocfs2_inode_cache_lock()and atocfs2_inode_cache_unlock()
Quoted 4 lines
Add the missing
__acquires(&oi->ip_lock)annotation Add the missing__releases(&oi->ip_lock)annotationSigned-off-by Jules Irenge <[email protected]>
Quoted 25 lines
--- fs/ocfs2/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/ocfs2/inode.c +2
-0@@ -1623,6 +1623,7 @@ static struct super_block *ocfs2_inode_cache_get_super(struct ocfs2_caching_info }static void ocfs2_inode_cache_lock (struct ocfs2_caching_info *ci) + __acquires(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);@@ -1630,6 +1631,7 @@ static void ocfs2_inode_cache_lock(struct ocfs2_caching_info *ci) }static void ocfs2_inode_cache_unlock (struct ocfs2_caching_info *ci) + __releases(&oi->ip_lock) {struct ocfs2_inode_info *oi =cache_info_to_inode (ci);