Summary: | [nullfs] nullfs don't release i-nodes on unlink. | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Goran Lowkrantz <goran.lowkrantz> | ||||
Component: | kern | Assignee: | freebsd-fs (Nobody) <fs> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | kib, leres, noah.bergbauer | ||||
Priority: | Normal | ||||||
Version: | 9.1-STABLE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Goran Lowkrantz
2013-04-29 15:50:00 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s). This PR is tagged 9.1-STABLE, but I just rediscovered this issue on 10.2-RELEASE. Easiest repro I could find: # preparation mkdir /testbed cd /testbed mkdir tmpmnt nullmnt mount -t tmpfs -o rw,size=10240 tmptestbed /testbed/tmpmnt/ # test 1 mount_nullfs /testbed/tmpmnt/ /testbed/nullmnt/ df -hi | grep testbed dd if=/dev/zero of=nullmnt/testfile # to fill up the tmpfs df -hi | grep testbed # the filesystem is now full rm nullmnt/testfile df -hi | grep testbed # bug: the filesystem is still full umount /testbed/nullmnt df -hi | grep testbed # the inode is released only once the nullfs is unmounted # test 2: nocache mount_nullfs -o nocache /testbed/tmpmnt/ /testbed/nullmnt/ df -hi | grep testbed dd if=/dev/zero of=nullmnt/testfile rm nullmnt/testfile df -hi | grep testbed # everything is working properly here umount /testbed/nullmnt So a standard nullfs mount is unusable for long-term operation. I've only found out about the nocache option from an old mailing list post related to this PR, so after 2.5 years without a fix a note about this workaround on the manpage would be great. Created attachment 164869 [details]
Force reclaim of the upper vnode on unlink.
A commit references this bug: Author: kib Date: Wed Dec 30 19:49:22 UTC 2015 New revision: 292961 URL: https://svnweb.freebsd.org/changeset/base/292961 Log: Force nullfs vnode reclaim after unlinking, to potentially unlink lower vnode. Otherwise, reference to the lower vnode from the upper one prevents final unlink. PR: 178238 Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Changes: head/sys/fs/nullfs/null_vnops.c A commit references this bug: Author: pho Date: Wed Dec 30 20:15:30 UTC 2015 New revision: 292962 URL: https://svnweb.freebsd.org/changeset/base/292962 Log: Added a regression test. PR: 178238 Sponsored by: EMC / Isilon storage division Changes: user/pho/stress2/misc/nullfs16.sh This patch does not appear to be in base/stable/9 as of r309554. Would it be possible to add it? I have a 9 system that "fills up" a nullfs mount about a month after a reboot when I update and don't remember to re-apply the patch. Thanks! A commit references this bug: Author: kib Date: Tue Dec 6 10:37:28 UTC 2016 New revision: 309609 URL: https://svnweb.freebsd.org/changeset/base/309609 Log: MFC r292961, r295717: Force nullfs vnode reclaim after unlinking and directory removal. PR: 178238 Changes: _U stable/9/ _U stable/9/sys/ _U stable/9/sys/fs/ stable/9/sys/fs/nullfs/null_vnops.c |