From owner-freebsd-fs@FreeBSD.ORG Thu Jul 4 08:36:49 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8E0C55E6; Thu, 4 Jul 2013 08:36:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2C4F71756; Thu, 4 Jul 2013 08:36:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r648afbE089141; Thu, 4 Jul 2013 11:36:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r648afbE089141 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r648afRl089140; Thu, 4 Jul 2013 11:36:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 4 Jul 2013 11:36:41 +0300 From: Konstantin Belousov To: Steven Hartland Subject: Re: kern/180236: [zfs] [nullfs] Leakage free space using ZFS with nullfs on 9.1-STABLE Message-ID: <20130704083641.GK91021@kib.kiev.ua> References: <201307040000.r64001v6076818@freefall.freebsd.org> <20130704041539.GE91021@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pSOzL3v+cS6lyd4U" Content-Disposition: inline In-Reply-To: <20130704041539.GE91021@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home 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 08:36:49 -0000 --pSOzL3v+cS6lyd4U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 GN= ATS. > >=20 > > From: "Steven Hartland" > > To: , > > "Ivan Klymenko" > > Cc: =20 > > Subject: Re: kern/180236: [zfs] [nullfs] Leakage free space using ZFS w= ith nullfs on 9.1-STABLE > > Date: Thu, 4 Jul 2013 00:58:13 +0100 > >=20 > > 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. > > =20 > > 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. >=20 > 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 =3D ap->a_fvp; struct vnode *fdvp =3D ap->a_fdvp; struct vnode *tvp =3D ap->a_tvp; + struct null_node *tnn; =20 /* Check for cross-device rename. */ if ((fvp->v_mount !=3D tdvp->v_mount) || @@ -568,7 +569,11 @@ null_rename(struct vop_rename_args *ap) vrele(fvp); return (EXDEV); } -=09 + + if (tvp !=3D NULL) { + tnn =3D VTONULL(tvp); + tnn->null_flags |=3D NULLV_DROP; + } return (null_bypass((struct vop_generic_args *)ap)); } =20 --pSOzL3v+cS6lyd4U Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR1TQYAAoJEJDCuSvBvK1BLM0P/RH3l/YrW66st4j+KyukGcn7 6p57DZVhVPjPLNNlDBamlk94rwgSq5dQ4pIl1o7U+NVunjyopv4kobzfrgYC1cdW rOvYfoTC1VPchiETmoCtZeJgNzXGIuGkotR3Kh8ELeN83mJAeAiyCTmyt4S5Axly BIsjEbyghXruoq7NPZUA9Rqm4Rgn2YrF5PDwB0X12AY7u+qtuxALjc80TUyfeD9z 5P0iuHizjVGRmkCYJxHFYPHI/ggiZEZjC+oBQkC7gHuPeUpeT62mkrmL6UXokmdi ScV2ibI87byZu9nC7PEiD8eNsj9tYCmdcuVs9bDZOnrXVvS5lQmDFVmO97WrMZdo FLtfKwapN2lR0lguVuta785wrSkSzyMN+vLFjacJTgZc/vHEHHhPSFrrY/02ZZGJ jOj5DjbWGjobNzkJSpCg6ZDKr13F6TaW9XkTpCI9+w+wmLw19vv0KS5ULGAmBLi5 U9to+opTC0c7fqOYsD7E87ef9P5qm6v8ON/+OT8Q746mlSKDxO5gmflHPo107QHk IsLUEEVIuFksbHP5u1Iob4Uj6OxRgC39eRaw0ePbYMYbE+S5iZpTAUgiqkhNNVLr wQnjWEnzriyehRcW8xGbkd8ju3xq24w76t6bfPN5xTKXAQam5Dzg8KJTOWg97By8 NPMeC4sH3/FlB7GmxqCD =jkkk -----END PGP SIGNATURE----- --pSOzL3v+cS6lyd4U--