Commit Graph

749 Commits

Author SHA1 Message Date
pooka 47cf5226f9 * better error checking: validate error values received from userland
to be vaild errno values
* include string describing error in PUFFS_ERR
* get rid of union in puffs_req, it's nothing but trouble
* pass pmp to async i/o callbacks
2007-10-01 21:09:07 +00:00
pooka c82fd73eb8 kill trailing whitespace 2007-09-29 20:17:36 +00:00
pooka c4ad0e4da1 Release vnode being created in error branch instead of leaving it
locked.  Ideally the function should be rewritten to do things in
a different order, but this tries to keep changes minimal aiming
for a possible netbsd-4 pullup.

fixes PR kern/37034
2007-09-28 19:48:42 +00:00
pooka db8a762626 comments & other minor maintenance 2007-09-27 23:25:10 +00:00
pooka 28636f63b4 Split routines handling nodes from puffs_subr to puffs_node.
No functional change.
2007-09-27 23:21:07 +00:00
pooka 1bbaeda6c3 nuke trailing , from enum. spotted by xtraeme 2007-09-27 23:10:42 +00:00
pooka 25d66b7667 Revert previous, it makes no sense whatsoever. 2007-09-27 23:03:25 +00:00
pooka 7f0d130f47 Undo state created in cookie2vnode if an error is returned. 2007-09-27 21:49:56 +00:00
pooka 7f467f6fac Differentiate between cookie2vnode returning an error and
return to caller, address unknown: no such cookie, no such node.
Make the callers use this info to either create a new vnode or bail.
2007-09-27 21:44:12 +00:00
pooka aa533e99dd Add error notifications, which are used to deliver errors from the
kernel to the file server for silly things the file server did,
e.g. attempting to create a file with size VSIZENOTSET.  The file
server can handle these as it chooses, but the default action is
for it to throw its hands in the air and sing "goodbye, cruel world,
it's over, walk on by".
2007-09-27 21:14:49 +00:00
pooka c342f5d6d4 Don't forget to insert the root node on the hash list.
... I should remember to test also if unmounting a file system works
before I commit stuff.
2007-09-27 18:06:41 +00:00
pooka 01895f64a7 Fix a race in how new cookies are checked. Previously the checking
was done separate of inserting the cookie into the lookup structure
and without any form of interlock.  This could lead to the same
cookie pointing to two different nodes.  Remedy the race by creating
a separate "checked and ready to be inserted" cookie list which
serves as an interlock without having to hold a fs-global creation
lock.
2007-09-27 14:35:14 +00:00
pooka 4d93faced9 add a few comments and g/c dead code 2007-09-24 19:15:42 +00:00
rumble 74c326b877 Simplify ptyfs_readdir at pooka's suggestion.
No functional change intended.
2007-09-24 01:00:02 +00:00
rumble 0ae0a486c7 Avoid stack allocation of large dirent structures in foo_readdir(). 2007-09-24 00:42:12 +00:00
rmind 49c0fadea3 smbfs_mount: Fix a possible dereference, and simplify the error case.
From CID: 4556

Tested by <dan>.
2007-09-21 01:33:04 +00:00
rumble f25f34f4c0 Don't explicitly set vp->v_size and then call uvm_vnp_setsize(). This is
not only unnecessary, but trips a kernel assertion introduced in r1.85 of
uvm/uvm_vnode.c.
2007-09-08 19:19:37 +00:00
rumble 0b6fb31125 In efs_readdir don't foolishly allocate and free dirents for each entry
before copying them out, rather just use a single one. Further, follow
the example of tmpfs and others by simply allocating on the stack.

This should have the side-effect of silencing false Coverity reports like
CID 4559 and 4554.
2007-09-08 18:17:59 +00:00
rumble df9eaeb9e0 CID 4553:
In efs_lookup, when checking whether a CREATE or RENAME operation would
succeed, be sure to pass the appropriate vnode pointer to VOP_ACCESS.
2007-09-08 16:21:27 +00:00
pooka d7dbef6aec move static KASSERT from mount to init 2007-09-05 22:34:17 +00:00
pooka 89e48410c4 * don't allow the file server to specify a node size to be VSIZENOTSET
* KASSERT that VNOVAL == VSIZENOTSET
2007-09-04 00:11:38 +00:00
pooka 05eae67bb1 Add a third type of fh option, passthrough, where the kernel does
not attempt to handle struct fid at all and passes it as such to
userspace.
2007-08-23 14:36:46 +00:00
pooka e6d6dce9bf Mimic namei structure changes for puffs. bump both kernel & lib version. 2007-08-22 17:54:30 +00:00
pooka 1b189c72ab In the new world order (a.k.a. the human-understandable world order)
VOP_LOOKUP ignores LOCKPARENT completely, so make this ignore it also.

XXX: tested only with rump, but I can't really see how this worked
at all before
2007-08-17 17:44:43 +00:00
pooka 25a346d4fb Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO 2007-08-15 14:19:19 +00:00
pooka d1cd2c26a2 * don't call VOP_ACCESS in lookup, that's the file system's problem
* be more careful with r/o fs to catch EEXIST in lookup CREATE
* some comment polish
2007-08-13 09:48:55 +00:00
pooka 4c3f2a2acf enforce MNT_RDONLY 2007-08-12 19:44:15 +00:00
pooka 493dccb979 sprinkle #ifdef _KERNEL 2007-08-08 09:21:34 +00:00
rumble 1e80c150c7 Fix a parenthesis bug that would nearly always make the superblock magic
check evaluate to true.
2007-08-06 23:25:27 +00:00
pooka 31d16d310e Make VFS_SYNC always succeed instead of always fail.
Fixes non-forced unmount.
2007-08-06 21:10:24 +00:00
pooka 0ed76b1676 When resizing a node, first drop extra pages and zero tail, and only
then set the new size.  Otherwise zerolen will always be, well, 0.
2007-08-06 16:08:55 +00:00
pooka 9dc896c9de Set mnt_fs_bshift and mnt_dev_bshift to reasonable dummy-values. 2007-08-03 13:00:19 +00:00
pooka e226ccdf0c add comment to flag a slight problem 2007-08-01 14:20:45 +00:00
pooka 8d1f899239 * nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
  use VFS_PROTOS() instead of manually prototyping the methods
2007-07-31 21:14:15 +00:00
pooka 573c189296 properly setup ubcflags 2007-07-30 14:49:01 +00:00
pooka eaf29fa688 Move PUFFS_TYPEPREFIX to puffs_msgif.h since it's used in a macro there. 2007-07-30 09:04:58 +00:00
rumble 3ea6a6534e Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.
2007-07-29 21:17:41 +00:00
rumble 1c42082598 Only set *ap->a_cookies when we're returning success. Also, do not hard-
code 16, but rather use _DIRENT_MINSIZE as the divisor when determining
the number of cookies to allocate.

Noticed by pooka@.
2007-07-29 20:58:10 +00:00
rumble 8f9941b474 Support NFS cookies and the eofflag in efs_readdir. Also, be sure to
update uio->uio_offset as not doing so would cause large directory reads
to misbehave.

EFS is now properly NFS-exportable.
2007-07-29 20:15:20 +00:00
ad a0d1fd8d0c It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 13:31:07 +00:00
pooka b7321c1a86 apply ketchup to vop_mmap_args comment 2007-07-29 13:12:42 +00:00
ad 66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
rumble f486212a0e When computing the superblock checksum, use an unsigned short to avoid an
undesired sign-extension. Now EFS works on big endian machines, too.
2007-07-29 00:56:04 +00:00
yamt 3822af7031 ubc_uiomove: add an "advice" argument rather than using UVM_ADV_RANDOM blindly. 2007-07-27 09:50:36 +00:00
pooka 8b45aab0cf include <uvm/uvm_prot.h> 2007-07-27 09:18:54 +00:00
pooka 1ce406a846 Change unused fflags parameter in VOP_MMAP to prot and pass in
desired vm protection.
2007-07-27 08:26:38 +00:00
pooka d9970c8066 Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter. 2007-07-26 22:57:36 +00:00
pooka daeb749df5 ntfs_unmount:
* panic if flushing system nodes fails: we have released too many
  resources and would die anyway the next time unmount is attempted
* KASSERT that VOP_CLOSE succeeds, but always return 0.  once again
  we have released too many resources

XXX: maybe rewrite to be a bit more robust
2007-07-26 18:43:14 +00:00
pooka 53a9d4abfa Don't do nfs server consistency checks in readdir, especially since
the check depended on the nfs server implementation.
2007-07-26 18:15:42 +00:00
jmmv 7180494a8d Multiple fixes for tmpfs' rename operation:
- Raise an error if renaming a file to a directory.
- Raise an error if renaming a directory to a file.
- Raise an error if renaming a directory to a non-empty directory.
- Properly allow renaming a directory to an empty directory.
  The system could previously crash if the kernel had DIAGNOSTIC enabled,
  as this triggered a bogus assertion.

Problem found by Geoff Wing.
2007-07-23 15:41:01 +00:00