All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jules Irenge <jbi.octave@gmail.com>
To: boqun.feng@gmail.com
Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org, Jules Irenge <jbi.octave@gmail.com>
Subject: [PATCH 07/11] fs_pin: Add missing annotation for pin_kill() declaration
Date: Sun,  9 Feb 2020 22:44:04 +0000	[thread overview]
Message-ID: <e1f17a7b53760467defc7055ce1bd11d7e8f80cb.1581282103.git.jbi.octave@gmail.com> (raw)
In-Reply-To: <cover.1581282103.git.jbi.octave@gmail.com>

Sparse reports warnings within the kernel acct.c file
at acct_exit_ns(), __se_sys_acct(), acct_on()

warning: context imbalance in acct_on()
	- different lock contexts for basic block
warning: context imbalance in __se_sys_acct()
	- different lock contexts for basic block
warning: context imbalance in acct_exit_ns()
	- wrong count at exit

The root cause is the missing annotation at pin_kill()

In fact acct_exit_ns(), __se_sys_sys_acct() and acct_on()
 do actually call rcu_read_lock()
then call pin_kill() which is defined elsewhere.
A close look at pin_kill()
- called 3 times in the core kernel and 2 times elsewhere-
shows that pin_kill() does actually call rcu_read_unlock().
Adding the annotation at declaration and definition of pin_kill()
not only fixes the warnings
but also improves on the readability of the code

Add the missing annotation __release(RCU)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 include/linux/fs_pin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fs_pin.h b/include/linux/fs_pin.h
index bdd09fd2520c..d2fcf1a5112f 100644
--- a/include/linux/fs_pin.h
+++ b/include/linux/fs_pin.h
@@ -21,4 +21,4 @@ static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
 
 void pin_remove(struct fs_pin *);
 void pin_insert(struct fs_pin *, struct vfsmount *);
-void pin_kill(struct fs_pin *);
+void pin_kill(struct fs_pin *) __releases(RCU);
-- 
2.24.1


  parent reply	other threads:[~2020-02-09 22:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0/11>
2020-02-09 22:24 ` [PATCH 00/11] Lock warning cleanup Jules Irenge
2020-02-09 22:27   ` [PATCH 01/11] hrtimer: Add missing annotation to lock_hrtimer_base() Jules Irenge
2020-02-09 22:29   ` [PATCH 02/11] futex: Add missing annotation for wake_futex_pi() Jules Irenge
2020-02-09 22:30   ` [PATCH 03/11] futex: Add missing annotation for fixup_pi_state_owner() Jules Irenge
2020-02-09 22:33   ` [PATCH 04/11] perf/ring_buffer: Add missing annotation to perf_output_end() Jules Irenge
2020-02-09 22:37   ` [PATCH 05/11] sched/fair: Add missing annotation for nohz_newidle_balance() Jules Irenge
2020-02-09 22:39   ` [PATCH 06/11] sched/deadline: Add missing annotation for dl_task_offline_migration() Jules Irenge
2020-02-10  8:07     ` Juri Lelli
2020-02-09 22:44   ` Jules Irenge [this message]
2020-02-09 22:45   ` [PATCH 08/11] fs_pin: Add missing annotation for pin_kill() definition Jules Irenge
2020-02-09 22:48   ` [PATCH 09/11] kasan: add missing annotation for start_report() Jules Irenge
2020-02-10  7:27     ` Dmitry Vyukov
2020-02-10  7:27       ` Dmitry Vyukov
2020-02-09 22:49   ` [PATCH 10/11] kasan: add missing annotation for end_report() Jules Irenge
2020-02-10  7:27     ` Dmitry Vyukov
2020-02-10  7:27       ` Dmitry Vyukov
2020-02-09 22:50   ` [PATCH 11/11] futex: Add missing annotation for futex_wait_queue_me() Jules Irenge
2020-02-10  5:06   ` [PATCH 00/11] Lock warning cleanup Boqun Feng
2020-02-10 23:09     ` Jules Irenge
2020-02-10 23:09       ` Jules Irenge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1f17a7b53760467defc7055ce1bd11d7e8f80cb.1581282103.git.jbi.octave@gmail.com \
    --to=jbi.octave@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.