Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jul 2013 11:36:41 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Steven Hartland <smh@freebsd.org>
Cc:        freebsd-fs@FreeBSD.org
Subject:   Re: kern/180236: [zfs] [nullfs] Leakage free space using ZFS with nullfs on 9.1-STABLE
Message-ID:  <20130704083641.GK91021@kib.kiev.ua>
In-Reply-To: <20130704041539.GE91021@kib.kiev.ua>
References:  <201307040000.r64001v6076818@freefall.freebsd.org> <20130704041539.GE91021@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--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" <smh@freebsd.org>
> > To: <bug-followup@freebsd.org>,
> > 	"Ivan Klymenko" <fidaj@ukr.net>
> > 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130704083641.GK91021>