Home | History | Annotate | Download | only in mount_9p
History log of /src/usr.sbin/puffs/mount_9p/node.c
RevisionDateAuthorComments
 1.32  10-Mar-2025  riastradh mount_9p(8): Implement pathconf stub.

Doesn't actually do anything useful -- it just returns EINVAL as
pathconf is supposed to for unknown pathconf key names; by default, it
will return ENOTSUPP, which leads applications like ls(1) to print:

ls: /mnt/.git: Operation not supported

This is a little silly; perhaps puffs should use EINVAL itself instead
of ENOTSUPP. But this change is less risky for now.

PR bin/58768: mount_9p: missing pathconf(2) support
 1.31  02-Mar-2022  ozaki-r mount_9p: check returned type for Tread
 1.30  02-Mar-2022  ozaki-r mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server. Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.
 1.29  01-Jun-2020  uwe Fix extra whitespace added by accident.
 1.28  27-May-2020  uwe puffs9p_node_rename - 9P rename is done with Twstat and can only
change the last pathname component. Return EXDEV for attempts to move
a file to a different directory to make mv(1) fall back to copying.
 1.27  27-May-2020  uwe noderemove - do not call puffs_setback here. noderemove is called
from rename (for existing target) and calling setback is not
appropriate in that context. Do that call instead directly in the
callers (remove, rmdir).

From Nicola Girardi, part of PR/54829.
 1.26  27-May-2020  uwe puffs9p_node_rename - noderename takes puffs_node, not p9pnode, but
this goes undetected b/c pn_data we pass is a pointer to void.

From Nicola Girardi, part of PR/54829.
 1.25  26-May-2020  uwe Use the typedef to declare tag in AUTOVAR. Do not allocate 9P tags in
advance in AUTOVAR, do it right before we need them. Do no reuse tags.
If we are going to use sequential tags, we might as well try to make
them really sequential.
 1.24  26-May-2020  uwe puffs9p_node_lookup - use the right type for tfid.
 1.23  07-Jun-2019  ozaki-r branches: 1.23.2;
Handle Rerror and return errno correctly (only for 9P2000.u for now)
 1.22  17-May-2019  ozaki-r mount_9p: add initial support for 9P2000.u

The implementation enables to work with a server talking 9P2000.u. However, it
doesn't use the extended fields yet; it just ignores those of received messages
and sets "please ignore" values to those of sending messages such as zero-length
strings and maximum unsigned values.

The feature is enabled by the -u option.
 1.21  18-Jan-2009  lukem branches: 1.21.40; 1.21.48;
fix -Wsign-compare issues
 1.20  22-Aug-2008  pooka * Apparently u9fs returns the inode number as the unique qidpath.
This is fairly annoying if browsing a hierarchy with multiple file
systems mounted, since at least inode 2 is fairly common. Compensate
by comparing modification time also. Not perfect, but ....
* Don't loop eternally if we attempt to read at or past EOF. Fixes
reading files on a non-cached mount.
 1.19  30-Nov-2007  pooka branches: 1.19.8;
Rototill.

Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?). Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it. This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
 1.18  27-Nov-2007  pooka Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces. puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
 1.17  13-Oct-2007  pooka Execute getattr in lookup to get file size. The kernel doesn't
anymore do this if we fail to set size.

The whole lookup procedure should be done in a smarter fashion,
but this is the quickie fix to get things working again.
 1.16  02-Jul-2007  pooka branches: 1.16.4;
adapt: inactive no longer comes with int *refcount (not that it was
used except for setting the default here anyway)
 1.15  01-Jul-2007  pooka adapt: **newnode etc. pointers -> struct puffs_newinfo
 1.14  01-Jul-2007  pooka adapt: pid -> const struct puffs_cid *
 1.13  24-Jun-2007  pooka Call puffs_pn_remove() just in case the file server happens to be
quick with recycling qids.
 1.12  19-May-2007  pooka support reclaim. set noref setback when removing a node to prompt
immediate reclaim.
 1.11  16-May-2007  pooka Enhance the GETRESPONSE, JUSTSEND and SENDCB macros to process the
return value from the network layer.
 1.10  15-May-2007  pooka In case we counter a protocol error while parsing the readdir response,
completely release our directory cookie - it's unlike we'll be coming
back to it. And if we do, it'll just be autogenerated.

CID 4487
 1.9  15-May-2007  pooka free name from proto_getstat() after use

CID 4488
 1.8  11-May-2007  pooka adapt to puffs_framebuf changes
 1.7  07-May-2007  pooka Use inactive-on-demand, set inactive request in open() to close
file handles when last reference is removed from the kernel.
 1.6  06-May-2007  pooka If mode is set, the uppermost byte specifying the type must be
correctly, otherwise the file server will attempt a conversion.
Specifically, if the directory bit is not set when changing the
permissions for a directory, a conversion from directory to regular
file would be attempted and naturally it being unsupported the
whole chmod would fail. So supply the file type as part of the
file mode.
 1.5  06-May-2007  pooka Close file handles in inactive instead of close - a memory mapping
may still be active after a vnode is closed
 1.4  05-May-2007  pooka Adapt to use puffs_framebuf. This gets rid of most of the duplicated
code between mount_psshfs and mount_9p and clarifies the code
structure.
 1.3  04-May-2007  pooka Fix a couple of gotchas left after AUTOVAR() started creating the
network buffers.

CID 4477, 4478, 4479, 4480
 1.2  22-Apr-2007  pooka Alter the strategy for reading/writing a bit. First of all, use
PUFFS_KFLAG_WTCACHE. Second, create separate fids for reading and
writing. If opening for read, open a read-only fid and for write
a write-only fid; use these for reading and writing. When the
open-count for a node drops to zero, clunk both. This avoids hitting
the fid limit when accessing large directory hierarchies.

Two problems remain:
* does not take credentials into account, although we can only mount
the remote 9P file server with one set of credentials, so not a
huge worry
* doesn't work for the open/mmap/close/access_memory_window case, but
that will require some further kernel changes
 1.1  21-Apr-2007  pooka mount_9p: mount a file server using the Plan9 file sharing protocol

Works, but lots of little things to nibble on:
* fix permissions to work better
* limit the amount of open files required
* do constant folding with psshfs code
* support authentication
etcetc.
 1.16.4.2  09-Jan-2008  matt sync with HEAD
 1.16.4.1  06-Nov-2007  matt sync with HEAD
 1.19.8.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.48.1  10-Jun-2019  christos Sync with HEAD
 1.21.40.2  18-Mar-2022  martin Minimal build fix for ticket #1738
 1.21.40.1  15-Mar-2022  martin Pull up following revision(s) (requested by ozaki-r in ticket #1738):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server. Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

-

mount_9p: check returned type for Tread
 1.23.2.1  15-Mar-2022  martin Pull up following revision(s) (requested by ozaki-r in ticket #1434):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server. Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

-

mount_9p: check returned type for Tread

RSS XML Feed