From owner-freebsd-stable@FreeBSD.ORG Fri Sep 7 23:48:06 2012 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78F0C106566B; Fri, 7 Sep 2012 23:48:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id B43CA8FC17; Fri, 7 Sep 2012 23:48:05 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so240909lbb.13 for ; Fri, 07 Sep 2012 16:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WLN2rZmcSpjezFOtB0ZG8HNJJfn+ziaH+YSxCQ+jBqw=; b=Zjn5P2lIMGqjdUtg74dz5sFOxxII46ZcVXKfz5B++xYFw3hfUwKZAjw/Yr/3thJUz2 Fb+G7ZZeTHyYabuR8u+/bPHtJYVnd/vrRwPlvjvopfqQeGrxoH7ALsvEcYcw6uvyp1cv 9hG7RXvjES0Ch6ySJknU494Rr+1cY9QGqk388GKjbojoK0I/iZgp1+4+67Xg9Z2Dayfv OeyxIqriAkj1Ou4snJbjGf6467CjtZ1q4Sns5JbAT3D4GzsbJpoMiQWL3bsHB7SOReqk Jc4y7Ov/2MkBPoM04cqwrWrFj9ZLwDd/oJ+qxEEtVh9cysfSYR8uWrd5qR/lVPcUPDp5 lJag== MIME-Version: 1.0 Received: by 10.152.131.68 with SMTP id ok4mr6610560lab.47.1347061684095; Fri, 07 Sep 2012 16:48:04 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.102.39 with HTTP; Fri, 7 Sep 2012 16:48:03 -0700 (PDT) In-Reply-To: <5048C6D1.8020007@omnilan.de> References: <5022840B.3060708@omnilan.de> <5048C6D1.8020007@omnilan.de> Date: Sat, 8 Sep 2012 00:48:03 +0100 X-Google-Sender-Auth: xVqZOyfqtssqyE_YrZ_LwrqmG04 Message-ID: From: Attilio Rao To: Harald Schmalzbauer Content-Type: text/plain; charset=UTF-8 Cc: stable@freebsd.org, daichi@freebsd.org, Pavel Polyakov Subject: Re: lock violation in unionfs (9.0-STABLE r230270) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 23:48:06 -0000 On Thu, Sep 6, 2012 at 4:52 PM, Harald Schmalzbauer wrote: > schrieb Attilio Rao am 09.08.2012 20:26 (localtime): >> On 8/8/12, Harald Schmalzbauer wrote: >>> schrieb Pavel Polyakov am 06.03.2012 11:20 (localtime): >>>>>> mount -t unionfs -o noatime /usr /mnt >>>>>> >>>>>> insmntque: mp-safe fs and non-locked vp: 0xfffffe01d96704f0 is not >>>>>> exclusive locked but should be >>>>>> KDB: enter: lock violation >>>>> Pavel, >>>>> can you give a spin to this patch?: >>>>> http://www.freebsd.org/~attilio/unionfs_missing_insmntque_lock.patch >>>>> >>>>> I think that the unlocking is due at that point as the vnode lock can >>>>> be switch later on. >>>>> >>>>> Let me know what you think about it and what the test does. >>>> Thanks! >>>> This patch fixes the problem with lock violation. Sorry I've tested it so >>>> late. >>> Hello, >>> >>> this patch still applies cleanly to RELENG_9_1. Was there another fix >>> for the issue or has it just not been PR-sent and thus forgotten? >> Can you and Pavel try the attached patch? Unfortunately I had no time >> to test it, I just made in 5 free mins from a non-FreeBSD workstation, > > Sorry, couldn't test earlier, but now I did: > With this patch applied the machine hangs without debug kernel and the > latter gives the following panic: > System call nmount returning with the following locks held: > exclusive lockmgr ufs (ufs) r = 0 (0xc5438278) locked @ > src/sys/fs/unionfs/union_vnops.c:1938 > panic: witness_warn > cpuid = 0 > KDB: stack backtrace: > db_trace_self_wrapper(c0a04f7f,c0c112c4,d1de3bb4,c097aa8c,fc,...) at > db_trace_self_wrapper+0x26 > kdb_backtrace(c0a4965f,0,c09c2ede3c1c,0,...) at kdb_backtrace+0x2a > witness_warn(2,0,c0a4ac34,c0a0990a,286,...) at witness_warn+0x1e4 > syscall(d1de3d08) ar syscall+0x415 > Xint0x80_syscall() at Xint0x80_syscall+0x21 > --- syscall (0, FreeBSD ELF32, nosys), eip = 0x280b883f,esp = > 0xbfbfe46c, ebp = 0xbfbfede8 --- > KDB: enter: panic > [ thread pid 86 tid 100054 ] > Stopped ad kdb_enter+0x3a: movl $0,kdb_why > db> bt > Tracing pid 86 tid 100054 td 0xc541b000 > kdb_enter(c0a00d16,c0a09130,0,0,0,...) at panix+0x190 > witness_warn(2,0,x0a4ac34,c0a0990a,286,...) at witness_warn+0x1e4 > syscall(d1de3d08) at syscall+0x415 > Xint0x80_syscall() at Xint0x80_syscall+0x21 > > Hmm, I guess I forgot to install kernel debug symbols... > Coming back if I have more Unfortunately unionfs does very wrong things with the insmntque() locking. It basically expects the vnode to return locked in the same way requested by the precedent namei() (when that happens) but when you do insmntque() you can only have an LK_EXCLUSIVE lock on the vnode. I still need some time to fix this but my bandwidth is basically 0 at the moment, I'll try to get back to you with a patch as soon as possible. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein