Commit Graph

1606 Commits

Author SHA1 Message Date
manu
2a5ce25ed0 If we truncate the file, make sure we zero-fill the end of the last
page, otherwise if the file is later truncated to a larger size
(creating a hole), that area will not return zeroes as it should.
2014-10-05 07:53:22 +00:00
hannken
e716e7d8d6 Change filecore to vcache.
Compile-tested only, was not able to get my hands on a readable fs image.
2014-10-04 13:27:24 +00:00
hannken
f401fa494c Fix the puffs_sop_thread -> puffs_cookie2vnode path:
- pass the cookie by reference
- add missing mutex_exit()
- update assertion for VNON typed vnodes
2014-09-30 10:15:03 +00:00
reinoud
ef40ac265a Fix bug introduced in last patch 2014-09-17 21:18:43 +00:00
reinoud
79652a00ee As pointed out by wiz@ prevent a possible attack or corruption that results in
an endless loop of indirect descriptors being processed.

The number of indirect descriptors followed is now maximized.
While here, also fix a use-after-free bug!
2014-09-17 19:47:05 +00:00
manu
209370b3d8 PUFFS fixes for size update ater write plus read/write sanity checks
- Always update kernel metadata cache for size when writing
  This fixes situation where size update after appending to a file lagged
- Make read/write nilpotent when called with null size, as FFS does
- Return EFBIG instead of EINVAL for negative offsets, as FFS does
2014-09-11 07:59:14 +00:00
gson
1b265e6701 Store symlinks without a NUL terminator so that lstat(2) returns the
correct length.  Fixes the tmpfs part of PR kern/48864.
2014-09-08 14:49:46 +00:00
manu
08a33828ae When changing a directory content, update the ctime/mtime in kernel cache,
otherwise the updated ctime/mtime appears after the cached entry expire.
2014-09-05 15:39:18 +00:00
matt
82ef6ef7b8 Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:26:16 +00:00
matt
2b8e56db05 Don't use C++ class and this keywords as variables. 2014-09-05 05:39:52 +00:00
martin
3c93e210ff Make msdosfs time conversion use the y/m/d/h/m/s conversion functions
from clock_subr.c and compile that into the userland (and tools)
makefs as well.
2014-09-01 09:09:47 +00:00
hannken
accb62aedc Change puffs from hashlist to vcache.
- field "pa_nhashbuckets" of struct "puffs_kargs" becomes a no-op.
  and should be removed on the next protocol version bump.
2014-08-28 08:29:50 +00:00
maxv
5f2f7d8e15 Remove dead returns:
return VAR/func(XX);
	return VAR;

The latter is never reached. Sent on tech-kern@, no disagreement.
2014-08-21 06:40:35 +00:00
manu
7642144c05 Add a oflags input field to open requests so that the filesystem can pass
back information about the file. Implement PUFFS_OPEN_IO_DIRECT, which
will force direct IO (bypassing page cache) for the file.
2014-08-16 16:19:41 +00:00
hannken
b041904f72 Needs HASH_SLIST, not HASH_LIST. 2014-08-16 07:22:30 +00:00
hannken
912cfee7bf Change ptyfs to vcache.
- Use (type, minor) as key.
- Change ptyfs_allocvp to return a referenced vnode and lock where needed.
- Remove unneeded vnode backpointer ptyfs_vnode.
- Keep a single hashlist for pty nodes to make their attributes persistent.

OK: Christos Zoulas
2014-08-15 13:40:39 +00:00
maxv
b0e4602c25 Overflow if *data_len == OSIZE and args->version >= PTYFS_ARGSVERSION.
Sent on tech-kern@, ok christos@
2014-08-14 14:06:53 +00:00
hannken
2607f151da - Add a map of active controlling ptys per mount and no longer abuse
the vnode lifecycle.
- No longer set "recycle" on VOP_INACTIVE().
- Make ptyfs_used_get() private to ptyfs_subr.c
- Stop copying device attributes from traditional ptys on first allocation.
- Remove unneeded argument "lwp" from ptyfs_allocvp() and ptyfs_free_get().

OK: Christos Zoulas
2014-08-13 14:10:00 +00:00
maxv
10b6c96ec4 http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-2
#04-0x01: Uninitialized var 'rqp' (does not compile anyway)
2014-08-12 06:57:20 +00:00
hannken
265f1d8cdb Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
2014-08-10 08:53:22 +00:00
gson
f3b28c737c Whitespace fix 2014-08-08 19:14:45 +00:00
hannken
5d6be57d01 Change efs from hashlist to vcache. 2014-08-07 08:24:23 +00:00
hannken
ea4bd7d40f Change adosfs from hashlist to vcache.
- point ap->block to real file header block for hard links.
2014-08-05 08:50:54 +00:00
reinoud
e3b6b3457e Posix requires the va_size of a symlink to be pathlength for symbolic links.
This fixes yet another atf case.
2014-07-29 15:48:22 +00:00
reinoud
60e6f474d5 Fix debug printout of udf_write_metadata_partition_spacetable(), it referred
to an old variable.
2014-07-29 15:36:43 +00:00
reinoud
a72b8dae23 Access time should only be set on accessing the data or messing with the
contents, not on inode access rights and ownership changes. Should address
PR kern/49033 for UDF.

Test results now come clean for bugs related to this issue in the ATF.
2014-07-29 11:10:12 +00:00
dholland
05d075b3ae Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
2014-07-25 08:20:51 +00:00
maxv
549e231932 Make DPRINTF more understandable, and replace my previous #ifdef DIAGNOSTIC... 2014-07-18 17:24:34 +00:00
maxv
8ee3c88d2b Limit the minimum size of a disk sector to 512 bytes, to prevent memory
overflow on extremely low secsize. This normally conforms to the old standard
(for which there doesn't seem to be a clear spec). Since 2011, IDEMA's Advanced
Format standardizes it to 4k, so this change won't cause any trouble on
new devices.

Put the printf under DIAGNOSTIC temporarily to see if someone complains.

after a quick discussion on tech-kern
2014-07-16 20:09:00 +00:00
christos
c0371c86f3 Correct the bread size of struct fsinfo from Gerald Lee at DELL dot com 2014-07-15 11:43:54 +00:00
maxv
409868ac4b smbfs depends on nsmb, so add the dependency as appropriate. Fixes
# modload smbfs
on modular kernels, PR kern/40011, and probably system crashes.
2014-07-14 16:29:50 +00:00
maxv
56ce0b03bc Minor changes:
- malloc()+memset() -> malloc(|M_ZERO)
 - rename 'vers' to 'FSVers'
 - declare 'ExtFlags' instead of calling getushort() two times
2014-07-09 09:00:18 +00:00
maxv
8fce630b04 Remove ROOTNAME (unused). 2014-07-09 08:43:54 +00:00
maxv
1273c3cb8c - Perform sanity checks not just for GEMDOSFS, but for all FAT devices. This
also fixes a division-by-zero bug that could crash the system.
- Define GEMDOSFS_BSIZE instead of a hard-coded 512 value, and remove 'bsize'.
- Rename 'tmp' to 'BlkPerSec'.

From me, FreeBSD, OpenBSD and the FAT specification.

ok christos@
2014-07-08 19:34:47 +00:00
hannken
798256c9ef Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
  dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
  referenced but unlocked denode.
2014-07-08 09:21:52 +00:00
hannken
4f7c01f703 CID 1223346: No need to check bp against NULL. It is always valid here. 2014-06-22 09:47:40 +00:00
hannken
11b42c4183 Unlock directory vnode after VOP_CREATE. 2014-06-17 12:38:12 +00:00
hannken
69110c4ec6 Change cd9660 from hashlist to vcache. 2014-06-16 09:55:49 +00:00
hannken
605674c009 Remove the hints "isodir" and "relocated" from cd9660_vget_internal()
and always reread the directory entry by inumber.  For directories
the directory entry is always its "." entry.

Always read directories via the device vnode to prevent buffer cache
inconsistency.  Keep i_devvp as a hint for fstat(1) and friends and
always use im_devvp for reads.  No need to vref()/vrele() i_devvp.

The additional bread is either cached because cd9660_lookup() just
released the buffer or will be used in the near future when the
directory gets traversed during lookup.

No objections on tech-kern@
2014-06-14 07:39:28 +00:00
pooka
a98adcf8d6 use psize_t for physical memory calculation 2014-06-13 11:57:48 +00:00
martin
b7650b1af5 Check for invalid mount arguments early and gracefully fail the mount.
Spotted by pooka@
2014-06-10 16:10:59 +00:00
martin
269c704651 Make sure to expand "freepages" to 64bit before shifting to byte values -
on rump we may have all our virtual address space "free".
Pointed out by pooka@.
2014-06-10 15:44:27 +00:00
martin
c7dd06b6bb Remove the hardcoded 4 MB free kernel memory limit and replace it
by uvmexp.freetarg, as discussed on tech-kern.
Main purpose is to make tmpfs usable (as far as possible) on small memory
machines.
This is a bit experimental, but we need to give it some real world exposure
to see how well it works.
2014-06-07 09:54:34 +00:00
joerg
11581dcbbb Introduce two helper functions to centralise the namecache statistics
in vfs_cache.c. Use consistent locking around the per-cpu data.
2014-06-03 19:30:29 +00:00
martin
755f765c3a PR kern/48815: do not skip ';' twice when comparing file versions.
Patch from Thomas Schmitt.
2014-06-01 11:01:18 +00:00
hannken
de57916f59 msdosfs_reclaim(): add missing fstrans and protect change
of v_data with v_interlock as msdosfs_sync() now needs it.
2014-05-30 08:42:35 +00:00
rmind
ce079fc9c0 tmpfs_mknod: it is not our responsibility to call vput() on the directory
vnode, so remove it (and ensure *vpp is NULL while here).
2014-05-26 19:12:07 +00:00
christos
202570e1e0 use macro. 2014-05-25 19:33:28 +00:00
christos
50f00297b4 use standard dirty vnode test. 2014-05-25 19:32:36 +00:00
hannken
e03668ca99 The pageflush_selector gets a vnode with v_interlock held.
Remove the mutex_enter()/mutex_exit() and simplify.

Hi christos...
2014-05-25 17:43:47 +00:00