Commit Graph

1841 Commits

Author SHA1 Message Date
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
sevan ffb79aac78 Fix support for case sensitive HFS.
Without this change, the wrong file is returned, if 2 file names contain a
subset of each other.


Code submitted in PR bin/52993 by Harold Gutch
2018-12-30 22:40:00 +00:00
maxv 9cd5bec30f Remove unused mbuf.h includes. 2018-12-10 14:46:24 +00:00
manu 0f1e9886f4 Fix use after RECLAIM in PUFFS filesystems
From hannken@

When puffs_cookie2vnode() misses an entry and vrele() it operations
puffs_vnop_reclaim() and puffs_vnop_fsync() get called with a VNON
vnode.

Do not notify the server in this case as the cookie is stale.
2018-11-06 02:39:49 +00:00
manu 031ff5c667 Add missing mutex pn->pn_sizemtx lock in puffs_vnop_open()
puffs_vnop_open() calls flushvncache(), which calls dosetattr()
if pn->pn_stat has PNODE_METACACHE_MASK. In that case, the lock
on pn->pn_sizemtx is mandatory and asserted.
2018-11-05 02:28:32 +00:00
jdolecek bcc384fdef remove M_CANFAIL flag for malloc(9) - it was completely ignored, so had
actually no effect
2018-10-14 17:37:40 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
msaitoh 61e1eb0d0b - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
  - Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
  use them on all m68k machines.
2018-08-22 01:05:21 +00:00
reinoud 58853ff72b Fix length calculation 2018-08-09 20:30:26 +00:00
reinoud e44c6c6eea Sync with UDFclient 2018-08-09 13:49:30 +00:00
christos ef24a84407 FIx performance regression from rmind@:
Just from a very quick look, it seems like a regression introduced with
the vcache changes: the MP-safe flag is set too late and not inherited
by the root vnode.
2018-08-09 08:43:56 +00:00
kamil 417e06a66d Avoid undefined behavior semantics in msdosfs_fat.c
Do not change signedness bit with left shift.
While there avoid signed integer overflow.
Address both issues with using unsigned type.

msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented in type 'int'
msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented in type 'int'
msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented in type 'int'
msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]'
msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented in type 'int'
msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]'

Detected with micro-UBSan in the user mode.
2018-07-25 22:07:59 +00:00
kamil 982dbcfaff Avoid undefined behavior in ecma167-udf.h
Define the UDF_EXT_* symbols as unsigned values.
This prevents undefined behavior of altering the signedness bit in a part
of them. Swap the remaining symbols to unsigned values to keep the
consistency.

Required by GCC when building with Undefined Behavior Sanitizer.
2018-07-25 19:56:56 +00:00
reinoud 5ed53e53ea Enhance logical volume integrity descriptor handling and provide
bug-compatibility for Linux mkudffs 1.3 images.
2018-07-25 11:09:22 +00:00
maya a50c06709e Remove duplicate ; 2018-06-06 01:49:07 +00:00
chs e406c140eb add a genfs method to allow a file system to limit the range of pages
that are given to a single GOP_WRITE() call.  needed by ZFS.
2018-05-28 21:04:37 +00:00
chs 0656708806 allow tmpfs files to be larger than 4GB. 2018-05-28 21:04:35 +00:00
maxv 3c78537229 Fix inverted arguments in MGET(). 2018-04-26 19:27:04 +00:00
christos 87fd18f8e5 s/static inline/static __inline/g for consistency. 2018-04-19 21:50:06 +00:00
dholland 32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
maxv 9c3b74aee7 Remove unused (and a reference to ovbcopy along the way). 2018-02-01 17:22:45 +00:00
christos 05b75fe4b1 CID-1428639: make sure we always initialiaze hash, because if ultimately
the file is not found and we end up looping we need them.
2018-01-28 15:48:44 +00:00
sevan 87ebd86e7f Need strings.h for ffs()
Resolves implict declaration warning of ffs() when building tools via build.sh
2018-01-27 03:54:01 +00:00
christos 87d09387b3 support getargs, fix flush, fix mutex_destroy 2018-01-14 22:43:18 +00:00
christos 36038078db prevent assert on unmount. 2018-01-13 22:06:21 +00:00
christos 0d40f5669e fix module attachment and cdevsw 2018-01-09 16:19:39 +00:00
martin 602913a78d Include <sys/atomic.h> for the atomic funtions used in here. 2018-01-09 13:56:00 +00:00
christos b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
mlelstv d8f0582ef8 relax sanity check. It's ok to have more FAT sectors than needed. 2017-11-27 15:02:05 +00:00
maya 18b796d442 Use C99 initializer for filterops
Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};
2017-10-25 08:12:37 +00:00
skrll b240eba556 Remove some unnecessary duplicatioN 2017-08-27 06:18:16 +00:00
mlelstv 5815ca8f4d Add more sanity checks for BPB parameters. Handle FAT12 format for media
with sectors >= 32kByte.

Does fix PR 52485.
2017-08-20 11:48:15 +00:00
hannken 76aa2ae1d5 Make union_newlower() ans union_newupper() local to union_subr.c,
expand and remove union_updatevp() and take care to transfer the
vnode lock from the union vnode to its new upper vnode without
breaking the fstrans state.

Add assertions that un_lowervp and un_uppervp never change from
non-NULL to non-NULL.
2017-07-17 09:22:36 +00:00
hannken 5985f10515 No need to call vflush from failing udf_mount(). If the system nodes
really have to disappear we should change vrele() to vrecycle() here.
2017-06-24 12:13:16 +00:00
chs fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
hannken 5dc331fb8e When a vnode has an invalid type because the type changed on the
server replace vgone() with new operation smbfs_uncache() that
removes the vnode from the name cache and changes the vcache key
to an unique and illegal key to prevent further lookups.
2017-05-28 16:36:37 +00:00
riastradh 93562e3f53 Eliminate crusty debugging sludge.
We have a mostly sane vnode lifecycle now.  If this needs debugging,
it should be done once at the call site of VOP_RECLAIM.
2017-05-26 14:34:19 +00:00