Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348197

[PATCH RT 14/17] f2fs: Mutex cant be used by down_write_nest_lock()

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject [PATCH RT 14/17] f2fs: Mutex cant be used by down_write_nest_lock()
Date 2016-03-02 16:50 +0100
Message-ID <r8hcf-1c4-33@gated-at.bofh.it> (permalink)
References <r8hcd-1c4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.14.61-rt64-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Yang Shi <yang.shi@linaro.org>

fsf2_lock_all() calls down_write_nest_lock() to acquire a rw_sem and check
a mutex, but down_write_nest_lock() is designed for two rw_sem accoring to the
comment in include/linux/rwsem.h. And, other than f2fs, it is just called in
mm/mmap.c with two rwsem.

So, it looks it is used wrongly by f2fs. And, it causes the below compile
warning on -rt kernel too.

In file included from fs/f2fs/xattr.c:25:0:
fs/f2fs/f2fs.h: In function 'f2fs_lock_all':
fs/f2fs/f2fs.h:962:34: warning: passing argument 2 of 'down_write_nest_lock' from
		       incompatible pointer type [-Wincompatible-pointer-types]
  f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex);
                                  ^

The nest annotation was anyway bogus as nested annotations for lockdep are
only required if one nests two locks of the same lock class, which is not the
case here.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
Cc: cm224.lee@samsung.com
Cc: chao2.yu@samsung.com
Cc: linaro-kernel@lists.linaro.org
Cc: linux-rt-users@vger.kernel.org
Cc: bigeasy@linutronix.de
Cc: rostedt@goodmis.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org
Cc: jaegeuk@kernel.org
Link: http://lkml.kernel.org/r/1456532725-4126-1-git-send-email-yang.shi@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/f2fs/f2fs.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index fc3c558cb4f3..36c2cd00cfa9 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -22,10 +22,8 @@
 
 #ifdef CONFIG_F2FS_CHECK_FS
 #define f2fs_bug_on(condition)	BUG_ON(condition)
-#define f2fs_down_write(x, y)	down_write_nest_lock(x, y)
 #else
 #define f2fs_bug_on(condition)
-#define f2fs_down_write(x, y)	down_write(x)
 #endif
 
 /*
@@ -590,7 +588,7 @@ static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi)
 
 static inline void f2fs_lock_all(struct f2fs_sb_info *sbi)
 {
-	f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex);
+	down_write(&sbi->cp_rwsem);
 }
 
 static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RT 00/17] Linux 3.14.61-rt64-rc1 Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 04/17] softirq: split timer softirqs out of ksoftirqd Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 08/17] kernel: migrate_disable() do fastpath in atomic & irqs-off Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 06/17] latencyhist: disable jump-labels Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 10/17] kernel/stop_machine: partly revert "stop_machine: Use raw spinlocks" Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 14/17] f2fs: Mutex cant be used by down_write_nest_lock() Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 01/17] ptrace: dont open IRQs in ptrace_freeze_traced() too early Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 15/17] rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 09/17] kernel: softirq: unlock with irqs on Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 05/17] net: provide a way to delegate processing a softirq to ksoftirqd Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 16:50 +0100
  [PATCH RT 03/17] preempt-lazy: Add the lazy-preemption check to preempt_schedule() Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:00 +0100
  [PATCH RT 11/17] sched,rt: __always_inline preemptible_lazy() Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
  [PATCH RT 02/17] net: move xmit_recursion to per-task variable on -RT Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
  [PATCH RT 13/17] trace: Use rcuidle version for preemptoff_hist trace point Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
  [PATCH RT 12/17] drm,radeon,i915: Use preempt_disable/enable_rt() where recommended Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
  [PATCH RT 16/17] kernel: sched: Fix preempt_disable_ip recodring for preempt_disable() Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
  [PATCH RT 07/17] arm64: replace read_lock to rcu lock in call_step_hook Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100
    Re: [PATCH RT 07/17] arm64: replace read_lock to rcu lock in  call_step_hook Pratyush Anand <panand@redhat.com> - 2016-03-03 05:30 +0100
      Re: [PATCH RT 07/17] arm64: replace read_lock to rcu lock in  call_step_hook Steven Rostedt <rostedt@goodmis.org> - 2016-03-03 15:20 +0100
        Re: [PATCH RT 07/17] arm64: replace read_lock to rcu lock in  call_step_hook Steven Rostedt <rostedt@goodmis.org> - 2016-03-03 15:30 +0100
  [PATCH RT 17/17] Linux 3.14.61-rt64-rc1 Steven Rostedt <rostedt@goodmis.org> - 2016-03-02 17:10 +0100

csiph-web