Summary: | [zfs] [nullfs] Leakage free space using ZFS with nullfs on 9.1-STABLE | ||
---|---|---|---|
Product: | Base System | Reporter: | Ivan Klymenko <fidaj> |
Component: | kern | Assignee: | freebsd-fs (Nobody) <fs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | kib |
Priority: | Normal | ||
Version: | 9.1-STABLE | ||
Hardware: | Any | ||
OS: | Any |
Description
Ivan Klymenko
2013-07-03 14:40:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s). 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. In addition to this there may be an issue with the ZFS delete queue as, while after unmounting the nullfs the file entries do disappear the size of the delete queue doesn't seem to clear down properly. Dataset testpool/nullfs [ZPL], ID 40, cr_txg 19, 2.41M, 7 objects ZIL header: claim_txg 0, claim_blk_seq 0, claim_lr_seq 0 replay_seq 0, flags 0x0 Object lvl iblk dblk dsize lsize %full type 0 7 16K 16K 15.0K 32.0M 0.01 DMU dnode -1 1 16K 512 1K 512 100.00 ZFS user/group used -2 1 16K 512 1K 512 100.00 ZFS user/group used 1 1 16K 1K 1K 1K 100.00 ZFS master node 2 1 16K 512 1K 512 100.00 SA master node 3 3 16K 16K 2.38M 7.45M 100.00 ZFS delete queue 4 1 16K 512 1K 512 100.00 ZFS directory 5 1 16K 1.50K 1K 1.50K 100.00 SA attr registration 6 1 16K 16K 7.00K 32K 100.00 SA attr layouts 7 1 16K 512 1K 512 100.00 ZFS directory This is an area I'm not familiar with yet, so it may be this is expected but it should be checked. Regards Steve Author: kib Date: Thu Jul 4 19:01:18 2013 New Revision: 252714 URL: http://svnweb.freebsd.org/changeset/base/252714 Log: The tvp vnode on rename is usually unlinked. Drop the cached null vnode for tvp to allow the free of the lower vnode, if needed. PR: kern/180236 Tested by: smh Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jul 4 18:59:58 2013 (r252713) +++ head/sys/fs/nullfs/null_vnops.c Thu Jul 4 19:01:18 2013 (r252714) @@ -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)); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: open->patched This is now addressed by r252714 (http://svnweb.freebsd.org/changeset/base/252714) in head thanks to kib I confirm - this patch fixes this problem by 9.1-STABLE Thanks to all. PR kern/180236 may be closed. Author: kib Date: Thu Jul 11 04:47:44 2013 New Revision: 253183 URL: http://svnweb.freebsd.org/changeset/base/253183 Log: MFC r252714: The tvp vnode on rename is usually unlinked. Drop the cached null vnode for tvp to allow the free of the lower vnode, if needed. PR: kern/180236 Modified: stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vnops.c Thu Jul 11 03:57:53 2013 (r253182) +++ stable/9/sys/fs/nullfs/null_vnops.c Thu Jul 11 04:47:44 2013 (r253183) @@ -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)); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" This PR can be closed. Thanks! |