Commit Graph

1652 Commits

Author SHA1 Message Date
martin
b31205ebbb PR kern/48787: inode calculation from ISO9660 block offset might get
truncated to 32bit - force the whole expression to be evaluated as ino_t.
Patch from Thomas Schmitt, with minor modifications (and reworded comment).
2014-05-10 14:11:58 +00:00
christos
71fd41685f fix typo 2014-04-30 01:59:30 +00:00
christos
0172bc970f handle MNT_UPDATE 2014-04-30 01:33:51 +00:00
pooka
45fe388485 Don't lock an already locked vnode. 2014-04-25 15:18:06 +00:00
maxv
23f76b6d00 An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
2014-04-16 18:55:17 +00:00
jakllsch
6d9f89fe00 Use size_t instead of int for character count to avoid sign compare issues. 2014-04-06 19:25:22 +00:00
christos
c636575468 Handle multiple ptyfs mounts with different chroots. ptys opened in one
chroot are only visible in that chroot.
2014-04-04 18:10:29 +00:00
christos
4d87c37c1f forgot to commit one patch:
Avoid returning released(free), but still hashed inode numbers.
(Ilya Zykov)
2014-03-27 21:13:06 +00:00
christos
a9253db65e From Ilya Zykov:
- ifdef out some code that is only used for NO_DEV_PTM
- pass the mountpoint instead of the ptm structure to the implementation
  dependent (ptyfs or bsdpty) functions.
- add a function to return the correct ptyfs mountpoint for the current lwp
2014-03-27 17:31:56 +00:00
christos
9b453fe1d0 if one of the ptyfs instances has grabbed the handle don't grab it again,
Ilya Zykov
2014-03-26 21:28:48 +00:00
christos
66873a203c kill sprintf. 2014-03-25 16:30:28 +00:00
hannken
f3cf481632 - Make VI_XLOCK, VI_CLEAN and VI_LOCKSHARE private to kern/vfs_*.c.
- Make vwait() static.
- Add  vdead_check() to check a vnode for being or becoming dead.

Discussed on tech-kern.

Welcome to 6.99.38
2014-03-24 13:42:40 +00:00
dholland
37ec3a866f Tidy up locking in cd9660_mount; thrash the lock less, and make it
clear that the lock is only dropped when calling iso_mountfs().

While here, don't use the vnode pointer's value after vrele().
2014-03-24 04:03:25 +00:00
hannken
6d285189fb Change all vfsops to use C99 designated initializers.
No functional changes intended.
2014-03-23 15:21:15 +00:00
christos
0f18888b15 fix unused 2014-03-23 09:30:59 +00:00
christos
74758fe57e Ilya Zykov: Prepare readdir for multi-mountpoint use 2014-03-21 17:21:53 +00:00
christos
bf11f52a36 - return an error if we could not get the pts pathname
- correct getting pathname if the mount point inside a chroot
(Ilya Zykov)
2014-03-19 18:09:00 +00:00
hannken
fcb1d82829 Change smbfs_sync() to use vfs_vnode_iterator. 2014-03-17 09:37:09 +00:00
hannken
f9d8c5c8e8 Change pageflush() to use vfs_vnode_iterator. 2014-03-17 09:36:34 +00:00
hannken
b1e067f299 Change msdosfs_sync() to use vfs_vnode_iterator. 2014-03-17 09:35:59 +00:00
hannken
5e8d36ac30 Restructure union_lock() to always lock before testing for dead node.
Add two little helpers to lock or unlock a node.  Use "vp" for the
union node and "lockvp" for the node to be locked.  Use ISSET() to
test flags, add assertions.
2014-03-12 09:40:05 +00:00
hannken
2b6ec89863 The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
  the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
2014-02-27 16:51:37 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
maxv
1036f1d9fc Adapt my previous patch differently. read(2) wants EISDIR when the
object is a directory. Which also means that tmpfs_read() was returning
a wrong error code when dealing with non-regular vnodes.
2014-02-17 20:16:52 +00:00
maxv
6b47753f22 Fix tmpfs_read()'s return value; it should return EINVAL. Now consistent with
tmpfs_write().

ok christos@
2014-02-16 12:54:07 +00:00
hannken
c36eeb723b Change union_allocvp() to take an unlocked uppervp and to return the
union node unlocked.  Another VI_XLOCK hack is gone.
2014-02-16 09:50:25 +00:00
hannken
32bc55a7e7 Member un_flags is unused now -- remove. 2014-02-14 08:50:27 +00:00
martin
478bc1f91d Remove an unused variable 2014-02-13 21:05:26 +00:00
hannken
8757071efb Get rid of UN_KLOCK to keep a lock on vput(). It is not really needed
and makes the source difficult to read.  Always hold references to the
union nodes until the operation is done.
2014-02-13 09:55:04 +00:00
hannken
15a20e1e67 Fix the DOT and DOTDOT case for union_lookup1(). 2014-02-13 09:50:31 +00:00
hannken
97834f7ba0 Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
2014-02-07 15:29:20 +00:00
hannken
b9c5e8c0f7 Remove an annoying printf. And to answer the question: VFS_VGET() gets
used by NFS V3 server for readdirplus.
2014-02-06 16:18:38 +00:00
martin
dfd92bb472 Bogus gcc 4.8 maybe use uninitialized warning 2014-01-28 13:23:49 +00:00
hannken
04c776e5c8 Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
2014-01-23 10:13:55 +00:00
hannken
1139274440 Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
2014-01-17 10:55:01 +00:00
pedro
65d0f0003c Prevent a diagnostic assertion in tmpfs_rmdir() from being triggered
through an rmdir on ".." by moving it so it happens after the check for
empty directories; OK rmind@.
2014-01-10 16:42:38 +00:00
hannken
9cd2f4b930 Operation sysvbfs_remove() destructs inodes attached to active vnodes.
Defer the destruction to sysvbfs_reclaim().

Disable test t_renamerace:sysvbfs_renamerace as it will exhaust the
inode table (sysvbfs has space for 8 inodes only).

Ok: Izumi Tsutsui <tsutsui@netbsd.org>
2014-01-09 13:23:57 +00:00
pedro
0cc071bd88 Allocate direntp on the stack in tmpfs_dir_getdents(), thus saving
calls to kmem_zalloc() and kmem_free(); OK rmind@. From OpenBSD.
2014-01-08 16:11:04 +00:00
hannken
b04f8aa83f Fix a race where thread1 runs VOP_REMOVE() and gets preempted in
tmpfs_reclaim() before the call to tmpfs_free_node().  Thread2
runs VFS_FHTOVP() and gets a new vnode attached to the node thread1
is about to destroy.

Change tmpfs_fhtovp() to check the generation number after
tmpfs_vnode_get() succeeded.
2014-01-04 12:36:49 +00:00
hannken
8ea5485de5 Fix a race where thread1 runs VOP_REMOVE() and gets preempted in
tmpfs_reclaim() before the call to tmpfs_free_node().  Thread2
runs VFS_FHTOVP() and gets a new vnode attached to the node thread1
is about to destroy.

Change tmpfs_alloc_node() to always assign non-zero generation number
and tmpfs_inactive() to set the generation number of unlinked nodes
to zero.
2014-01-03 09:53:12 +00:00
mlelstv
d4e64f4071 At least fetch mount data pointer before using it.
Coverity CID 274767
2013-12-25 11:15:49 +00:00
mlelstv
8e1e9026ea At least fetch the mount data pointer before using it.
Coverity CID 274525
2013-12-25 11:11:55 +00:00
mlelstv
266e035aaa don't treat adjacent members as a larger array
Coverity CID 977367
2013-12-24 16:51:24 +00:00
hannken
7e0115bce6 It is not the task of sysvbfs_open() to check for unlinked nodes. 2013-12-24 09:56:18 +00:00
hannken
905b6b7730 It is not the task of tmpfs_open() to check for unlinked nodes.
Fix tmpfs_lookup() to always return ENOENT when looking up from
an unlinked directory.
2013-12-24 09:23:33 +00:00
christos
9c43792b5f CID 975205: Unchecked return value 2013-12-10 18:20:32 +00:00
wiz
d860f590d4 Fix typo ("then" instead of "than") 2013-12-09 09:35:16 +00:00
christos
9d605174d9 Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
2013-11-27 17:24:43 +00:00
rmind
ccc45228d5 - tmpfs_construct_node: prevent from the new node construction if the
directory was removed.  Fixes the crash reported by Nicolas Joly.
- tmpfs_reclaim: avoid race by checking tn_links with the vnode locked.
2013-11-24 17:16:29 +00:00
rmind
63faa32f62 tmpfs_reg_resize: use size_t. 2013-11-23 21:53:27 +00:00
rmind
b05b03890a Fix previous, add __diagused. 2013-11-23 17:01:07 +00:00
rmind
e63cf28e67 - Simplify tmpfs_update(), eliminate tmpfs_note_t::tn_status and deferred
timestamp updates.  Fix some incorrect updates and plug some missing ones.
  Should fix PR/48385.
- tmpfs_rmdir: avoid O(n) scan when the directory is not empty and whiteout
  entries were never added.
2013-11-23 16:35:32 +00:00
christos
0b725b63c7 change the mountlist CIRCLEQ into a TAILQ 2013-11-23 13:35:36 +00:00
riz
1000f7c1af Don't create a variable just to assert() on it - assert on the
thing the variable got assigned.
2013-11-21 23:42:09 +00:00
rmind
ace15189ad tmpfs_dir_getdotents: fix the recent regression, set the correct
d_fileno value for dot-dot.  Spotted by Pedro Martelletto, thanks!
2013-11-21 14:39:09 +00:00
rmind
884c21d51e v7fs: replace malloc(9) with kmem(9), fix a memory leak and few missing
mutex destruction cases in the error path.
2013-11-20 23:44:23 +00:00
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
reinoud
d0b9530090 On growing a node that was recorded inside the (E)FE, don't forget to set the
size of the node to the NEW size. This was reported by the `t_io
udf_shrinkfile' testcase.

Fixes PR kern/47985
2013-07-03 11:50:59 +00:00
matt
d2b8f70ecf Make this compile again. 2013-06-28 17:13:34 +00:00
christos
c22fbb82f6 remove useless initialization, KNF
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2013-06-28 15:46:37 +00:00
christos
b9bf0e6c5d prevent memory leak on error
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html
2013-06-28 14:49:14 +00:00
reinoud
793c315af2 Since UDF volumes are always mounted async, the simple UBC purging with
VOP_PUTPAGES() was never triggered resulting in far too much data in the UBC
that needed to be written out. This could result in instability on small
memory machines.
2013-06-27 09:38:08 +00:00
dholland
e1610ba4cb Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

   lblkno
   lblktosize
   lfragtosize
   numfrags
   blkroundup
   fragroundup
2013-06-23 07:28:36 +00:00
dholland
dab2b35444 blkoff() -> cd9660_blkoff()
blksize() -> cd9660_blksize()
2013-06-19 18:16:53 +00:00
dholland
4671554398 blkoff() -> filecore_blkoff()
blksize() -> filecore_blksize()
2013-06-19 18:16:10 +00:00
pooka
b2d1226abe Don't change a read-only file system. 2013-05-15 16:44:03 +00:00
reinoud
52cff03007 Fix Typo 2013-05-08 10:39:17 +00:00
reinoud
fa5ee9f6e0 Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
fix PR 45605.
2013-05-08 10:29:22 +00:00
jakllsch
e7f2d5bd6f Don't attempt to mount file system with clusters larger than MAXBSIZE. 2013-04-15 14:10:59 +00:00
plunky
5ec364d4d9 C99 section 6.7.2.3 (Tags) Note 3 states that:
A type specifier of the form

	enum identifier

  without an enumerator list shall only appear after the type it
  specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
2013-03-18 19:35:35 +00:00
yamt
ca4fff9c14 comments
use sizeof(var) instead of sizeof(type) where possibly confusing
2013-03-06 11:40:22 +00:00
yamt
03d1621dc1 comment 2013-03-06 11:39:37 +00:00
christos
db2e654869 A little more debugging. 2013-01-28 00:17:18 +00:00
christos
50df1c7d20 don't need sys/mount.h in userland. 2013-01-27 22:04:19 +00:00
christos
3c0f9bd4e8 tidy up debugging printfs; no functional change. 2013-01-27 20:15:58 +00:00
christos
1ed2e30d40 fix fstat build. 2013-01-26 19:45:02 +00:00
christos
691bcd5dbb more cross-compile friendly. 2013-01-26 16:51:51 +00:00
christos
929f8943ca expose more stuff if MAKEFS is defined for the headers, and arrange for
the source file to be compilable from userland.
2013-01-26 00:21:49 +00:00
pooka
a0e33ce1e2 Do the protocol consistency check hack only when compiling ELF. 2013-01-16 21:10:14 +00:00
hannken
d845821cd8 Move the initialization of n to after the error branch.
From Taylor R Campbell <riastradh@netbsd.org>
2012-12-28 08:03:59 +00:00
hannken
1a15b095d2 Revert rev. 1.20 now that bread() has been fixed.
PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 11:44:39 +00:00
hannken
312d89f0de Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 08:03:41 +00:00
msaitoh
b6e1d8e8d8 Fix off by one error. 2012-12-07 06:50:15 +00:00
mbalmer
e3f283b63f Fix misspelling: accommodate is a long enough word to have room for two 'c's
and two 'm's.
2012-12-01 11:41:49 +00:00
nakayama
fb4e31b6db Improve smbfs timestamp handling.
Don't round timestamp to 2 seconds resolution if the server
supports the CAP_INFOLEVEL_PASSTHRU capability.
2012-11-30 23:24:21 +00:00
nakayama
33e8b488e1 - Remove redundant vput() before vgone().
- Avoid unnecessary mutex_exit() in smbfs_node_alloc().
- Set NGONE bit to from-name vnode to invalidate the smbnode cache.
2012-11-29 11:58:49 +00:00
nakayama
9dae46742e Various fixes for smbfs:
- Implement NGONE to fix caching issue described in PR kern/25070.
  Mostly taken from FreeBSD r125637.

- Revert revision 1.70 of smbfs_vnops.c to fix setattr to opened
  direcotry.  In case of SMB_CAP_NT_SMBS, NOPEN is set after
  smbfs_smb_ntcreatex() call.  If NOPEN is set in front, it will
  immediately return by condition at do_open label.

- In smbfs_close(), call smbfs_smb_close() and drop NOPEN bit in
  the case of direcotry.  Otherwise smbfs_rmdir() fails when the
  directory was opened.
2012-11-28 13:34:24 +00:00
nakayama
5f60ff96cb - fix endian cofusion around FID, which is used as is, so no need
to do byte swapping.
- put right value to ByteCount of SMB_COM_NT_CREATE_ANDX request.

The fix makes smbfs actually works on big-endian port.
2012-11-24 19:48:24 +00:00
dholland
35ed690545 Excise struct componentname from the namecache.
This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.

The glop should be able to go away eventually but requires structural
cleanup elsewhere first.

This change requires a kernel bump.
2012-11-05 17:27:37 +00:00
dholland
1617a81dd1 Disentangle the namecache from the internals of namei.
- Move the namecache's hash computation to inside the namecache code,
instead of being spread out all over the place. Remove cn_hash from
struct componentname and delete all uses of it.

 - It is no longer necessary (if it ever was) for cache_lookup and
cache_lookup_raw to clear MAKEENTRY from cnp->cn_flags for the cases
that cache_enter already checks for.

 - Rearrange the interface of cache_lookup (and cache_lookup_raw) to
make it somewhat simpler, to exclude certain nonexistent error
conditions, and (most importantly) to make it not require write access
to cnp->cn_flags.

This change requires a kernel bump.
2012-11-05 17:24:09 +00:00
dholland
26486df952 Fix build of fs/unionfs (the extra unused copy of onionfs) for the
quota changes.
2012-11-05 17:16:59 +00:00
jakllsch
48958e522b Stylistic changes in comments/strings:
"FAT" and "fat" are different things, use the appropriate case.
"GEMDOS" is all caps.
2012-11-04 17:57:59 +00:00
jakllsch
1203d9864d And correct a typo that wasn't corrected in previous. 2012-11-04 17:35:27 +00:00
jakllsch
3a46a43ff0 Correct constant in comment to match the expression it is derived from. 2012-11-04 17:33:46 +00:00
jakllsch
a8a5260437 Check that the FSInfo block's next free cluster suggestion is actually
a cluster within the bounds of the volume too.
2012-11-04 17:18:56 +00:00
jakllsch
1afc21ab39 ((u_long)-1) will not always be 0xffffffff, which is what we actually
want to test against to determine if the FSInfo block's next free
cluster suggestion is valid
2012-11-04 17:16:37 +00:00
christos
81f024e94e rename ptyfs_flag -> ptyfs_status to avoid confusion with ptyfs_flags 2012-10-24 23:36:15 +00:00
christos
0966ff043a fix the mystery of the bad directory times. 2012-10-23 23:31:00 +00:00
jakllsch
8b020b7eee We don't actually want to round the number of elements in the bitmap
down.  Fixes a self-inflicted buffer overrun.

(This was detected by chance that the top of the bitmap coincided with
a page boundary.)
2012-10-03 23:32:43 +00:00
mlelstv
c7b0abd4dd Use getdisksize() to find out geometry, fetch only other magic values
from disklabel.
2012-10-03 07:20:50 +00:00
riastradh
7fad9ac861 Uncomment call to genfs_rename_cache_purge.
Fixes a side issue mentioned in PR kern/46990.

I left this commented to preserve the old behaviour of tmpfs_rename,
but it is obviously broken to omit the cache purge, and I'm surprised
nobody had encountered any problems with it until now.
2012-09-27 17:40:51 +00:00