From owner-freebsd-fs@FreeBSD.ORG Wed Jun 2 08:16:51 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA34106567E for ; Wed, 2 Jun 2010 08:16:51 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 986EB8FC13 for ; Wed, 2 Jun 2010 08:16:50 +0000 (UTC) Received: by bwz2 with SMTP id 2so246134bwz.13 for ; Wed, 02 Jun 2010 01:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :organization:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=XYk/qO1lFdm1BVz652kp0cF9fq1yxuQigArjTarRgJ4=; b=olag/WzqTOQKFSth3Vghyr3ZxS2OYz5TA1DE5EI+MkD/WRjZc7j3mz49bp5yObFWAH B2pg4H7KyO5MK4ukuPtLTrdRXn35U2MPtH3cv082Wzc25iUPnqzbk8SPXOwS0Ey+SVf/ HqBJflFTiUIjqh/tvgvElz8qxxiPShu8kW4ew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=k6e52xpZVwhkw7jBQ4gYGmygc8OyzmG9FYal6LH5oZiLxVFQuOYomkhPLrHvjM4FTw elsJinW0IibfCYn5LdztUBlTvtl4FeeXIkO8+gtZUd9RQpJ9HdCTVTvIlhfDXP3lLvdi sidSmMZvGzX1hmcCGG3fyDhU2ZXQYPFsKeLWQ= Received: by 10.204.144.150 with SMTP id z22mr1513489bku.158.1275466609341; Wed, 02 Jun 2010 01:16:49 -0700 (PDT) Received: from localhost (ua1.etadirect.net [91.198.140.16]) by mx.google.com with ESMTPS id z17sm7102564bkx.0.2010.06.02.01.16.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jun 2010 01:16:47 -0700 (PDT) From: Mikolaj Golub To: Kostik Belousov Organization: TOA Ukraine References: <86fx16onx6.fsf@zhuzha.ua1> <20100601140721.GH83316@deviant.kiev.zoral.com.ua> Date: Wed, 02 Jun 2010 11:16:45 +0300 In-Reply-To: <20100601140721.GH83316@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Tue, 1 Jun 2010 17:07:21 +0300") Message-ID: <86bpbtonma.fsf@zhuzha.ua1> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-fs@freebsd.org Subject: Re: nullfs: vop_rename: fdvp is locked but should not be X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 08:16:51 -0000 --=-=-= KB> I am curious to look at the final patch. Note that you proposing to add KB> fs-specific check to vfs_subr.c. Checking that the the vnode locks are KB> different instead of that vnodes itself are different might be better KB> approach for vop_rename_pre. Ok. Looks a bit tricky :-). Then may be it is safe just to skip ASSERT() if the "target" and "from" vnodes are on different fs, like in the patch below? I have tried the patch on CURRENT. It looks like it works... -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=vfs_subr.c.vop_rename_pre.patch Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 208724) +++ sys/kern/vfs_subr.c (working copy) @@ -3793,9 +3793,10 @@ vop_rename_pre(void *ap) ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME"); /* Check the source (from). */ - if (a->a_tdvp != a->a_fdvp && a->a_tvp != a->a_fdvp) + if (a->a_tdvp != a->a_fdvp && a->a_tdvp->v_mount == a->a_fdvp->v_mount + && a->a_tvp != a->a_fdvp) ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked"); - if (a->a_tvp != a->a_fvp) + if (a->a_tvp != a->a_fvp && a->a_tvp && a->a_tvp->v_mount == a->a_fvp->v_mount) ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp locked"); /* Check the target. */ --=-=-=--