linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] fs/ufs/super.c: remove CONFIG_SMP/CONFIG_PREEMPT testing
@ 2015-02-01 11:36 Fabian Frederick
  2015-02-02 23:52 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-02-01 11:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Evgeniy Dushistov, Andrew Morton

Let locking subsystem decide on mutex management.

Cc: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/ufs/super.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index e515e99..8092d37 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -95,22 +95,18 @@
 
 void lock_ufs(struct super_block *sb)
 {
-#if defined(CONFIG_SMP) || defined (CONFIG_PREEMPT)
 	struct ufs_sb_info *sbi = UFS_SB(sb);
 
 	mutex_lock(&sbi->mutex);
 	sbi->mutex_owner = current;
-#endif
 }
 
 void unlock_ufs(struct super_block *sb)
 {
-#if defined(CONFIG_SMP) || defined (CONFIG_PREEMPT)
 	struct ufs_sb_info *sbi = UFS_SB(sb);
 
 	sbi->mutex_owner = NULL;
 	mutex_unlock(&sbi->mutex);
-#endif
 }
 
 static struct inode *ufs_nfs_get_inode(struct super_block *sb, u64 ino, u32 generation)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 linux-next] fs/ufs/super.c: remove CONFIG_SMP/CONFIG_PREEMPT testing
  2015-02-01 11:36 [PATCH 1/1 linux-next] fs/ufs/super.c: remove CONFIG_SMP/CONFIG_PREEMPT testing Fabian Frederick
@ 2015-02-02 23:52 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2015-02-02 23:52 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Evgeniy Dushistov

On Sun,  1 Feb 2015 12:36:57 +0100 Fabian Frederick <fabf@skynet.be> wrote:

> Let locking subsystem decide on mutex management.
> 
> ...
>
> --- a/fs/ufs/super.c
> +++ b/fs/ufs/super.c
> @@ -95,22 +95,18 @@
>  
>  void lock_ufs(struct super_block *sb)
>  {
> -#if defined(CONFIG_SMP) || defined (CONFIG_PREEMPT)
>  	struct ufs_sb_info *sbi = UFS_SB(sb);
>  
>  	mutex_lock(&sbi->mutex);
>  	sbi->mutex_owner = current;
> -#endif
>  }

Good heavens.

This patch is a bugfix.  lock_ufs() is assuming that on non-preempt
uniprocessor, the calling code will run atomically up to the matching
unlock_ufs().

But that isn't true.  The very first site I looked at (ufs_frag_map)
does sb_bread() under lock_ufs(.  And sb_bread() will call schedule(),
very commonly.

The ->mutex_owner stuff is a bit hacky but should work OK.

Care to resend the patch with a more alarming changelog?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-02 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01 11:36 [PATCH 1/1 linux-next] fs/ufs/super.c: remove CONFIG_SMP/CONFIG_PREEMPT testing Fabian Frederick
2015-02-02 23:52 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).