Commit Graph

1877 Commits

Author SHA1 Message Date
tkusumi 819d266ed5 autofs: Make autofs(5) timeout messages include affected process name and PID
Sync warning message with FreeBSD and DragonFlyBSD.
taken-from: FreeBSD
2020-03-28 17:29:56 +00:00
reinoud 165933c6be Fix use-after-free issue! 2020-03-21 13:39:31 +00:00
reinoud c0e3afd8a3 Compile in the DPRINTF debug macro's on DEBUG kernels 2020-03-21 13:38:29 +00:00
pgoyette 9120d4511b Use the module subsystem's ability to process SYSCTL_SETUP() entries to
automate installation of sysctl nodes.

Note that there are still a number of device and pseudo-device modules
that create entries tied to individual device units, rather than to the
module itself.  These are not changed.
2020-03-16 21:20:09 +00:00
ad d39cb654b8 tmpfs_inactive(): do like other file systems and truncate the file if it
has been deleted.  Otherwise VFS will try to write cached data "back to
disc", which in the case of a UAO means needless page deactivations and
the resulting TLB shootdowns.
2020-03-14 13:39:36 +00:00
ad f1944288ff tmpfs_reg_resize(): do nothing if newsize == oldsize. 2020-03-14 13:37:49 +00:00
riastradh df1f0e7940 Revert "Include opt_diagnostic.h for DIAGNOSTIC."
This did not do what I thought it did.  opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.
2020-03-05 15:18:54 +00:00
riastradh 57c472be02 Include opt_diagnostic.h for DIAGNOSTIC.
...at least, in header files, which may not have already included
libkern.h.
2020-03-05 08:08:32 +00:00
kamil 3fcf6843f7 Avoid undefined behavior in left shift semantics
hfs_vfsops.c:477:19, left shift of 1 by 31 places cannot be represented in type 'int'
2020-02-28 11:27:38 +00:00
ad bf79731039 Tighten up the locking around vp->v_iflag a little more after the recent
split of vmobjlock & v_interlock.
2020-02-27 22:12:53 +00:00
ad d2a0ebb67a UVM locking changes, proposed on tech-kern:
- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.
2020-02-23 15:46:38 +00:00
ad c2e9cb9413 VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode.  Matches
FreeBSD.
2020-01-17 20:08:06 +00:00
thorpej d6c967bb85 - Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
  functions (naming mirrors that of other time access functions in kern_tc.c).
  It returns the (maybe-converted) value of timebasebin, which also tracks
  our estimate of when the system was booted (i.e. the legacy "boottime" was
  redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes.  At least now the problem is centralized in one location.
2020-01-02 15:42:26 +00:00
ad 5c06357c90 Rename uvm_free() -> uvm_availmem(). 2019-12-31 13:07:09 +00:00
msaitoh a0403cde04 s/transfered/transferred/ 2019-12-27 09:41:48 +00:00
ad ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
tkusumi d3d26a328b autofs: Make /dev/autofs cdevsw functions static
Also less confusing since autofs vnops also has autofs_{open,close} in NetBSD.
2019-12-14 12:01:13 +00:00
pgoyette 8a031a1d1e Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !
2019-12-12 02:15:42 +00:00
riastradh abf4116ae5 Omit obsolete comment and needless __diagused marker. 2019-12-03 04:59:05 +00:00
tkusumi 392c1668b8 autofs: Use NULLVP for NULL vnode
I originally used NULL for NetBSD autofs, but it got mixed up with
NULLVP when merged with NetBSD.
2019-11-26 16:17:31 +00:00
tkusumi 1e27ac1351 autofs: Remove unused autofs_node::an_vnode_lock
Unlike FreeBSD and DragonFlyBSD, this is unused in NetBSD.
2019-11-23 17:13:46 +00:00
tkusumi b5c5b66961 autofs: Don't calculate dirent reclen twice
Taken-from: DragonFlyBSD
2019-11-23 15:17:46 +00:00
tkusumi 7d3af7ae88 autofs: Fix a comment on autofs_args
mount_autofs(8) also uses this.
mount_autofs(8) was added by NetBSD as an optional command (not needed to use autofs).
2019-11-23 08:30:39 +00:00
tkusumi 5957c9625e autofs: u_int -> unsigned int 2019-11-23 08:00:59 +00:00
tkusumi 24b3b34668 autofs: Drop unused autofs_mount field which originates from FreeBSD
Taken-from: DragonFlyBSD
2019-11-23 07:38:03 +00:00
tkusumi 87a0cef204 autofs: Fix change by r1.3 "prevent assert on unmount."
Must delete all nodes on unmount, otherwise automounts with >1 level of directories can't be deleted.
taken-from: FreeBSD and DragonFlyBSD
2019-11-16 09:22:00 +00:00
tkusumi 50e304a6be autofs: Whitespace fix 2019-11-14 08:45:24 +00:00
chs d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
hannken 62dd7866ca When the MFT record size is lower than the cluster size we have
to read consecutive clusters to fill the MFT record.

Should fix PR kern/54598: mount ntfs panic
2019-10-18 08:19:33 +00:00
hannken 5bde8f1cdb It is not possible to call vflush() from xxx_mount().
Replace with a vnode iterator and use vrecycle().
2019-10-18 08:18:40 +00:00
maya cede1cc99c Switch files copyright Reinoud Zandijk from BSD 4 clause to BSD 2 clause.
OK'd by reinoud in email (from 4 Feb 2019).
2019-10-16 21:52:22 +00:00
mrg 24da319951 remove an always false check and its' "This can never happen?" comment. 2019-10-04 12:34:40 +00:00
christos c4ca49101c Fix copying issue that was causing errors in unit_test puffs_tstavfs by
removing code.
2019-09-27 22:36:57 +00:00
christos d23402aa92 provide VNOVALSIZE and VNOVALFLAGS to avoid casting in source. 2019-09-26 20:57:19 +00:00
christos e86444da16 cast VNOVAL to the the va_size type which is u_quad_t... I think it is time
to change this to uint64_t...
2019-09-26 18:35:48 +00:00
christos 38a0431bfa Restore binary compatibility by using the statvfs90 structure internally. 2019-09-23 12:00:57 +00:00
christos 0da0aa0234 Add newly created vnodes to the namei cache. The rest of the filesystems
already did that (or they don't support writing). Discussed in tech-kern.
2019-09-18 17:59:14 +00:00
maxv 1a0e73db20 Fix uninitialized variable: if 'tvp' is NULL, '*tdep' is not initialized.
This could have caused the KASSERT to wrongfully fire.

ok riastradh@
2019-07-14 05:58:44 +00:00
maxv 7b3e694533 Remove the roundups, they are incorrect and cause memcmp to wrongfully fail
because of uninitialized bytes at the end of the buffers.

ok rmind@
2019-07-13 14:24:37 +00:00
maxv 79bc662a91 Fix info leak: zero out the buffer, because it is not entirely filled, and
the uninitialized bytes get copied to userland in sys___getdens30(). Remove
unneeded cast while here.
2019-07-12 17:18:30 +00:00
msaitoh 9ba4df1502 Fix typo in comment (s/seperate/separate/). 2019-06-03 06:04:20 +00:00
pgoyette 8c2f80f160 Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.
2019-03-01 11:06:55 +00:00
hannken 2df7877a09 Set "mnt_lower" before the first file system operation on the new file system. 2019-02-20 10:05:59 +00:00
pgoyette ea4ebbac0d It turns out we do want the puffs compat code in any kernel which
has built-in compat_50 regardless of whether the kernel also has
puffs.

Should finally fix PR kern/53943
2019-02-05 00:22:36 +00:00
wiz df210c015d try '&' instead of '&&' 2019-02-04 14:47:41 +00:00
pgoyette 64733abe1a Don't include puffs_compat in a kernel unless the filesystem is
selected along with COMPAT_50.  Also, don't include puffs_compat
in the main puffs filesystem module;  it is part of the compat_50
module.

Should address PR kern/53943
2019-02-04 12:08:03 +00:00
pgoyette c1283e70fa Normalize all the compat hooks' names to the form
<subsystem>_<function>_<version>_hook

NFCI

XXX Note that although this introduces a change in the kernel-to-
XXX module interface, we are NOT bumping the kernel version number.
XXX We will bump the version number once the interface stabilizes.
2019-01-29 09:28:50 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
maya 09e87bdbc0 Remove bogus code to workaround PCC limitations.
This would print stack garbage, which isn't desirable.
2019-01-05 10:25:11 +00:00
hannken b689ec0f78 Add "void *extra" argument to vcache_new() so a file system may
pass more information about the file to create.

Welcome to 8.99.30
2019-01-01 10:06:54 +00:00