Commit Graph

1886 Commits

Author SHA1 Message Date
tkusumi 02e6d0f660 autofs: Silence down a warning which should really be a debug message
taken-from: FreeBSD
2020-04-26 17:00:31 +00:00
ad f5ad84fdb3 PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)
- Add new flag UBC_ISMAPPED which tells ubc_uiomove() the object is mmap()ed
  somewhere.  Use it to decide whether to do direct-mapped copy, rather than
  poking around directly in the vnode in ubc_uiomove(), which is ugly and
  doesn't work for tmpfs.  It would be nicer to contain all this in UVM but
  the filesystem provides the needed locking here (VV_MAPPED) and to
  reinvent that would suck more.

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS().  Pass in UBC_ISMAPPED where
  appropriate.
2020-04-23 21:47:07 +00:00
jdolecek 2772b95a43 fix obvious typo in error handling - buf error should go to b_error 2020-04-23 09:58:37 +00:00
reinoud 0376c5faf1 Move comment related to the sysctl_createv() in SYSCTL_SETUP() from the old
place to the new place too.
2020-04-14 12:47:44 +00:00
reinoud b3745214b9 fix debug print flag 2020-04-14 11:45:42 +00:00
ad 23bf88000c Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed().  Signature matches
FreeBSD.
2020-04-13 19:23:17 +00:00
hannken aa1a83f41d udf_get_node(): fix typo and honor "lktype" argument. 2020-04-06 14:31:06 +00:00
ad c90f9c8c81 Merge the remaining changes from the ad-namecache branch, affecting namei()
and getcwd():

- push vnode locking back as far as possible.
- do most lookups directly in the namecache, avoiding vnode locks & refs.
- don't block new refs to vnodes across VOP_INACTIVE().
- get shared locks for VOP_LOOKUP() if the file system supports it.
- correct lock types for VOP_ACCESS() / VOP_GETATTR() in a few places.

Possible future enhancements:

- make the lookups lockless.
- support dotdot lookups by being lockless and inferring absence of chroot.
- maybe make it work for layered file systems.
- avoid vnode references at the root & cwd.
2020-04-04 20:49:30 +00:00
jdolecek 1e03bcd0cf remove SMBFS and nsmb(4) - kernel part
it's unmaintained and supports only obsolete SMB1
2020-04-04 15:43:21 +00:00
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