From owner-freebsd-fs@FreeBSD.ORG Thu Jul 4 09:44:47 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9A11AA3 for ; Thu, 4 Jul 2013 09:44:47 +0000 (UTC) (envelope-from prvs=1897fed9ea=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6DD1B20 for ; Thu, 4 Jul 2013 09:44:47 +0000 (UTC) Received: from r2d2 ([82.69.141.170]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50004719264.msg for ; Thu, 04 Jul 2013 10:44:44 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Thu, 04 Jul 2013 10:44:44 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 82.69.141.170 X-Return-Path: prvs=1897fed9ea=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-fs@FreeBSD.org Message-ID: <0F8371633F6B496B87285D660FAF205B@multiplay.co.uk> From: "Steven Hartland" To: "Konstantin Belousov" References: <201307040000.r64001v6076818@freefall.freebsd.org> <20130704041539.GE91021@kib.kiev.ua> <20130704083641.GK91021@kib.kiev.ua> Subject: Re: kern/180236: [zfs] [nullfs] Leakage free space using ZFS with nullfs on 9.1-STABLE Date: Thu, 4 Jul 2013 10:44:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 09:44:47 -0000 ----- Original Message ----- From: "Konstantin Belousov" On Thu, Jul 04, 2013 at 07:15:39AM +0300, Konstantin Belousov wrote: > > On Thu, Jul 04, 2013 at 12:00:01AM +0000, Steven Hartland wrote: > > > The following reply was made to PR kern/180236; it has been noted by GNATS. > > > > > > From: "Steven Hartland" > > > To: , > > > "Ivan Klymenko" > > > Cc: > > > Subject: Re: kern/180236: [zfs] [nullfs] Leakage free space using ZFS with nullfs on 9.1-STABLE > > > Date: Thu, 4 Jul 2013 00:58:13 +0100 > > > > > > Looks like nullfs isn't cleaning up correctly in the case > > > where a rename colides with an existing file hence results > > > in an implicit remove. > > > > > > This can be seen in the zdb output for the volume in that > > > before the unmount all the plain file entries still exist > > > but after the unmount of nullfs they are gone. > > > > Can you demonstrate the scenario of the problem, e.g. using the basic > > filesystem commands, like cp(1), mv(1) ? Does the issue reproduce > > on UFS ? > > > Ok, the following patch fixed the nullfs leakage for me (I tested over > the UFS). > > diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c > index 6ff15ee..70402e3 100644 > --- a/sys/fs/nullfs/null_vnops.c > +++ b/sys/fs/nullfs/null_vnops.c > @@ -554,6 +554,7 @@ null_rename(struct vop_rename_args *ap) > struct vnode *fvp = ap->a_fvp; > struct vnode *fdvp = ap->a_fdvp; > struct vnode *tvp = ap->a_tvp; > + struct null_node *tnn; > > /* Check for cross-device rename. */ > if ((fvp->v_mount != tdvp->v_mount) || > @@ -568,7 +569,11 @@ null_rename(struct vop_rename_args *ap) > vrele(fvp); > return (EXDEV); > } > - > + > + if (tvp != NULL) { > + tnn = VTONULL(tvp); > + tnn->null_flags |= NULLV_DROP; > + } > return (null_bypass((struct vop_generic_args *)ap)); > } Confirmed this fixes the issue. I believe there's still a ZFS leak being triggered in the delete queue before this nullfs fix, which will result in space not being freed but with patch no further leaks occur. Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.