Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965444AbbBBXwx (ORCPT ); Mon, 2 Feb 2015 18:52:53 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35541 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965305AbbBBXwx (ORCPT ); Mon, 2 Feb 2015 18:52:53 -0500 Date: Mon, 2 Feb 2015 15:52:51 -0800 From: Andrew Morton To: Fabian Frederick Cc: linux-kernel@vger.kernel.org, Evgeniy Dushistov Subject: Re: [PATCH 1/1 linux-next] fs/ufs/super.c: remove CONFIG_SMP/CONFIG_PREEMPT testing Message-Id: <20150202155251.07374de793646396ed15b9f8@linux-foundation.org> In-Reply-To: <1422790617-7944-1-git-send-email-fabf@skynet.be> References: <1422790617-7944-1-git-send-email-fabf@skynet.be> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1122 Lines: 38 On Sun, 1 Feb 2015 12:36:57 +0100 Fabian Frederick 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? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/