Commit Graph

229 Commits

Author SHA1 Message Date
Alan Somers
3f2c630c74 fusefs: implement attribute cache timeouts
The FUSE protocol allows the server to specify the timeout period for the
client's attribute and entry caches.  This commit implements the timeout
period for the attribute cache.  The entry cache's timeout period is
currently disabled because it panics, and is guarded by the
vfs.fusefs.lookup_cache_expire sysctl.

PR:		235773
Reported by:	cem
Sponsored by:	The FreeBSD Foundation
2019-04-09 00:47:38 +00:00
Alan Somers
cad677915f fusefs: cache file attributes
FUSE_LOOKUP, FUSE_GETATTR, FUSE_SETATTR, FUSE_MKDIR, FUSE_LINK,
FUSE_SYMLINK, FUSE_MKNOD, and FUSE_CREATE all return file attributes with a
cache validity period.  fusefs will now cache the attributes, if the server
returns a non-zero cache validity period.

This change does _not_ implement finite attr cache timeouts.  That will
follow as part of PR 235773.

PR:		235775
Reported by:	cem
Sponsored by:	The FreeBSD Foundation
2019-04-08 18:45:41 +00:00
Alan Somers
caf5f57d2d fusefs: implement VOP_ACCESS
VOP_ACCESS was never fully implemented in fusefs.  This change:
* Removes the FACCESS_DO_ACCESS flag, which pretty much disabled the whole
  vop.
* Removes a quixotic special case for VEXEC on regular files.  I don't know
  why that was in there.
* Removes another confusing special case for VADMIN.
* Removes the FACCESS_NOCHECKSPY flag.  It seemed to be a performance
  optimization, but I'm unconvinced that it was a net positive.
* Updates test cases.

This change does NOT implement -o default_permissions.  That will be handled
separately.

PR:		236291
Sponsored by:	The FreeBSD Foundation
2019-04-05 18:37:48 +00:00
Alan Somers
efa23d9784 fusefs: enforce -onoallow_other even beneath the mountpoint
When -o allow_other is not in use, fusefs is supposed to prevent access to
the filesystem by any user other than the one who owns the daemon.  Our
fusefs implementation was only enforcing that restriction at the mountpoint
itself.  That was usually good enough because lookup usually descends from
the mountpoint.  However, there are cases when it doesn't, such as when
using openat relative to a file beneath the mountpoint.

PR:		237052
Sponsored by:	The FreeBSD Foundation
2019-04-05 17:21:23 +00:00
Alan Somers
140bb4927a fusefs: correctly return EROFS from VOP_ACCESS
Sponsored by:	The FreeBSD Foundation
2019-04-05 15:33:43 +00:00
Alan Somers
46c37cd0d7 fusefs: reenable some fsyncdir tests
These tests were actually fixed by r345398, r345390 and r345392, but I
neglected to reenable them.  Too bad googletest doesn't have the notion of
an Expected Failure like ATF does.

PR:		236474, 236473
Sponsored by:	The FreeBSD Foundation
2019-04-05 15:04:25 +00:00
Alan Somers
a7e81cb3db fusefs: properly handle FOPEN_KEEP_CACHE
If a fuse file system returne FOPEN_KEEP_CACHE in the open or create
response, then the client is supposed to _not_ clear its caches for that
file.  I don't know why clearing the caches would be the default given that
there's a separate flag to bypass the cache altogether, but that's the way
it is.  fusefs(5) will now honor this flag.

Our behavior is slightly different than Linux's because we reuse file
handles.  That means that open(2) wont't clear the cache if there's a
reusable file handle, even if the file server wouldn't have sent
FOPEN_KEEP_CACHE had we opened a new file handle like Linux does.

PR:		236560
Sponsored by:	The FreeBSD Foundation
2019-04-04 20:30:14 +00:00
Alan Somers
12292a99ac fusefs: correctly handle short writes
If a FUSE daemon returns FOPEN_DIRECT_IO when a file is opened, then it's
allowed to write less data than was requested during a FUSE_WRITE operation
on that file handle.  fusefs should simply return a short write to userland.

The old code attempted to resend the unsent data.  Not only was that
incorrect behavior, but it did it in an ineffective way, by attempting to
"rewind" the uio and uiomove the unsent data again.

This commit correctly handles short writes by returning directly to
userland if FOPEN_DIRECT_IO was set.  If it wasn't set (making the short
write technically a protocol violation), then we resend the unsent data.
But instead of rewinding the uio, just resend the data that's already in the
kernel.

That necessitated a few changes to fuse_ipc.c to reduce the amount of bzero
activity.  fusefs may be marginally faster as a result.

PR:		236381
Sponsored by:	The FreeBSD Foundation
2019-04-04 16:51:34 +00:00
Alan Somers
35cf0e7e56 fusefs: fix a panic in VOP_READDIR
The original fusefs import, r238402, contained a bug in fuse_vnop_close that
could close a directory's file handle while there were still other open file
descriptors.  The code looks deliberate, but there is no explanation for it.
This necessitated a workaround in fuse_vnop_readdir that would open a new
file handle if, "for some mysterious reason", that vnode didn't have any
open file handles.  r345781 had the effect of causing the workaround to
panic, making the problem more visible.

This commit removes the workaround and the original bug, which also fixes
the panic.

Sponsored by:	The FreeBSD Foundation
2019-04-03 20:57:43 +00:00
Alan Somers
9f10f423a9 fusefs: send FUSE_FLUSH during VOP_CLOSE
The FUSE protocol says that FUSE_FLUSH should be send every time a file
descriptor is closed.  That's not quite possible in FreeBSD because multiple
file descriptors can share a single struct file, and closef doesn't call
fo_close until the last close.  However, we can still send FUSE_FLUSH on
every VOP_CLOSE, which is probably good enough.

There are two purposes for FUSE_FLUSH.  One is to allow file systems to
return EIO if they have an error when writing data that's cached
server-side.  The other is to release POSIX file locks (which fusefs(5) does
not yet support).

PR:		236405, 236327
Sponsored by:	The FreeBSD Foundation
2019-04-03 19:59:45 +00:00
Alan Somers
e312493b37 fusefs: during ftruncate, discard cached data past truncation point
During truncate, fusefs was discarding entire cached blocks, but it wasn't
zeroing out the unused portion of a final partial block.  This resulted in
reads returning stale data.

PR:		233783
Reported by:	fsx
Sponsored by:	The FreeBSD Foundation
2019-04-03 02:29:56 +00:00
Alan Somers
4eb8481630 fusefs: check return value of wait(2) in fork tests
Reported by:	ngie
Sponsored by:	The FreeBSD Foundation
2019-04-02 18:44:01 +00:00
Alan Somers
99878c75e3 Respond to ngie's comments in D19752
Better Makefile syntax.

Note that this commit is to the project branch, but the review concerns the
merge to head.

Sponsored by:	The FreeBSD Foundation
2019-04-01 23:37:21 +00:00
Alan Somers
f8d4af104b fusefs: send FUSE_OPEN for every open(2) with unique credentials
By default, FUSE performs authorization in the server.  That means that it's
insecure for the client to reuse FUSE file handles between different users,
groups, or processes.  Linux handles this problem by creating a different
FUSE file handle for every file descriptor.  FreeBSD can't, due to
differences in our VFS design.

This commit adds credential information to each fuse_filehandle.  During
open(2), fusefs will now only reuse a file handle if it matches the exact
same access mode, pid, uid, and gid of the calling process.

PR:		236844
Sponsored by:	The FreeBSD Foundation
2019-04-01 20:42:15 +00:00
Alan Somers
363a74163b fusefs: allow opening files O_EXEC
O_EXEC is useful for fexecve(2) and fchdir(2).  Treat it as another fufh
type alongside the existing RDONLY, WRONLY, and RDWR.  Prior to r345742 this
would've caused a memory and performance penalty.

PR:		236329
Sponsored by:	The FreeBSD Foundation
2019-04-01 16:36:02 +00:00
Alan Somers
208070583f fusefs: add another regression test for bug 236844
This test shows how bug 236844 can lead to a privilege escalation when used
with the -o allow_other mount option.

PR:		236844
Sponsored by:	The FreeBSD Foundation
2019-03-30 17:24:11 +00:00
Alan Somers
5fccbf313a fusefs: don't force direct io for files opened O_WRONLY
Previously fusefs would treat any file opened O_WRONLY as though the
FOPEN_DIRECT_IO flag were set, in an attempt to avoid issuing reads as part
of a RMW write operation on a cached part of the file.  However, the FUSE
protocol explicitly allows reads of write-only files for precisely that
reason.

Sponsored by:	The FreeBSD Foundation
2019-03-30 00:57:07 +00:00
Alan Somers
4b97bb009b fusefs: fix more tests when data caching is disabled
readahead is also disallowed when data_cache_mode=0.  This should've been
part of r345720.

Sponsored by:	The FreeBSD Foundation
2019-03-30 00:54:01 +00:00
Alan Somers
f3b5de2918 fusefs: fix tests when data caching is disabled
VOP_GETPAGES is disabled when vfs.fusefs.data_cache_mode=0, causing mmap to
return success but accessing the mapped memory will subsequently segfault.

Sponsored by:	The FreeBSD Foundation
2019-03-30 00:35:59 +00:00
Alan Somers
2d445be156 fusefs: test that open(2) can return a writable fd for a readonly file
Surprisingly, open(..., O_WRONLY | O_CREAT, 0444) should work.  POSIX
requires it.  But it didn't work in early FUSE implementations.  Add a
regression test so that our FUSE driver doesn't make the same mistake.

Sponsored by:	The FreeBSD Foundation
2019-03-29 21:52:10 +00:00
Alan Somers
61c225f92c fusefs: fix test build after r345645
It's no longer necessary to add GTESTS_CXXFLAGS to CXXFLAGS

Sponsored by:	The FreeBSD Foundation
2019-03-29 14:19:31 +00:00
Alan Somers
42d50d16e2 fusefs: add a regression test for bug 236844
fusefs should send a FUSE_OPEN for every open(2) so the daemon can validate
accesses.

PR:		236844
Sponsored by:	The FreeBSD Foundation
2019-03-28 03:30:04 +00:00
Alan Somers
09c01e67de fusefs: deduplicate code in the allow_other test
Sponsored by:	The FreeBSD Foundation
2019-03-28 01:12:44 +00:00
Alan Somers
126769b7d1 fusefs: fix a resource leak in the allow_other tests
Sponsored by:	The FreeBSD Foundation
2019-03-28 00:25:57 +00:00
Alan Somers
477c462834 fusefs: correct mmap()'s return value in the allow_other test
Also, properly cleanup the semaphore.

Reported by:	ngie
Sponsored by:	The FreeBSD Foundation
2019-03-27 03:02:54 +00:00
Alan Somers
e0bec057db fusefs: correctly set fuse_release_in.flags in an error path
fuse_vnop_create must close the newly created file if it can't allocate a
vnode.  When it does so, it must use the same file flags for FUSE_RELEASE as
it used for FUSE_OPEN or FUSE_CREATE.

Reported by:	Coverity
Coverity CID:	1066204
Sponsored by:	The FreeBSD Foundation
2019-03-27 02:57:59 +00:00
Alan Somers
4a4282cb06 FUSEFS: during FUSE_READDIR, set the read size correctly.
The old formula was unnecessarily restrictive.

Sponsored by:	The FreeBSD Foundation
2019-03-27 02:01:34 +00:00
Alan Somers
13eaa5fadc fusefs: fix a race condition in the allow_other test
The test could occasionally hang if the parent's SIGUSR2 signal arrived
before the child had pause()d.  Using POSIX semaphores precludes that
possibility.

Sponsored by:	The FreeBSD Foundation
2019-03-27 00:24:57 +00:00
Alan Somers
19ef317d62 fusefs: fallback to MKNOD/OPEN if a filesystem doesn't support CREATE
If a FUSE filesystem returns ENOSYS for FUSE_CREATE, then fallback to
FUSE_MKNOD/FUSE_OPEN.

Also, fix a memory leak in the error path of fuse_vnop_create.  And do a
little cleanup in fuse_vnop_open.

PR:		199934
Reported by:	samm@os2.kiev.ua
Sponsored by:	The FreeBSD Foundation
2019-03-23 00:22:29 +00:00
Alan Somers
bf4d70841f fusefs: support VOP_MKNOD
PR:		236236
Sponsored by:	The FreeBSD Foundation
2019-03-22 19:08:48 +00:00
Alan Somers
6248288e97 fusefs: correctly handle cacheable negative LOOKUP responses
The FUSE protocol allows for LOOKUP to return a cacheable negative response,
which means that the file doesn't exist and the kernel can cache its
nonexistence.  As of this commit fusefs doesn't cache the nonexistence, but
it does correctly handle such responses.  Prior to this commit attempting to
create a file, even with O_CREAT would fail with ENOENT if the daemon
returned a cacheable negative response.

PR:		236231
Sponsored by:	The FreeBSD Foundation
2019-03-21 23:31:10 +00:00
Alan Somers
915012e0d0 fusefs: Don't treat fsync the same as fdatasync
For an unknown reason, fusefs was _always_ sending the fdatasync operation
instead of fsync.  Now it correctly sends one or the other.

Also, remove the Fsync.fsync_metadata_only test, along with the recently
removed Fsync.nop.  They should never have been added.  The kernel shouldn't
keep track of which files have dirty data; that's the daemon's job.

PR:		236473
Sponsored by:	The FreeBSD Foundation
2019-03-21 23:01:56 +00:00
Alan Somers
cc34f2f66a fusefs: VOP_FSYNC should be synchronous
returning asynchronously pretty much defeats the point of fsync

PR:		236474
Sponsored by:	The FreeBSD Foundation
2019-03-21 21:53:55 +00:00
Alan Somers
44dc9245e7 fusefs: don't check for the fusefs module during the tests
It's sufficient to check for /dev/fuse.  And due to bug 236647, the module
could be named either fuse or fusefs.

PR:		236647
Sponsored by:	The FreeBSD Foundation
2019-03-21 21:41:07 +00:00
Alan Somers
91ff3a0d3d fusefs: add a test case for the allow_other mount option
Also, fix one of the default_permissions test cases.  I forgot the
expectation for FUSE_ACCESS, because that doesn't work right now.

Sponsored by:	The FreeBSD Foundation
2019-03-21 19:56:33 +00:00
Alan Somers
9821f1d323 fusefs: adapt the tests to the fuse => fusefs rename
Sponsored by:	The FreeBSD Foundation
2019-03-21 00:11:43 +00:00
Alan Somers
4f1543f359 fuse(4): use GTEST_SKIP in the tests
Now the entire fuse test suite can "pass", or at least not fail.  Skipped
tests are reported to Kyua as passes, because googletest is still using
Kyua's plain test adapter.

Sponsored by:	The FreeBSD Foundation
2019-03-20 20:36:46 +00:00
Alan Somers
197f8aac00 fuse(4): fix a race condition in the tests
Sometimes the fuse daemon doesn't die as soon as its /dev/fuse file
descriptor is closed; it needs to be unmounted first.

Sponsored by:	The FreeBSD Foundation
2019-03-20 16:08:07 +00:00
Alan Somers
b2e95f1ce5 fuse(4): build the tests with the new googletest in base
Sponsored by:	The FreeBSD Foundation
2019-03-19 03:10:13 +00:00
Alan Somers
93d9f5818a fuse(4): add tests for some mount options.
This commit adds tests for the default_permissions and push_symlinks_in
mount options.  It doesn't add tests for allow_other, because I'm not sure
how that will interact with Kyua (the test will need to drop privileges).
All of the other mount options are undocumented.

PR:		216391
Sponsored by:	The FreeBSD Foundation
2019-03-18 18:05:19 +00:00
Alan Somers
51786f270d fuse(4): add tests for the FOPEN_KEEP_CACHE option
PR:		236560
Sponsored by:	The FreeBSD Foundation
2019-03-15 22:47:20 +00:00
Alan Somers
48f58d58cf fuse(4): add tests for the FUSE_ASYNC_READ option
Sponsored by:	The FreeBSD Foundation
2019-03-15 20:16:35 +00:00
Alan Somers
71885041ce fuse(4): add tests for ENOSYS special cases
PR:		236557
Sponsored by:	The FreeBSD Foundation
2019-03-15 18:06:51 +00:00
Alan Somers
9038479127 fuse(4): combine common code in the tests
Sponsored by:	The FreeBSD Foundation
2019-03-15 17:04:33 +00:00
Alan Somers
9ae9282e95 fuse(4): add some miscellaneous test cases that I had overlooked
* Test that FUSE_FLUSH and FUSE_RELEASE release POSIX file locks
* Test that FUSE_SETATTR's attr caching feature works
* Fix some minor mistakes in the posix file lock tests

Sponsored by:	The FreeBSD Foundation
2019-03-15 16:16:50 +00:00
Alan Somers
4da6e8cef1 fuse(4): add tests for FUSE_DESTROY, FUSE_FORGET, and unlinking open files
Sponsored by:	The FreeBSD Foundation
2019-03-15 14:49:27 +00:00
Alan Somers
0b6ee94ad5 fuse(4): add tests for extended attributes
Sponsored by:	The FreeBSD Foundation
2019-03-14 23:05:59 +00:00
Alan Somers
94ef9d62cc fuse(4): add tests for FUSE_INTERRUPT
This required changing the way that all operations are mocked.  Previously
MockFS::process had one input argument and one output argument.  Now, it
returns a vector of zero or more responses.  This allows tests to simulate
conditions where the filesystem daemon has a queue depth > 1.

PR:		236530
Sponsored by:	The FreeBSD Foundation
2019-03-14 17:20:24 +00:00
Alan Somers
3592c9fe12 fuse(4) tests: minor tweaks
* better debugging for FUSE_SETATTR
* Move a big variable from stack to heap

Sponsored by:	The FreeBSD Foundation
2019-03-14 15:07:46 +00:00
Alan Somers
b6e5e8cf5b fuse(4): skip the Write.append test unless vfs.fuse.sync_resize==0
Sponsored by:	The FreeBSD Foundation
2019-03-14 14:59:59 +00:00
Alan Somers
0e125f5ff8 fuse(4): combine common code in the tests
Combine a bunch of mostly similar expect_* methods into utils.cc, and only
define FH in a single place.

Sponsored by:	The FreeBSD Foundation
2019-03-14 00:12:59 +00:00
Alan Somers
ef61047a9b fuse(4): add tests for POSIX file locking operations
PR:		234581
Sponsored by:	The FreeBSD Foundation
2019-03-13 22:16:00 +00:00
Alan Somers
1bb6c55076 fues(4): add tests for FUSE_RELEASEDIR
Sponsored by:	The FreeBSD Foundation
2019-03-13 13:41:05 +00:00
Alan Somers
0f10547be1 fuse(4): add tests for opendir and readdir
Sponsored by:	The FreeBSD Foundation
2019-03-12 22:25:59 +00:00
Alan Somers
4459896e18 fuse(4): add tests for FUSE_OPENDIR, FUSE_FSYNC, and FUSE_FSYNCDIR
And one more for FUSE_WRITE, too.

PR:		236379
PR:		236473
PR:		236474
Sponsored by:	The FreeBSD Foundation
2019-03-11 22:29:56 +00:00
Alan Somers
da1200c90f Update copyright info in fuse tests
* Add SPDX tags
* Remove "All Rights Reserved", with permission of emaste (FBSD Foundation)

Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
2019-03-11 19:10:48 +00:00
Alan Somers
e825cfb775 fuse(4): add tests for FUSE_READ
PR:		236379
PR:		236466
PR:		236472
Sponsored by:	The FreeBSD Foundation
2019-03-11 18:28:20 +00:00
Alan Somers
e071c64b4c fuse(4): Add some tests for FUSE_FLUSH
PR:		236405
Sponsored by:	The FreeBSD Foundation
2019-03-08 23:07:51 +00:00
Alan Somers
1d882fd6a1 fuse(4): add tests for FUSE_WRITE and FUSE_RELEASE
And a few definitions needed for upcoming FUSE_READ tests

Sponsored by:	The FreeBSD Foundation
2019-03-08 19:01:31 +00:00
Alan Somers
c2e7dba7f8 fuse(4): add tests relating to open(2) flags
Sponsored by:	The FreeBSD Foundation
2019-03-07 18:12:34 +00:00
Alan Somers
c7c8f59051 fuse(4): add tests for unlink, rmdir, and statfs
Also, combine some common code for sending cacheable negative lookup
responses.

Sponsored by:	The FreeBSD Foundation
2019-03-06 00:38:10 +00:00
Alan Somers
9b4318e553 fuse(4): add test cases for FUSE_LINK and FUSE_RENAME
Also, add a FUSE_LOOKUP test case for subdirectories, and improve debugging
output.

Sponsored by:	The FreeBSD Foundation
2019-03-05 21:40:08 +00:00
Alan Somers
50deb1a8c2 fuse(4): add tests for FUSE_MKDIR and FUSE_ACCESS
PR:		236291
PR:		236231
Sponsored by:	The FreeBSD Foundation
2019-03-05 18:53:28 +00:00
Alan Somers
76effb87dc fuse(4): combine some common code in the tests
Sponsored by:	The FreeBSD Foundation
2019-03-05 03:27:32 +00:00
Alan Somers
4cbb4f8886 fuse(4): add tests related to FUSE_MKNOD
PR:		236236
Sponsored by:	The FreeBSD Foundation
2019-03-05 00:27:54 +00:00
Alan Somers
99fe8368c2 fuse(4): add tests for CREATE, OPEN, READLINK, SETATTR and SYMLINK
The new SETATTR tests deal with already-open files.

PR:		235775
PR:		236231
Sponsored by:	The FreeBSD Foundation
2019-03-04 22:07:33 +00:00
Alan Somers
2343311052 fuse(4): fix the entry_cache_negative_timeout test
I committed too soon in r344775; the test actually passes when I write it
correctly.

PR:		236226
Sponsored by:	The FreeBSD Foundation
2019-03-04 22:03:09 +00:00
Alan Somers
56f07a9855 fuse(4): add tests for negative lookups
PR:		236226
Sponsored by:	The FreeBSD Foundation
2019-03-04 19:10:22 +00:00
Alan Somers
8eeb82e169 fuse(4) use a global environment check.
This is marginally faster than using an environment check in each test case.
Also, if the global check fails then all of the tests are skipped.  Oddly,
it's not possible to skip a test in any other way.

Also, allow the test to run as a normal user if vfs.usermount=1 and
/dev/fuse is accessible.

Reported by:	ngie
Sponsored by:	The FreeBSD Foundation
2019-03-02 16:28:29 +00:00
Alan Somers
7716c35f77 Add some fuse(4) tests for FUSE_SETATTR
Sponsored by:	The FreeBSD Foundation
2019-03-02 15:32:20 +00:00
Alan Somers
44154e682a Begin a fuse(4) test suite
It only tests the kernel portion of fuse, not the userspace portion (which
comes from sysutils/fusefs-libs).  The kernel-userspace interface is
de-facto standardized, and this test suite seeks to validate FreeBSD's
implementation.

It uses GoogleMock to substitute for a userspace daemon and validate the
kernel's behavior in response to filesystem access.  GoogleMock is
convenient because it can validate the order, number, and arguments of each
operation, and return canned responses.

But that also means that the test suite must use GoogleTest, since
GoogleMock is incompatible with atf-c++ and atf.test.mk does not allow C++
programs to use atf-c.

This commit adds the first 10 test cases out of an estimated 130 total.

PR:		235775, 235773
Sponsored by:	The FreeBSD Foundation
2019-03-01 23:53:05 +00:00
Alan Somers
8cadd66d98 Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967
In r321967 ngie "fixed" these tests by changing their expectations to match
the device numbers produced by the new ino64 code.  But it wasn't the tests
that were broken, it was the kernel.  bde fixed the kernel in r335053.

Reported by:	Jenkins
MFC after:	Never (only applies to >= 12)
2018-07-21 20:14:01 +00:00
Bryan Drewery
3806950135 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:04:07 +00:00
Enji Cooper
acc33f3de9 Chase r321920 and r321930 (dev_t being widened)
The layout of st_rdev has changed after this commit, and assumptions made
in the NetBSD tests are no longer valid. Change the hardcoded assumed
values to account for the fact that major/minor are now represented by
64 bits as opposed to the less precise legacy precision of 16 bits.

PR:	221048
Relnotes: st_rdev layout changed; warning about impact of r321920 to
	  downstream consumers
2017-08-03 03:43:41 +00:00
Enji Cooper
99429157e8 sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
The previous logic was flawed in the sense that it assumed that /dev/md3
was always available. This was a caveat I noted in r306038, that I hadn't
gotten around to solving before now.

Cache the device for the mountpoint after executing mdmfs, then use the
cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
device.

Apply sed expressions to use reuse logic in the NetBSD code that could
also be applied to FreeBSD, just with different tools.

Differential Revision:	D10766
MFC after:	1 week
Reviewed by:	bdrewery
Sponsored by:	Dell EMC Isilon
2017-05-19 17:14:29 +00:00
Enji Cooper
183ae521e5 Use _SED instead of hacking tests rewriting mknod ... p as mkfifo
Similar to r312297
2017-01-16 17:53:58 +00:00
Enji Cooper
267f10b14c Use _SED to rewrite mknod ... p command as mkfifo instead of
adding an unnecessary diff to the test
2017-01-16 17:49:53 +00:00
Enji Cooper
4944940b4e Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/...
The primary goal for doing this is to leverage the work done in r312114
for enabling WARNS to address trivial code quality issues with new tests

MFC after:	6 days
Tested with:	make tinderbox
Sponsored by:	Dell EMC Isilon
2017-01-14 20:21:21 +00:00
Enji Cooper
669c253531 Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-10-21 05:24:08 +00:00