Commit Graph

1496 Commits

Author SHA1 Message Date
rmind
8da90206bc Make tmpfs_node_t::tn_gen a 32-bit number, keep it in sync with tmpfs_fid_t.
Also, change tn_status to unsigned while here.
2013-11-18 01:39:34 +00:00
rmind
3033c7dc60 tmpfs_dir_getdents: avoid leaking kernel memory to the userspace.
From Pedro Martelletto.

XXX: regress/sys/fs/getdents should be a part of the test suite
2013-11-16 17:58:27 +00:00
rmind
6862603939 tmpfs_alloc_node: use cprng_fast64(), the old random(9) shall be removed. 2013-11-11 17:04:06 +00:00
rmind
89433ee6d9 Handle whiteout case in tmpfs_dir_detach() and tmpfs_unmount(). 2013-11-10 12:46:19 +00:00
christos
15bc40ee73 mark variable __diagused 2013-11-10 03:20:20 +00:00
rmind
1f5dbc945b tmpfs: replace the broken tmpfs_dircookie() logic which uses the node
address truncated to 31 bits (required for 32-bit readdir compatibility,
e.g. linux32).  Instead, assign 2^31 range using the following logic:
- The first half of the 2^31 is assigned incrementally (the fast path).
- When exceeded, use the second half of 2^31, but manage with vmem(9).

It will require 2 billion files per-directory to trigger vmem(9) usage.
Also, while here, add some fixes for tmpfs_unmount().

Should fix PR/47739, PR/47480, PR/46088 and PR/41068.
Thanks to wiz@ for stress testing.
2013-11-08 15:44:23 +00:00
christos
1aaac765ed - support advisory locking on ptys
- get the link count correct for .
XXX: pullup 6
2013-11-05 00:40:33 +00:00
hannken
690094cb2d Stop using v_mount of an unreferenced vnode -- save the mount while
the vnode has a reference.
2013-11-02 10:30:18 +00:00
rmind
20a51a9773 tmpfs: fix the zero-length symlink target case as NetBSD supports them. 2013-11-01 15:38:45 +00:00
mrg
c77065c11b apply __diagused where appropriate. 2013-11-01 06:41:56 +00:00
rmind
f8abe6cb77 tmpfs_alloc_node: it is less error-prone to store the link path with
the NIL terminator included.  Adjust tmpfs_readlink() to exclude NIL.
Also, remove the check for zero-length and add some asserts.
2013-10-31 00:59:17 +00:00
mrg
4cf2909a7b used __diagused where appropriate. 2013-10-30 08:41:38 +00:00
mrg
cb7e28b713 use __diagused where appropriate. 2013-10-30 08:27:01 +00:00
christos
0d211931ed fix unused variable warnings 2013-10-20 21:13:15 +00:00
christos
cb2fa8e0d7 Now that KASSERT will always consume its arguments, move a KASSERT inside
a DIAGNOSTIC, because the function used is only defined with DIAGNOSTIC.
2013-10-20 21:12:08 +00:00
christos
59f2a2f5c4 remove unused 2013-10-20 17:14:48 +00:00
christos
de0d394bfe provide a function to access the name and extension as a single array as
opposed depend on array index overflow.
2013-10-20 00:01:55 +00:00
christos
e7993db787 remove unused variables 2013-10-18 19:58:11 +00:00
christos
9ec4136d0a remove unused variable warnings 2013-10-18 19:57:28 +00:00
christos
91b2f42c8c fix unused variable warnings 2013-10-18 19:56:55 +00:00
christos
9fda064713 remove usused code 2013-10-17 21:04:44 +00:00
christos
ba0dd1c1e6 remove unused code 2013-10-17 21:03:50 +00:00
christos
6069744732 - remove unused variables
- add _NOERROR flavor macros for the case where errors are ignored.
2013-10-17 21:03:27 +00:00
rmind
49ce9c94dc - tmpfs_remove: check 'appendable' flag for the parent directory as well.
Patch from Pedro Martelletto.
- tmpfs_dir_detach: remove missleading check.
- tmpfs_link: remove unused variable.
2013-10-04 15:14:11 +00:00
hannken
85b4f7dccf Remove a bogus vrecycle() from udf_inactive(). Vrecycle() works on inactive
vnodes while VOP_INACTIVE() should never be called on an inactive vnode.

Ok: Reinoud Zandijk <reinoud@netbsd.org>
2013-10-04 08:35:08 +00:00
rmind
be67742670 tmpfs_remove: as per POSIX, "if the file's link count is not 0, the last
file status change timestamp of the file shall be marked for update."

From Pedro Martelletto.
2013-10-01 23:10:25 +00:00
hannken
3881f4f3f9 Replace macro v_specmountpoint with two functions spec_node_getmountedfs()
and spec_node_setmountedfs() to manage the file system mounted on a device.
Assert the device is a block device.

Welcome to 6.99.24

Discussed on tech-kern@ some time ago.

Reviewed by: David Holland <dholland@netbsd.org>
2013-09-30 18:57:59 +00:00
dholland
5724088cd3 Explain what's here. 2013-09-30 07:31:34 +00:00
dholland
e63709eb76 The script for preparing an import of this nfs code. 2013-09-30 07:23:37 +00:00
dholland
6ca3558714 Import FreeBSD's "newnfs" nfs client and server code. This contains
nfsv4 as well as new implementations of nfsv3 and nfsv2.

This import is from tonight's FreeBSD head and is unchanged from there
except for automated munging of rcsids, rearranging of paths, and an
autogenerated files.* file that might or might not be syntactically
valid. (I will check in the script that does this shortly.)

There is not the slightest chance this will configure yet, let alone
compile or run.
2013-09-30 07:18:57 +00:00
reinoud
550f8483a8 Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
2013-08-09 20:13:18 +00:00
joerg
45b48fe34b Support tools build. 2013-08-05 17:02:54 +00:00
reinoud
420d7ac724 Remove udf_node * as state variables and add the loop invariants UFS and tmpfs
carry to make it easier to debug.
2013-07-16 10:49:36 +00:00
reinoud
4600888a4b First step in rewriting the genealogy case 2013-07-15 14:40:21 +00:00
reinoud
0eb394b1d0 udf_gro_genealogy() : source and destination should never be the same on call,
KASSERT it instead of checking for it.
2013-07-13 19:42:26 +00:00
reinoud
a987c68f3a vp is used, so don't (void) it 2013-07-13 19:40:14 +00:00
reinoud
2b15913865 Rework udf_gro_rename() to be more linear instead of nesting if/else
branching.
2013-07-13 19:39:02 +00:00
reinoud
8ad309e64f In case there is trouble determining the number of entries in a directory,
return its not empty to be on the safe side.
2013-07-12 16:14:10 +00:00
reinoud
d9c51d931b Resort to the easiest way to check if a directory is deleted: the flag that
tells that there is no FID (dirent) pointing to it anymore.
2013-07-11 19:41:19 +00:00
reinoud
da86562477 Small cleanup 2013-07-11 15:43:12 +00:00
reinoud
c689e7fed3 Remove the dirent checks and references. UDF doesn't need/use them on rename
so just to make sure, we remove all references/checks to not trigger bugs
thats are not really ours.
2013-07-10 19:14:07 +00:00
reinoud
a7795a09e4 Implement udf_rename() using the new genfs_rename() framework.
Fixes PR kern/47986
2013-07-10 15:10:56 +00:00
reinoud
1cabaf0e68 Clarify the sticky-bit check 2013-07-08 08:21:12 +00:00
reinoud
a0054fd5a4 Pull forward the node creation returned from the lookup call. Its vnode is
used in the access determination on delete/rename of TXT files.

Thanks for joerg@ and clang for detecting this!
2013-07-07 20:16:22 +00:00
reinoud
eb513d5160 Implement a real empty-directory checking for rmdir().
Should should fix the other part of PR kern/47987
Solves tests/vfs/t_vnops udf_dir_notempty
2013-07-07 19:49:44 +00:00
reinoud
d2126d9622 Fixes chflags. They were silently rejected before but the VFS standard demands
it complains with EOPNOTSUPP.

Fixes chflags test case.
2013-07-05 20:40:20 +00:00
reinoud
16cc237e7c Provide additional checks to udf_lookup and restructure it a bit.
Should fix PR 47988
2013-07-05 20:04:57 +00:00
reinoud
1a547d0334 Remove spurious empty line 2013-07-03 15:39:22 +00:00
reinoud
ab09c24f7a On removing a directory make sure the leaf directory doesn't have a valid '..'
link anymore. In a corner case this leaf can be held by a process as a CWD. It
is guaranteed to be empty at this stage so we trunc it removing the only valid
FID, being the '..' entry.

Solves part of PR kern/47987
Solves tests/vfs/t_vnops udf_dir_rmdirdotdot
2013-07-03 14:35:28 +00:00
reinoud
e6b5374ef7 Typo in debug message: we are removing a directory and not a file. 2013-07-03 12:55:34 +00:00