Commit Graph

1141 Commits

Author SHA1 Message Date
mlelstv ba0d32752c Replace individual queries for partition information with
new helper function.
2010-01-31 10:30:40 +00:00
mlelstv 61ec757e43 Drop two uses of disk label data.
msdosfs and cd9660 are the only filesystems that verify the filesystem
type in the label. This is the wrong place, sanity checks should only
rely on the inner structure of the filesystem (like signatures or
magic numbers).

msdosfs also used the device type information from the label to
deduce a filesystem parameter heuristically for the gemdos variant.
If there is no information inside the filesystem data itself, this
should be an explicit mount option.
2010-01-26 21:29:48 +00:00
joerg 816eaf9482 On broken filesystems the fillinmap inner loop may have never read a
block, so don't try to release it if bp==NULL.
2010-01-26 20:25:52 +00:00
mlelstv 02346e9564 Fetch sector size also from wedges. 2010-01-25 15:30:44 +00:00
pooka 3557ef52b9 In case the operations thread has exited, do not queue any more
operations.  This prevents kernel memory leaks (one of which happened
every time the file system was unmounted via PUFFSOP_UNMOUNT ...
and incidentally would've been trivially caught with the old
malloc(9) interface.  I wonder if the message is to use a ton of
pools instead of regression-attractive kmem interface).
2010-01-14 19:50:07 +00:00
pooka 50df98fe44 Since VOP_GETATTR() does not require a locked vnode, resolve and
reference the puffs_node before sending the request to the file
server.  This diminishes the window where the inode can be reclaimed
and be invalidated before it is accessed (but does not completely
eliminate the race, as that is a caller problem which we cannot
fix here).
2010-01-14 14:44:13 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
pooka 283c2ca905 Rename PUFFS_SOPREQ_EXIT to PUFFS_SOPREQSYS_EXIT to better signal
it comes from within the kernel instead of as a direct result of
a user request.

no functional change
2010-01-07 23:02:34 +00:00
pooka 8ed2ec74c7 Fix variable name in my commit tree too. 2010-01-07 22:59:27 +00:00
pooka d728f5380d Add a PUFFS_UNMOUNT server->kernel request, which causes the kernel
to initiate self destruct, i.e. unmount(MNT_FORCE).  This, however,
is a semi-controlled self-destruct, since all caches are flushed
before the (possibly) violent unmount takes place.
2010-01-07 22:45:31 +00:00
mbalmer 982581e04d Remove extra semicolons. 2010-01-05 13:30:10 +00:00
mbalmer a72f71643d Fix typo in comments, no code change. 2009-12-23 09:17:40 +00:00
pooka 4d6a407bdd Process flush requests from the file server in a separate thread
context.  This fixes a long-standing but seldomly seen deadlock,
where the kernel was holding pages busy (due to e.g. readahead
request) while waiting for the server to respond, and the server
made a callback into the kernel asking to invalidate those pages.
... or, well, theoretically fixes, since I didn't have any reliable
way of repeating the deadlock and I think I saw it only twice.
2009-12-07 20:57:55 +00:00
pooka 0ff1ef75c2 Need to send protocol layer response instead of transport layer
return value.  While there, just collapse all non-supported types
into one entry.
2009-12-07 15:51:52 +00:00
pooka 843ee69fbe Push all information cached in the vnode to the file server before
issuing INACTIVE.  PR kern/42194.
Also, send setattr in fsync asynchronously if FSYNC_WAIT is not set.
2009-12-04 20:26:35 +00:00
pooka d630c255de vrele, not vput for unlocked devvp 2009-12-03 14:29:04 +00:00
pooka 3f331fa147 Call VOP_CLOSE() in mount error branch with the device locked to
prevent crash when specfs attempts to unlock the vnode.
2009-12-01 09:28:02 +00:00
pooka 1643f3a7a1 Introduce genfs_statvfs() as pretty much a no-info statvfs and
convert several pseudo file systems to use it.
2009-11-30 10:59:19 +00:00
pooka 0ff76018d0 Yes, you need a VOP_UNLOCK() there. 2009-11-27 16:23:23 +00:00
pooka 8b53d2f9df Fix another fine example of "if you make the kernel panic, it's
more secure".
2009-11-27 16:11:35 +00:00
pooka 85fb4c9d18 Don't spam if mount fails due to invalid file system. 2009-11-27 15:58:39 +00:00
jmmv df61ab1eba Fix panic when trying to delete a directory entry (hi yamt!) by not
attempting to release a pnbuf that does not exist.

I.e. fixes "mkdir a ; unlink a/.".  And actually, this was caught by the
automated tests.
2009-11-22 17:09:58 +00:00
pooka c58b208bec Send VOP_ABORTOP() in case attempting cross-dev rename, part of
PR kern/42210.  Also, fix a memory management error in said case.
2009-11-19 16:21:04 +00:00
pooka 3214542837 Send VOP_ABORTOP() as a FAF -- we don't care about the return value. 2009-11-19 15:50:49 +00:00
rmind 7c653ba04c Simplify tmpfs_itimes() and use vfs_timestamp(). Also, replace unnecessary
kmem_zalloc()s with kmem_alloc()s.
2009-11-11 09:59:41 +00:00
pooka 1d8c6c1718 Kill suspend support. It was never implemented correctly:
* it depended on the biglock (in a very cruel way)
  * it was attached to userspace transactions rather than logical
    fs operations

(If someone wants to revisit it some day, most of the stuff can be
reused from cvs history)
2009-11-05 19:42:44 +00:00
pooka 1ed7a6beef Reinstante PNODE_DYING. vmlocking had a brief hiatus when it was not
a valid optimization, but that's long gone and once VOP_INACTIVE is
called and the file server says that the vnode is going to be recycled,
it really is going to be recycled extra references gained or not.
2009-11-05 19:22:57 +00:00
bouyer e0f9b22254 Remove closes 3 and 4 from my copyright. 2009-10-22 21:50:01 +00:00
tron 6492b9712e Add support for 64 bit file offsets to smbfs_smb_setfsize(), largely
based on code taken from FreeBSD.

This stops truncation of files larger than 4GB by VOP_SETATTR() which e.g.
happened when copying large files "rump_smbfs". Kudos to Antti Kantee
for diagnosing the problem in smbfs_smb_setfsize().
2009-10-20 20:55:01 +00:00
pooka 6f49a65bc8 Set recycle to false along with a comment screaming that it should
be set properly to recycle unused vnodes immediately.
2009-10-19 19:12:06 +00:00
tsutsui 3ef39e3a6a Apply a similar fix for mount function from ffs_vfsops.c rev 1.186:
Change cd9660_mount, in MNT_UPDATE case, to check dev_t's for equality
 instead of just vnode pointers.  Fixes erroneous "Invalid argument"
 errors from mount(8) with -u against cd9660 root in the presence of
 mfs or tmpfs /dev prepared after initial mountroot.

Tested on QEMU running cobalt Restore CD.
2009-10-19 17:53:36 +00:00
pooka 50222d88ba Bump protocol version once more to allow for previous to be pulled
to netbsd-5 (protocols are not compatible due to time_t/dev_t
change).
2009-10-17 23:22:04 +00:00
pooka 805e7ceb14 Transmit VOP_ABORTOP() to the server. 2009-10-17 23:16:05 +00:00
njoly 6a42e0741e Make tmpfs write fail when process file size limit is reached. 2009-10-17 22:20:56 +00:00
rmind 9abdb3b71e tmpfs_rename: handle hard-links correctly. Fixes PR/41236. 2009-10-06 00:17:24 +00:00
pooka 89f6fc1189 remove leading whitespace. no functional change. 2009-09-30 18:22:29 +00:00
pooka ce467a3bc2 * fix a race i introduced almost two years ago in rev 1.116:
operations creating a node cannot be considered outgoing operations,
  since after return from userspace they modify file system state
  by creating a new node.  if we do not protect the file system by
  holding the directory lock, a lookup operation might race us into
  the kernel and create the node earlier.
* remove pnode from hashlish before sending the reclaim faf off to
  userspace.  also, hold pmp_lock while frobbing the list.
2009-09-30 18:19:17 +00:00
pooka 8f328cc813 Set SAVENAME for rmdir and remove.
Addresses an easy part of PR kern/38188
2009-09-19 11:44:19 +00:00
reinoud c1a508d11c Rework simplistic UBC flushing. Recent changes to genfs made the old flush
system generate heaps of odd allocations since the end of write request was
overwritten by the start of the second resulting in another relocation.

Also added a full flush of the file on a VOP_CLOSE(). This automatically
flushes file tails to disc.
2009-09-14 21:10:44 +00:00
tsutsui 46d031a1e7 Fix typo:
-		pcinfo = kmem_zalloc(sizeof_puffs_cacheinfo) + runsize,
+		pcinfo = kmem_zalloc(sizeof(struct puffs_cacheinfo) + runsize,
in #ifdef'ed out code, per paired kmem_free() in the same function.
Closes PR kern/41840.
2009-09-12 18:17:55 +00:00
njoly f86bcbdece Fix set_statvfs_info() to use UIO_SYSSPACE for fromname kernel
allocated buffer.
2009-09-07 15:12:03 +00:00
pooka bca1bf1e84 set mntfromname in a less creative and historic fashion 2009-09-07 12:52:53 +00:00
pooka 7f37fbb7ea Install smb headers relevant for userspace and make mount_smbfs
use installed headers instead of src/sys.
2009-09-03 12:04:50 +00:00
pooka 6d7c95dd93 "kauth_action_t = KAUTH_VNODE_WRITE_FLAGS;" must be C**. However,
we still use plain ISO C, so additionally supply the variable name.
Compile-tested only, but at least that's some testing.
2009-09-03 11:22:05 +00:00
elad a162140107 Implement the vnode scope and adapt tmpfs to use it.
Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/07/04/msg005404.html
2009-09-03 04:45:27 +00:00
pooka 3a1b983101 Set vnode size after creation(*). Fixes cp(1) from ntfs, the
complaint in the "ntfs ubc_uiomove error" (ubc_uiomove error was
not coming from ntfs but instead the "to" file system) and PR
kern/38531 (well, I assume the submitter wanted cp(1) working on
ntfs instead of mangling ntfs the way the PR title suggests).  Yes,
mmap works on ntfs like it always has.

*) well, um, and in other places too ... uuuh ... no comments.
but I guess this works as long as in-kernel ntfs doesn't grow write
support.
2009-09-01 15:16:41 +00:00
phx 8a98af75d7 Fixed fatal warnings with ADOSFS_DIAGNOSTIC. 2009-08-30 12:36:38 +00:00
elad 534b11d931 Split nilfs_access() to nilfs_check_possible() and nilfs_check_permitted(). 2009-08-26 03:40:48 +00:00
reinoud 7c5a396997 Typo fix 2009-08-05 13:45:48 +00:00
reinoud 7cbe9b45a2 Fix uid/gid check; it was checking if the old values would fit in 32 bits
instead of checking if the new values would.
2009-07-30 12:13:51 +00:00