From owner-freebsd-stable@FreeBSD.ORG Sat Jun 12 08:59:08 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 349071065687 for ; Sat, 12 Jun 2010 08:59:08 +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 A8ED88FC13 for ; Sat, 12 Jun 2010 08:59:07 +0000 (UTC) Received: by bwz2 with SMTP id 2so1163171bwz.13 for ; Sat, 12 Jun 2010 01:59:06 -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:references :x-comment-to:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=RwiOpOa+sB3hM+6n8Cs5LjNQndnULwzVe71uymqGI9k=; b=bVYEBhkNv576LthxFFpIFCGKKvSoCMxJId/92KPvLuVQiQxF/VSxhs6y4hXyM6FaEC GHgOAw6x3nsHPRlHJF/J981iCBBaPP8Nitn15yIID+q4X4qiCzg/Fllm9CW3uOTorHVs 6vI02cb7+7YS+plbqHAdhRqqaSoA2wjMEY/uI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=IWIdFzFB+9Pei5+LDaQPCv1Uy0X+Lgg/am9WHPH4fh9q1enAOy6SF8vUkeBIstjCor U2B1X8DiLrRyMKfXL+DSGDjdIe6ze/T6CGrK4EswnbaJMnaOkTSx5Q+PZRyidW/VVSK3 vf1qTamo+d25HDClguVbXvNGrTb+r4eMkETh4= Received: by 10.204.160.156 with SMTP id n28mr2168435bkx.1.1276333144992; Sat, 12 Jun 2010 01:59:04 -0700 (PDT) Received: from localhost ([95.69.160.52]) by mx.google.com with ESMTPS id z17sm8949284bkx.0.2010.06.12.01.59.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Jun 2010 01:59:03 -0700 (PDT) From: Mikolaj Golub To: Leon =?utf-8?Q?Me=C3=9Fner?= References: <20100606144443.GA50876@emmi.physik-pool.tu-berlin.de> <8639wsk4t1.fsf@kopusha.home.net> X-Comment-To: Mikolaj Golub Date: Sat, 12 Jun 2010 11:59:03 +0300 In-Reply-To: <8639wsk4t1.fsf@kopusha.home.net> (Mikolaj Golub's message of "Sat, 12 Jun 2010 11:56:10 +0300") Message-ID: <86y6ekiq3s.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-stable@freebsd.org Subject: Re: freeBSD nullfs together with nfs and "silly rename" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2010 08:59:08 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, 12 Jun 2010 11:56:10 +0300 Mikolaj Golub wrote to Leon Me=C3=9Fner: MG> See the attached patch (it works for me on both 8-STABLE and CURRENT). Sorry, actually here is the patch. --=20 Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=null_vnops.c.null_remove.patch Index: sys/fs/nullfs/null_vnops.c =================================================================== --- sys/fs/nullfs/null_vnops.c (revision 208960) +++ sys/fs/nullfs/null_vnops.c (working copy) @@ -499,6 +499,23 @@ } /* + * Increasing refcount of lower vnode is needed at least for the case + * when lower FS is NFS to do sillyrename if the file is in use. + */ +static int +null_remove(struct vop_remove_args *ap) +{ + int retval; + struct vnode *lvp; + + lvp = NULLVPTOLOWERVP(ap->a_vp); + VREF(lvp); + retval = null_bypass(&ap->a_gen); + vrele(lvp); + return (retval); +} + +/* * We handle this to eliminate null FS to lower FS * file moving. Don't know why we don't allow this, * possibly we should. @@ -809,6 +826,7 @@ .vop_open = null_open, .vop_print = null_print, .vop_reclaim = null_reclaim, + .vop_remove = null_remove, .vop_rename = null_rename, .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, --=-=-=--