From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932558Ab0JZWlO (ORCPT ); Tue, 26 Oct 2010 18:41:14 -0400 Received: from fieldses.org ([174.143.236.118]:52600 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757691Ab0JZWlN (ORCPT ); Tue, 26 Oct 2010 18:41:13 -0400 Date: Tue, 26 Oct 2010 18:41:07 -0400 From: "J. Bruce Fields" To: Linus Torvalds Cc: Arnd Bergmann , Bryan Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: nfsd changes for 2.6.37 Message-ID: <20101026224107.GE1842@fieldses.org> References: <20101026164549.GD19445@fieldses.org> <201010262218.36940.arnd@arndb.de> <4CC73BA6.1090407@netapp.com> <201010262255.40481.arnd@arndb.de> <20101026212433.GB1842@fieldses.org> <20101026214441.GC1842@fieldses.org> <20101026221156.GD1842@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101026221156.GD1842@fieldses.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2010 at 06:11:56PM -0400, J. Bruce Fields wrote: > On Tue, Oct 26, 2010 at 05:44:41PM -0400, J. Bruce Fields wrote: > > On Tue, Oct 26, 2010 at 02:37:26PM -0700, Linus Torvalds wrote: > > > On Tue, Oct 26, 2010 at 2:24 PM, J. Bruce Fields wrote: > > > > > > > > I did a couple connectathon runs just now with no obvious ill effects > > > > except for some sleep-within-spinlock warnings in the lease code. > > > > > > Hmm. Those sleep-within-spinlock warnings are very likely serious > > > bugs. > > > > Yeah, didn't mean to belittle them. > > > > > Can you quote the whole warning with stack trace? > > > > It's just obvious allocations in setlease: > > > > BUG: sleeping function called from invalid context at mm/slab.c:3101 > > in_atomic(): 1, irqs_disabled(): 0, pid: 4345, name: lease_tests > > 1 lock held by lease_tests/4345: > > #0: (file_lock_lock){+.+.+.}, at: [] lock_flocks+0x15/0x20 > > Pid: 4345, comm: lease_tests Not tainted 2.6.36-05858-gbd5e20b #1028 > > Call Trace: > > [] __might_sleep+0x10d/0x140 > > [] kmem_cache_alloc+0x1f3/0x230 > > [] generic_setlease+0x112/0x2c0 > > [] __vfs_setlease+0x35/0x40 > > [] fcntl_setlease+0xce/0x180 > > [] sys_fcntl+0x2fe/0x630 > > [] ? trace_hardirqs_on_thunk+0x3a/0x3f > > [] system_call_fastpath+0x16/0x1b > > > > I'm testing a patch. > > This works for me. > > I'm not saying it's correct, but it does at least pass my dumb tests > without complaining. I can't think of any more missing locking, though I did notice this on a quick look. --b. commit fc42117585672abd3cbf247dd311869233d1606a Author: J. Bruce Fields Date: Tue Oct 26 18:25:30 2010 -0400 fix nlmsvc_notify_blocked locking Signed-off-by: J. Bruce Fields diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 6f1ef00..c462d34 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -700,14 +700,16 @@ nlmsvc_notify_blocked(struct file_lock *fl) struct nlm_block *block; dprintk("lockd: VFS unblock notification for block %p\n", fl); + spin_lock(&nlm_blocked_lock); list_for_each_entry(block, &nlm_blocked, b_list) { if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) { - nlmsvc_insert_block(block, 0); + nlmsvc_insert_block_locked(block, 0); + spin_unlock(&nlm_blocked_lock); svc_wake_up(block->b_daemon); return; } } - + spin_unlock(&nlm_blocked_lock); printk(KERN_WARNING "lockd: notification for unknown block!\n"); }