Commit Graph

1955 Commits

Author SHA1 Message Date
reinoud 4edad2cfab Fix typo: reader -> header 2021-12-16 22:24:10 +00:00
reinoud 333f39646c Fix serious issue with recordable media formatted with Win10. When closing it
after modification the VAT was written out corrupted making the disc
unreadable anymore on remount. Thanks for ig@ for spotting it in the wild!
2021-12-16 22:19:08 +00:00
reinoud 29d402ae1b Make sysctl udf.verbose dependent on UDF_DEBUG instead of DEBUG 2021-12-16 21:39:53 +00:00
reinoud e1403a7c21 While searching the VAT on recordable media, search the last sector too!
This fixes Win10 formatted discs from being mounted incorrectly.
2021-12-15 22:02:30 +00:00
andvar cbf5c65aff s/occured/occurred/ in comments, log messages and man pages. 2021-12-10 20:36:02 +00:00
andvar 8c4df4824b s/unaccessible/inaccessible/ 2021-12-10 19:30:05 +00:00
hannken d698d624c3 Fix previous, don't copy up if the underlying node is unreadable. 2021-12-10 09:20:38 +00:00
andvar 42412bc75c s/efficent/efficient/ in comments. 2021-12-08 20:11:54 +00:00
hannken ad8b31b9ce In union_access() copy up regular files before checking permissions.
Unionfs is meant to provide a writable layer above a read-only layer
and should not fail here just because the lower layer is mounted
read-only.
2021-12-05 16:16:58 +00:00
msaitoh 1271abf52e s/seach/search/ 2021-12-05 07:47:40 +00:00
msaitoh b5ffb2e0d6 s/filesytem/filesystem/ in comment. 2021-12-05 04:47:17 +00:00
msaitoh b707f36088 s/checkum/checksum/ in comment. 2021-12-05 04:32:36 +00:00
msaitoh ac1d1cd9ed s/alloction/allocation/ 2021-12-05 04:21:31 +00:00
msaitoh 43c6624729 s/invlid/invalid/ in comment. 2021-12-05 03:07:15 +00:00
pho 474e653866 Avoid using register_t in <fs/puffs/puffs_msgif.h>
The purpose of this header file is to interface between the
kernel-space and user-space, and is #include'd by a user-space header
<puffs.h>. It should therefore not use any of kernel-only types, as
it's not reasonable to require user-land filesystems to #define
_KERNTYPES.
2021-12-03 13:08:10 +00:00
msaitoh 3549533342 s/derefernce/dereference/ in comment. 2021-11-10 15:56:39 +00:00
thorpej 8086f46e37 Sanitize the symbol namespace. NFC. 2021-10-23 16:58:17 +00:00
hannken 5b6c6a9a2d Convert msdosfs_rename() to use genfs_sane_rename().
Based on work by Taylor R Campbell.
2021-10-23 07:45:03 +00:00
hannken e99cb814bd Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.
No functional change.
2021-10-23 07:41:37 +00:00
hannken 25fae635e5 Factor out the lookup results from struct denode.
No functional change.
2021-10-23 07:38:33 +00:00
thorpej 908da68346 Move a mis-placed KASSERT(). 2021-10-20 14:28:21 +00:00
thorpej 982ae832c3 Overhaul of the EVFILT_VNODE kevent(2) filter:
- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
  forcing each individual file system to deal with it (except VOP_RENAME(),
  because VOP_RENAME() is a mess and we currently have 2 different ways
  of handling it; at least it's reasonably well-centralized in the "new"
  way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
  compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
  to avoid doing work for events no one cares about (avoiding, e.g.
  taking locks and traversing the klist to send a NOTE_WRITE when
  someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
  to be invoked before and after vop_pre() and vop_post(), respectively.
  Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
  vop_*_args structures.  These context fields are used to convey information
  between the file system VOP function and the VOP wrapper, but do not
  occupy an argument slot in the VOP_*() call itself.  These context fields
  are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
  back the resulting link count of the target vnode.  Return this in tmpfs,
  udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
2021-10-20 03:08:16 +00:00
andvar b58602814f fix typos in word "successful". 2021-09-16 22:19:10 +00:00
andvar f9faf20aef fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/ 2021-09-03 21:54:58 +00:00
andvar 16e91b5f21 s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/ 2021-08-21 09:59:45 +00:00
andvar ca7653601e fix various typos in comments and log messages. 2021-08-20 20:25:26 +00:00
andvar 20fff34fc5 s/fist/first/ 2021-08-09 21:38:04 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
dholland f55bbd277c Abolish all the silly indirection macros for initializing vnode ops tables.
These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.

Part 2; cvs randomly didn't commit these changes before, and then hid
them from me until I touched the files to force it to rethink. Dunno
what happened.

There's probably more of these, going to have to scan the tree the
hard way.
2021-07-19 01:30:24 +00:00
dholland 3952deeeda Fix ptyfs link and symlink ops.
They were set (via macro obfuscation just eliminated) to
genfs_abortop, which is the wrong thing. These code paths are
currently inaccessible because of EROFS enforcement in namei, but if
either were reached odd behavior would likely ensue. Use
genfs_eopnotsupp like the rest of the ops that don't make sense here.
2021-07-18 23:57:34 +00:00
dholland 4171507047 Abolish all the silly indirection macros for initializing vnode ops tables.
These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.
2021-07-18 23:57:13 +00:00
dholland d819c3614f Use macros for the canned parts of device and fifo vnode op tables.
Add GENFS_SPECOP_ENTRIES and GENFS_FIFOOP_ENTRIES macros that contain
the portion of the vnode ops table declaration that is
(conservatively) the same in every fs. Use these in every fs that
supports devices and/or fifos with separate ops tables.

Note that ptyfs works differently (it has one type of vnode with
open-coded dispatch to the specfs code, which I haven't changed in
this commit) and rump/librump/rumpvfs/rumpfs.c has an indirect dynamic
dispatch that already does more or less the same thing, which I also
haven't changed.

Also note that this anticipates a few bits in the next changeset here
and there, and adds missing but unreachable calls in some cases (e.g.
most fses weren't defining whiteout on devices and fifos, but it isn't
reachable there), and it changes parsepath on devices and fifos to
genfs_badop from genfs_parsepath (but it's not reachable there
either).

It appears that devices in kernfs were missing kqfilter, so it's
possible that if you try to use kqueue on /kern/rootdev that it'll
explode.

And finally note that the ops declaration tables aren't
order-dependent. (Other than vop_default_desc has to come first.)
Otherwise this wouldn't work.
2021-07-18 23:56:12 +00:00
hannken 65349f1465 Fix union_parsepath(), either the upper or the lower dvp may be NULL. 2021-07-04 11:24:09 +00:00
dholland d9be54cead Now remove cn_consume from struct componentname.
This change requires a kernel bump.

Note though that I'm not going to version the VOP_LOOKUP args
structure (or any other args structure) as code that doesn't touch
cn_consume doesn't need attention and code that does will fail on it
without further intervention.
2021-06-29 22:39:20 +00:00
dholland a52da473da Onionfs needs to know about parsepath too, in case it has one of the
other cases underneath it.

The solution here is not really very good (take the longer
path-to-consume if they're different) but it will serve for the cases
that exist.

(If we were to add a fs that really uses different naming semantics,
we'd have to take additional steps; probably it doesn't make sense to
allow unionfs to union such a thing with a normal fs and attempting it
should fail at mount time.)

Update fs/unionfs as well to avoid increasing the current set of
compile failures there. Though maybe it's time to just remove
fs/unionfs.
2021-06-29 22:38:46 +00:00
dholland b7b49fc54d Implement VOP_PARSEPATH() for hfs.
This checks for a following "/rsrc" at the end of the pathname (to
indicate the resource fork of a file) and assimilates it into the
component name to be looked up. Then cn_namelen will already include
this text in lookup, and it's no longer necessary to muck with
cn_consume.

Invalid uses of "/rsrc" are ignored rather than rejected, which
appears to be the same as the old behavior. It is possible that the
parsepath logic should only consume the "/rsrc" if the name names a
file and not a directory, which would require looking it up in
parsepath and be a general nuisance; I hope not. It's also possible
that the whole thing doesn't work at all now, or it didn't before, as
I don't have any way to test it.
2021-06-29 22:37:50 +00:00
dholland c6c16cd073 - Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
 - Add a parsepath entry to every vnode ops table.

VOP_PARSEPATH takes a directory vnode to be searched and a complete
following path and chooses how much of that path to consume. To begin
with, all parsepath calls are genfs_parsepath, which locates the first
'/' as always.

Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
2021-06-29 22:34:05 +00:00
chs e3beb37645 VOP_BMAP() may be called via ioctl(FIOGETBMAP) on any vnode that applications
can open.  change various pseudo-fs *_bmap methods return an error instead of
panic.

Reported-by: syzbot+8289a3eaf2ba60958c87@syzkaller.appspotmail.com
2021-06-28 17:52:12 +00:00
hannken 618809e522 ntfs_loadntnode(): Use bread() when ntm_sysvn[NTFS_MFTINO] is NULL.
May happen when loading node 0 (MFT) during mount and some
attributes are stored in another ntnode.

PR kern/56160 (Mount ntfs usb disk)
2021-05-13 08:57:29 +00:00
mrg 97b36aa771 more GCC 10 fixes.
mDNSResponder: another wrong return local address

dhcp: ignore a seemingly impossible stringop overflow

hpacel: avoid maybe uninitialised error that is wrong.

rsh: avoid impossible malloc(0)

udf: cast pointers through (uintptr_t) to fool invalid boundary checks
2021-04-13 06:25:48 +00:00
christos 28e9fed55e Put a copy of our existing data first in the non-error case (noticed by RVP). 2021-04-01 19:00:33 +00:00
simonb 56f82c25d1 Don't use legacy VM types. 2021-03-29 02:13:37 +00:00
christos 47d63e29e1 give names to the enums so we can cast by name for lint 2021-03-08 17:34:30 +00:00
ryoon 28390de185 Enable to mount Raspberry Pi Pico's USB mass storage partition
Fix PR kern/55985.
O.k. by thorpej@.

Pull-up to netbsd-8 and netbsd-9.
2021-02-11 00:15:55 +00:00
skrll 49de5dda47 Trailing whitespace 2021-01-11 22:02:28 +00:00
skrll 89d6c918de Fix spelling of preferred in comments. While here improve grammar in
one of the comments.
2021-01-11 22:01:14 +00:00
chs 81a07a7135 Disable use of UBC_FAULTBUSY in tmpfs_write() for now,
which brings back zeroing of all new tmpfs data pages.
The existing code that enables this optimization skips the zeroing
in numerous cases where it is needed, resulting in corrupted files
and data leaks from the page's previous identity.
2020-12-13 19:22:02 +00:00
christos cce00501ee make the order of the arguments in the PTYFS_FILENO macro consistent with
the order in the function calls. One of them was incorrect. Noticed by martin@
2020-11-27 14:43:57 +00:00
christos e5ca99ea1c PR/55821: tar can not extract base.tgz anymore (./dev/pts and mounted ptyfs)
Allow chown/chmod at the root of ptyfs.
2020-11-24 16:38:31 +00:00
msaitoh cccc3d1cb5 s/implicitely/implicitly/ 2020-09-29 03:02:18 +00:00