Commit Graph

445 Commits

Author SHA1 Message Date
pooka 30a851c1d1 support fifos 2006-10-27 12:25:16 +00:00
pooka 0f94cb76f7 support specfs 2006-10-26 22:52:47 +00:00
pooka 93c897b7ab Fix operations creating new nodes to honor the vnode locking protocol
if the userspace server returns an error.  Fixes lockups if any
of the following operations failed: create, mknod, mkdir, symlink
2006-10-26 13:42:21 +00:00
pooka f15702aabc debug print fixes 2006-10-26 13:35:23 +00:00
reinoud dc5b5420b9 Revisit mnt_vnodelist TAILQ patch. Remove all suspicious TAILQ_FOREACH()
loops where vnodes can get removed or added during the loops. This could
lead to panic's on unmount since nodes are skipped or otherwise
TAILQ_NEXT(0xdeadbeef, ...) was dereferenced.
2006-10-25 22:01:54 +00:00
pooka 14d708398a pass VOP_INACTIVE() to userspace 2006-10-25 18:15:39 +00:00
pooka a72d8a71e5 If the control descriptor is closed, mark userspace dead and wakeup
all waiters *before* trying to get the syncer lock necessary for
dounmount().  This prevents a deadlock if the userspace server dies
while the syncer is running.
2006-10-25 12:04:14 +00:00
drochner 21440e4fda minor fix to error handling (from OpenBSD, rev.1.40):
only set devvp->v_specmountpoint on successful mounts
2006-10-24 19:59:52 +00:00
pooka 4f1cd3b286 Apply a little eggwash to a deadlock condition where calling
getnewvnode() while holding on to any vnode lock deadlocks the
system if the file system is being forcibly unmounted.

Normal file systems don't trigger this problem because of two reaons:
1) they don't hold on to vnode locks while idling who-knows-where, so
   the race doesn't trigger
2) they aren't usually unmounted with FORCE; puffs is, in case "someone"
   manages to make a crashy userspace server

Nevertheless, a real solution is slowly being braised.
2006-10-23 23:32:57 +00:00
pooka 6ea08fd809 bump the reqstruct minsize to something more believable (but I should
really fix this, still)
2006-10-23 16:07:18 +00:00
pooka e4ae558e9d fix print in VOP_PRINT
also make it compile on amd64.  problem noticed by Blair Sadewitz
on current-users
2006-10-23 12:21:39 +00:00
pooka 8640fbb580 kernel portion of puffs - the Pass-to-Userspace Framework File System.
It contains the VFS attachment and userspace message-passing interface.

This work was initially started and completed for Google SoC 2005
and tweaked to work a bit better in the past few weeks.  While
being far from complete, it is functional enough to be able and
stable to host a fairly general-purpose in-memory file system in
userspace.  Even so, puffs should be considered experimental and
no binary compatibility for interfaces or crash-freedom or zero
security implications should be relied upon just yet.

The GSoC project was mentored by William Studenmund and the final
review for the code was done by Christos.
2006-10-22 22:43:23 +00:00
reinoud d31cd7fc58 Add extended attribute numbers associated with the two defined structures
for times and device specification.
2006-10-22 00:06:48 +00:00
reinoud 9c8aedbe6c Return the TAILQ_FOREACH to an explicit `for' loop since in the loop vnodes
can be removed.
2006-10-22 00:03:33 +00:00
reinoud 0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
chs 7ddbeb08d1 move includes only needed for kernel inside ifdef _KERNEL. 2006-10-06 02:40:58 +00:00
reinoud 14573dd3a8 Fix panic on unmounting VAT file systems. The VAT table was allocated and
freed on the wrong malloc type.
2006-10-04 13:03:17 +00:00
reinoud 21d692155a Fix memory leaks on mounting and dismounting UDF volumes. 2006-10-03 15:54:03 +00:00
christos 804dfaa036 Coverity CID 2960: Don't print NULL vnode (from Arnaud Lacombe) 2006-09-29 19:41:16 +00:00
christos f89dbcf8f7 Coverity CID 2435: Add KASSERT before NULL deref (from Arnaud Lacombe) 2006-09-29 18:30:37 +00:00
reinoud d9df4ed24c Add `vfs.udf.verbose' sysctl when running a DEBUG kernel to dynamically set
the udf_verbose variable. So when something goes wrong, it can be examined
on the spot without needing to reboot a new kernel and possibly loosing
state.
2006-09-29 01:36:28 +00:00
reinoud 695fa2b8b8 Fix lookup bug that could result in not finding the last entry. The check
for the cycling was too early. Also fix potential endless loop when the
last entry was deleted.
2006-09-28 19:57:26 +00:00
aymeric a4a3d448f2 fix adosfs_readdir() so that we can list directories on AmigaOS filesystems.
. get rid of struct adirent which didn't match struct dirent anymore
. fix cookies, move all the code handling them to the end of the function

Includes many minor changes to the code of this function.
2006-09-23 22:47:11 +00:00
xtraeme 729d0a0184 Apply patch from PR kern/34583 sent by Rhialto, quoting him:
"Add a 3rd entry in the cache, which keeps the end position
 from just before extending a file.
 This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.
2006-09-22 17:45:21 +00:00
reinoud ce2c68fd18 Make VOP_LOOKUP's O(1) instead of O(n log(n)) giving a speedup of 7500% on
a 1400 file directory.
2006-09-19 23:59:16 +00:00
reinoud 4911612931 Fix serious file-corruption issue on sparable partitions. 2006-09-19 22:00:38 +00:00
reinoud 49ec3b4779 Fix panic when the sparable table didn't read in correctly. 2006-09-19 15:34:23 +00:00
christos e15ade632a Avoid empty if. 2006-09-13 00:54:00 +00:00
reinoud 0f0ed58759 Fix copying too much space from a small buffer. The chances of it actually
happening are small but corrupt media could trigger it.
2006-09-05 22:30:52 +00:00
reinoud 6014bf8aa0 Fix locking scheme in udf_mount() to follow more the other filingsystems.
For yet unknown reasons passing the LOCKLEAF flag to namei() did return a
locked vnode as was meant but would panic when a raw device was passed.
2006-09-05 17:03:04 +00:00
christos 61f2f34223 add missing initializers 2006-09-03 21:29:37 +00:00
christos 2e139ee910 add missing initializers 2006-09-03 07:08:59 +00:00
christos 644f53e4e9 add missing initializers 2006-09-03 06:51:04 +00:00
christos ce2bae8870 comment out empty code 2006-09-03 06:49:30 +00:00
christos 94de7229ef use c99 initializers 2006-09-03 06:48:26 +00:00
christos 9c03e39ea2 add missing initializer 2006-09-03 05:27:28 +00:00
christos 309d51fb22 add missing initializers 2006-09-03 04:56:33 +00:00
christos 88112b2ad5 add missing initializers 2006-09-02 07:30:30 +00:00
christos 66f851cf96 add missing initializers 2006-09-02 07:12:11 +00:00
reinoud 037fe176f0 Add shortcut for struct long_ad 's Unique ID hint that covers the lower 32
bits of the targeted files 64 bits Unique ID for recovery purposes.
2006-08-31 21:38:14 +00:00
christos eef4aaba6b Fix getdirentries() issue from FreeBSD PR - 78953 Quoting from that:
If you perform this request on a directory with exactly 50 files
(plus '.' and '..' which brings the total to 52 objects), the first
reply for the SMB server completely satisfies the query (server
side is Windows 2000 Professional).

The smbfs client then performs a TRANS2_FIND_NEXT2 using the last
file name as the resume key.  The response returns a SearchCount
of zero (ctx->f_ecnt == 0) and an EndOfSearch code of zero.

Any attempt to get more entries with calls to TRANS2_FIND_NEXT2
result in Badfid (bad file descriptor).  I suspect the return of
SearchCount of zero means that end-of-search has been reached and
the Sid is now closed.

The solution is to set "SMB_RDD_EOF | SMB_RDD_NOCLOSE" after getting
back a zero SearchCount,  I've tested this in the field on a quite
a few systems, aggressively accessing Windows shares over smbfs
and it appears flawless.

I was initially concerned about the possibility of resource exhaustion
on the Windows server. I was afraid by not officially closing the
search, it would leave a resource hung-up and over time, exhaust
some sort of "open search table" limit.  I've since convinced myself
this is NOT the case.

Windows needs to be able to handle clients that come and go over
time.  If the search is not closed, Windows will close it if it
finds it needs more resources.  I've testing this on directory
searches descending into 10's of thousands of folders, with 100's
of thousands of files.
2006-08-28 15:56:56 +00:00
christos e28a71d80a add missing initializers 2006-08-28 00:35:22 +00:00
christos 428665231e correct bogus loop test; used to be always true. 2006-08-28 00:28:51 +00:00
tsutsui b5825ccf25 Change types from int8_t to char for arrays which store char names. 2006-08-26 14:04:55 +00:00
reinoud 5b2c16b797 Fix small though important errors in the Ecma-167 structure definitions. 2006-08-25 17:43:51 +00:00
reinoud 7915eb6468 Fix pool allocation/freeing problem for once and for all correctly. Since
it was initialised quite late due to its reliance on disc data the mount
process could have stopped before initialising and thus could panic again
only now for uninitialising an not initialised pool! *sigh*
2006-08-22 16:52:41 +00:00
reinoud 5223c4995c Make a better guess on VAT locations so discs that are semi-standard
formatted can be recognised. This also fixes the bug that prevented UDF to
mount an empty CD-R/DVD*R disc.
2006-08-21 23:52:19 +00:00
reinoud 445a215f26 Fix spurious panic when twice remounting a bad filingsystem. It then gets
the same memory block allocated as before and it bombs out on its
descriptor pool allready being initialised. It turns out that the pool was
not allways destroyed. This fix ought to clean it up whatever the cause of
the mishap that results in a reject.
2006-08-21 22:23:09 +00:00
gdt 7db024f8e7 When mounting an MSDOS fileysystem, do not require that bytes 252 and
253 of the superblock be zero.  Searching the net failed to find any
justification for checking these bytes; all available references say
that they are part of the boot code and not BOOTSIG2 and BOOTSIG3.

Modify the MSDOS 7.1 bootsector definition to have 420 bytes of boot
code and no BOOTSIG[23], rather than 418 bytes of boot code, to follow
available references and apparent Windows practice.  A test build
showed that these defines are not used other than in the check removed
by this commit.

Patch tested on netbsd-3, and enabled mounting of a 4 GB CF formatted
under Windows XP and then in a digital camera.  The CF was previously
unmountable.

Concept approved on tech-kern by christos@ and martin@.
2006-08-14 14:06:26 +00:00