Home | History | Annotate | only in /src/lib/libp2k
History log of /src/lib/libp2k
RevisionDateAuthorComments
 1.4 23-Jan-2016  christos Define _KERNTYPES for things that need it.
 1.3 11-Sep-2013  joerg If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
 1.2 27-Nov-2008  pooka branches: 1.2.8; 1.2.14;
LIBDPLIBS on librumpvfs
 1.1 29-Jul-2008  pooka branches: 1.1.2;
Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 29-Jul-2008  wrstuden file Makefile was added on branch wrstuden-revivesa on 2008-09-18 04:39:23 +0000
 1.2.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1 03-Apr-2013  agc branches: 1.1.2;
file Version.map was initially added on branch agc-symver.
 1.1.2.1 03-Apr-2013  agc Add symbol versioning information for the following libraries:

libbluetooth
libbsdmalloc
libexecinfo
libform
libintl
libipsec
libkvm
liblwres
libnpf
libp2k
libpci
libperfuse
libppath
libprop
libpuffs
librefuse
librpcsvc
librt
librumpclient
librumphijack
librumpuser
libukfs
libusbhid
libwrap
 1.13 13-Oct-2024  rillig lib: sync some manual pages with reality
 1.12 11-Jul-2022  andvar branches: 1.12.4;
p2k(3): drop reference to rump_smbfs(8).
 1.11 16-Sep-2021  andvar fix typos in word "successful".
 1.10 07-Jan-2011  pooka Make P2K_WIZARDUID require a valid integer instead of defaulting to root.
 1.9 07-Jan-2011  pooka Document how to get debug info for the mount.
 1.8 20-May-2010  jruoho Use standard section headers.

Xref vfs(9), which could be slightly more elaborate.
 1.7 21-Nov-2009  wiz Fix typo and uppercase UID.
 1.6 21-Nov-2009  pooka Update for recent interface additions.
 1.5 21-Nov-2009  pooka document P2K_WIZARDUID
 1.4 03-May-2009  pooka make it possible to disable puffs caches
 1.3 10-Feb-2009  pooka document P2K_DEBUG and P2K_NODETACH
 1.2 12-Nov-2008  pooka branches: 1.2.2;
reference rump_nfs
 1.1 29-Jul-2008  pooka branches: 1.1.2;
Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 29-Jul-2008  wrstuden file p2k.3 was added on branch wrstuden-revivesa on 2008-09-18 04:39:23 +0000
 1.2.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.12.4.1 02-Aug-2025  perseant Sync with HEAD
 1.75 24-May-2022  andvar fix various typos in comment, documentation and log messages.
 1.74 19-Apr-2022  rillig lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
 1.73 23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.72 20-Feb-2020  riastradh Fix kassert in lfs by initializing vp first.
 1.71 23-Sep-2019  christos Restore binary compatibility by using the statvfs90 structure internally.
 1.70 26-Apr-2017  riastradh branches: 1.70.12; 1.70.14;
Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.

No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
 1.69 11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.68 25-Jan-2016  pooka branches: 1.68.2; 1.68.4;
Don't include <rump/rumpvnode_if.h> from rump.h. It's not needed
unless you're doing something special, but requires register_t.
Adjust the few places which actually need rumpvnode_if.h.
 1.67 23-Jan-2016  christos Don't include <sys/vnode.h> to get the pager constants.
 1.66 20-Apr-2015  riastradh Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.65 20-Apr-2015  riastradh Release dir after create/mknod/mkdir/symlink as 6.99.29 required.
 1.64 10-Mar-2014  pooka rump_pub_getversion -> rump_getversion
 1.63 07-Feb-2014  hannken 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
 1.62 23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.61 17-Jan-2014  hannken 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
 1.60 23-Nov-2012  joerg Explicitly cast enum type.
 1.59 18-Nov-2012  pooka s/EJUSTRETURN/RUMP_EJUSTRETURN/
 1.58 18-Nov-2012  pooka Finally remove the "temporary" __VTYPE_DEFINED stuff I added >5 years ago.
 1.57 16-Aug-2012  manu branches: 1.57.2;
Fix regression that has been introduced when the lookup/reclaim race
condition was addressed in libpuffs by counting lookups.

The fix assumes that cookies map to struct puffs_cookie, which has not
been documented as a requirement for filesystems using libpuffs. As an
example, we got burnt by this assumption in libp2k (kern/46734), and
we fixed bit by actually mapping libp2k cookies to struct puffs_node.

It is unlikely, but there may be third party filesystems that use cookies
unmapped to struct puffs_node, and they were left broken for now.

- we introduce a puffs_init() flag PUFFS_FLAG_PNCOOKIE that let filesystems
inform libpuffs that they map cookies to struct puffs_node. Is that flag
is used, the lookup/reclaim race condition fix is enabled. We enable the
flag for libp2k.

- filesystems that use puffs_pn_new() obviouslty use struct puffs_node
and gain PUFFS_FLAG_PNCOOKIE automatically even if they did not specify
it in puffs_init(). This include all our PUFFS filesystem in-tree except
libp2k.

- for filesystems not willing to use struct puffs_node, we introduce a
reclaim2 vnop, which is reclaim with an additionnal lookup count argument.
This vnop let the filesystem implement the lookup/reclaim race fix on
its own.
 1.56 12-Aug-2012  manu libpuffs and libp2k both use the cookie to different structure, which now
leads to struct p2k_node corruption now that libpuffs used pn_nlookup field
in struct puffs_node to avoid race conditions.

Attempt to fix that by adding a struct puffs_node at the beginning of struct
p2k_node. This seems to fix kern/46734
 1.55 04-Jul-2011  manu branches: 1.55.2; 1.55.4;
Add a flag to VOP_LISTEXTATTR(9) so that the vnode interface can tell the
filesystem in which format extended attribute shall be listed.

There are currently two formats:
- NUL-terminated strings, used for listxattr(2), this is the default.
- one byte length-pprefixed, non NUL-terminated strings, used for
extattr_list_file(2), which is obtanined by setting the
EXTATTR_LIST_PREFIXLEN flag to VOP_LISTEXTATTR(9)

This approach avoid the need for converting the list back and forth, except
in libperfuse, since FUSE uses NUL-terminated strings, and the kernel may
have requested EXTATTR_LIST_PREFIXLEN.
 1.54 07-Jan-2011  pooka Make P2K_WIZARDUID require a valid integer instead of defaulting to root.
 1.53 07-Jan-2011  pooka In case of a P2K_DEBUG mount, dump mount point contents when the
process receives SIGINFO. Additionally, dump vnode status if the
process gets SIGUSR1 (can be quite quite verbose, therefore not
displayed with SIGINFO).
 1.52 07-Jan-2011  pooka in case unmount fails (it never should), do a full mountpoint dump
 1.51 07-Jan-2011  pooka Remove the componentname-saving code since it was addressing
SAVENAME/HASBUF/SAVESTART and they don't exist anymore (and the
removed code didn't compile on nb5).
 1.50 07-Jan-2011  pooka Fix file handles. Problem reported & fix tested by kefren.
 1.49 02-Jan-2011  pooka rump_lwproc_newproc -> rump_lwproc_rfork
 1.48 02-Jan-2011  dholland Add an INRELOOKUP namei flag. Sigh. (We don't need more namei flags.)

However, because of a protocol deficiency puffs relies on being able
to keep track of VOP_LOOKUP calls by inspecting their contents, and
this at least allows it to use something vaguely principled instead of
making wild guesses based on whether SAVESTART is set.

Update libp2k to use INRELOOKUP instead of SAVESTART.
 1.47 30-Nov-2010  pooka Remove dead code from previous revision.
 1.46 30-Nov-2010  dholland SAVENAME and HASBUF namei flags have been removed; update accordingly.
(pooka@ says not to worry about compat.)
 1.45 26-Nov-2010  pooka update comment
 1.44 07-Sep-2010  pooka Simplify now that ukfs deals with being called from a thread which
already has a rump lwp context.
 1.43 07-Sep-2010  pooka Migrate from rump private interfaces to syscalls.
 1.42 01-Sep-2010  pooka update to new rump proc/lwp interfaces
 1.41 24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.40 07-Jun-2010  pooka no need to typecast in pathconf anymore
 1.39 06-Jun-2010  pooka Pass VOP_PATHCONF to backend file server. inspired by njoly.
 1.38 21-May-2010  pooka support extended attributes
 1.37 20-May-2010  pooka Initialize "hasdebug" default deterministically.
 1.36 01-May-2010  pooka If P2K_DEBUG is given, also dump rump kernel event counters when
file system is unmounted.
 1.35 29-Apr-2010  pooka If vfstype is MOUNT_RUMPFS, assume we don't actually want to mount
a file system, but attach to the root in the fs namespace of a rump
kernel.
 1.34 14-Apr-2010  pooka Some _t purification. no functional change.
 1.33 23-Dec-2009  pooka Technically we're supposed to use flags from the RUMP_NAMEI namespace
instead of NAMEI directly. Probably doesn't matter in practise,
since the chances of this running on non-NetBSD are low. But make
it correct anyway.
 1.32 23-Dec-2009  pooka Use NAMEI_INRENAME to improve the situation with detecting on when
to save componentname instead of looking at SAVESTART. Not perfect,
but better. Also, try to be more forgiving of kernel bugs.
 1.31 16-Dec-2009  pooka Don't VOP_PUTPAGES(PGO_FREE) in inactive for tmpfs, since we now
(after some changes to rump) actually free those pages, leaving
the tmpfs vnode feeling quite empty.
(the purpose of the flush is to avoid double caching between the
rump kernel and puffs vfs layer)
 1.30 03-Dec-2009  pooka Adapt ukfs users to the new ukfs_part interface.
 1.29 20-Nov-2009  pooka Report actual group array size instead of 0 (which always gives back 0 grousp).
 1.28 20-Nov-2009  pooka Add "wizardmode", which allows to specify the uid which is used to
access the file system instead of using the caller uid. This is
useful for example when modifying the root fs image for an OS
installation without wanting to dance around as root on the host.

idspispopd
 1.27 19-Oct-2009  pooka Default "recycle" to false in inactive. File system drivers do
not always set it.
 1.26 18-Oct-2009  pooka Split init routines a bit more to allow for p2k init without having
to pass any real configuration data. This benefits things like
rump_smbfs which need to init rump before running the userspace
mount routines (because they make rump system calls) but cannot
run p2k_setup() at that stage because it requires data provided by
the userspace mount routines. And p2k_setup() in turn forks (to
detach), so it cannot be run after rump has been inited and threads
have been created.
 1.25 17-Oct-2009  pooka Implement abortop.
 1.24 15-Oct-2009  pooka use newstyle rump lwp interfaces
 1.23 14-Oct-2009  pooka Adjust names of external rump control interfaces to match the
new rump_pub namespace.
 1.22 13-Oct-2009  pooka Expand rump curlwp macro.
 1.21 09-Oct-2009  pooka Expose a separate mount and run interface for those servers which
want to perform actions after mounting.
 1.20 07-Oct-2009  pooka puffs might call getattr after we decided to recycle node. protect.
 1.19 07-Oct-2009  pooka Provide p2k_run_diskfs(), which acts like p2k_run_fs(), but taps
into ukfs_mount_disk() instead of ukfs_mount()
 1.18 06-Oct-2009  pooka don't double free p2m
 1.17 06-Oct-2009  pooka Give a p2k node an internal state. This allows us to do proper
reference counting and not release nodes based just on puffs'
impression of if they are free.

This also allows us to reclaim vnodes already in inactive if the
file system so desires. Some file systems, most notably ffs, change
file state already in inactive. This could lead to a deadlock in
the middle of inactive and reclaim if some other puffs operation
was processed in between (as exposed by haad's open(at) test
program).

Also, properly thread the componentname from lookup to the actual
vnode operation. This required the changes the rump componentname
routines. Yes, the rename case is truly mindbogglingly disgusting.
Puke for yourself.
 1.16 04-Aug-2009  pooka supply proper flags to pager
 1.15 22-Jul-2009  pooka * catch up with the ukfs changes
* leave mounted fs reference counting totally up to le coq grande
and simply force an unmount if the kernel has decided the mountpoint
is not busy
 1.14 22-May-2009  pooka Support mounting post-time_t rump file systems on a pre-time_t host.
 1.13 03-May-2009  pooka make it possible to disable puffs caches
 1.12 03-May-2009  pooka rump_cred_destroy -> rump_cred_put
 1.11 02-Apr-2009  pooka ARGSUSED makes lindt a happy camper
 1.10 26-Mar-2009  pooka Don't abort() if the kernel complains we supplied an invalid type
for lookup, as this most likely means that the fs has some bad file
on it. Rather, just flag an error to the user and be happy.
 1.9 22-Feb-2009  ad PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
 1.8 10-Feb-2009  pooka If P2K_NODETACH is set in the env, do not .. well .. detach.
 1.7 12-Dec-2008  pooka branches: 1.7.2;
Defer ukfs (and hence rump) init until after detaching from console.
Otherwise forking when detaching will nuke our potential precious
threads.
 1.6 14-Nov-2008  pooka Detach from console by default unless P2K_DEBUG is set in the
environment. We can't pass this as a flag, since rump_foo should
remain usage-compatible with mount_foo and therefore can't accept
puffs flags as command line parameters.
 1.5 07-Oct-2008  pooka check ukfs_init() return value
 1.4 30-Sep-2008  pooka Do not clear curlwp after request if we have unmounted. This avoids
an annoying side effect of the reference counting nightmare, namely
trying to vrele() a recently-ceased-to-be cwd.
 1.3 12-Aug-2008  pooka branches: 1.3.2;
void * -> puffs_cookie_t
no functional change
 1.2 30-Jul-2008  pooka Nuke __VFSOPS_EXPOSE, it hasn't been used in ages.
 1.1 29-Jul-2008  pooka Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.3.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.2.1 12-Aug-2008  wrstuden file p2k.c was added on branch wrstuden-revivesa on 2008-09-18 04:39:23 +0000
 1.7.2.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.55.4.2 13-Sep-2012  riz Pull up following revision(s) (requested by manu in ticket #525):
lib/libpuffs/dispatcher.c: revision 1.44
lib/libp2k/p2k.c: revision 1.57
lib/libpuffs/puffs_ops.3: revision 1.35
lib/libpuffs/pnode.c: revision 1.13
lib/libpuffs/puffs.3: revision 1.56
lib/libpuffs/puffs.h: revision 1.124
Fix regression that has been introduced when the lookup/reclaim race
condition was addressed in libpuffs by counting lookups.
The fix assumes that cookies map to struct puffs_cookie, which has not
been documented as a requirement for filesystems using libpuffs. As an
example, we got burnt by this assumption in libp2k (kern/46734), and
we fixed bit by actually mapping libp2k cookies to struct puffs_node.
It is unlikely, but there may be third party filesystems that use cookies
unmapped to struct puffs_node, and they were left broken for now.
- we introduce a puffs_init() flag PUFFS_FLAG_PNCOOKIE that let filesystems
inform libpuffs that they map cookies to struct puffs_node. Is that flag
is used, the lookup/reclaim race condition fix is enabled. We enable the
flag for libp2k.
- filesystems that use puffs_pn_new() obviouslty use struct puffs_node
and gain PUFFS_FLAG_PNCOOKIE automatically even if they did not specify
it in puffs_init(). This include all our PUFFS filesystem in-tree except
libp2k.
- for filesystems not willing to use struct puffs_node, we introduce a
reclaim2 vnop, which is reclaim with an additionnal lookup count argument.
This vnop let the filesystem implement the lookup/reclaim race fix on
its own.
 1.55.4.1 12-Aug-2012  martin branches: 1.55.4.1.2;
Pull up following revision(s) (requested by manu in ticket #483):
lib/libp2k/p2k.c: revision 1.56
libpuffs and libp2k both use the cookie to different structure, which now
leads to struct p2k_node corruption now that libpuffs used pn_nlookup field
in struct puffs_node to avoid race conditions.
Attempt to fix that by adding a struct puffs_node at the beginning of struct
p2k_node. This seems to fix kern/46734
 1.55.4.1.2.1 01-Nov-2012  matt sync with netbsd-6-0-RELEASE.
 1.55.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.55.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.55.2.1 30-Oct-2012  yamt sync with head
 1.57.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.2.2 25-Feb-2013  tls resync with head
 1.57.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.68.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.68.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.70.14.1 17-Aug-2020  martin Pull up following revision(s) (requested by riastradh in ticket #1050):

sys/ufs/lfs/lfs_subr.c: revision 1.101
sys/ufs/lfs/lfs_subr.c: revision 1.102
sys/ufs/lfs/lfs_inode.c: revision 1.158
sys/ufs/lfs/lfs_inode.h: revision 1.25
sys/ufs/lfs/lfs_balloc.c: revision 1.95
sys/ufs/lfs/lfs_pages.c: revision 1.21
sys/ufs/lfs/lfs_vnops.c: revision 1.330
sys/ufs/lfs/lfs_alloc.c: revision 1.140 (patch)
sys/ufs/lfs/lfs_alloc.c: revision 1.141 (patch)
lib/libp2k/p2k.c: revision 1.72
sys/ufs/lfs/lfs.h: revision 1.205
sys/ufs/lfs/lfs.h: revision 1.206
sys/ufs/lfs/lfs_segment.c: revision 1.284
sys/ufs/lfs/lfs.h: revision 1.207
sys/ufs/lfs/lfs_segment.c: revision 1.285
sys/ufs/lfs/lfs_debug.c: revision 1.55
sys/ufs/lfs/lfs_rename.c: revision 1.23
usr.sbin/dumplfs/dumplfs.c: revision 1.65
sys/ufs/lfs/lfs_vfsops.c: revision 1.371
sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.3
sys/ufs/lfs/lfs_vfsops.c: revision 1.372
sys/ufs/lfs/lfs_vfsops.c: revision 1.373
sbin/fsck_lfs/pass1.c: revision 1.46
sys/ufs/lfs/lfs_vnops.c: revision 1.326
sys/ufs/lfs/lfs_vnops.c: revision 1.327
sys/ufs/lfs/lfs_vfsops.c: revision 1.375 (patch)
sys/ufs/lfs/lfs_vnops.c: revision 1.328
sys/ufs/lfs/lfs_subr.c: revision 1.98
sys/ufs/lfs/lfs_extern.h: revision 1.116
sys/ufs/lfs/lfs_vnops.c: revision 1.329
sys/ufs/lfs/lfs_subr.c: revision 1.99
sys/ufs/lfs/lfs_extern.h: revision 1.117
sys/ufs/lfs/lfs_accessors.h: revision 1.49
sys/ufs/lfs/lfs_extern.h: revision 1.118
sys/rump/fs/lib/liblfs/Makefile: revision 1.15
sys/ufs/lfs/lfs_bio.c: revision 1.146 (patch)
sys/ufs/lfs/lfs_bio.c: revision 1.147
sys/ufs/lfs/lfs_subr.c: revision 1.100

Fix kassert in lfs by initializing vp first.

Use a marker node to iterate lfs_dchainhd / i_lfs_dchain.

I believe elements can be removed while the lock is dropped,
including the next node we're hanging on to.

Just use VOP_BWRITE for lfs_bwrite_log.
Hope this doesn't cause trouble with vfs_suspend.

Teach lfs to transition ro<->rw.

Prevent new dirops while we issue lfs_flush_dirops.

lfs_flush_dirops assumes (by KASSERT((ip->i_state & IN_ADIROP) == 0))
that vnodes on the dchain will not become involved in active dirops
even while holding no other locks (lfs_lock, v_interlock), so we must
set lfs_writer here. All other callers already set lfs_writer.

We set fs->lfs_writer++ without explicitly doing lfs_writer_enter
because
(a) we already waited for the dirops to drain, and
(b) we hold lfs_lock and cannot drop it before setting lfs_writer.

Assert lfs_writer where I think we can now prove it.

Serialize access to the splay tree with lfs_lock.

Change some cheap KDASSERT into KASSERT.

Take a reference and fix assertions in lfs_flush_dirops.
Fixes panic:
KASSERT((ip->i_state & IN_ADIROP) == 0) at lfs_vnops.c:1670
lfs_flush_dirops
lfs_check
lfs_setattr
VOP_SETATTR
change_mode
sys_fchmod
syscall

This assertion -- and the assertion that vp->v_uflag has VU_DIROP set
-- is valid only until we release lfs_lock, because we may race with
lfs_unmark_dirop which will remove the nodes and change the flags.

Further, vp itself is valid only as long as it is referenced, which it
is as long as it's on the dchain, but lfs_unmark_dirop drops the
dchain's reference.

Don't lfs_writer_enter while holding v_interlock.

There's no need to lfs_writer_enter at all here, as far as I can see.
lfs_flush_fs will do it for us.

Break deadlock in PR kern/52301.

The lock order is lfs_writer -> lfs_seglock. The problem in 52301 is
that lfs_segwrite violates this lock order by sometimes doing
lfs_seglock -> lfs_writer, either (a) when doing a checkpoint or (b),
opportunistically, when there are no dirops pending. Both cases can
deadlock, because dirops sometimes take the seglock (lfs_truncate,
lfs_valloc, lfs_vfree):
(a) There may be dirops pending, and they may be waiting for the
seglock, so we can't wait for them to complete while holding the
seglock.
(b) The test for fs->lfs_dirops == 0 happens unlocked, and the state
may change by the time lfs_writer_enter acquires lfs_lock.

To resolve this in each case:
(a) Do lfs_writer_enter before lfs_seglock, since we will need it
unconditionally anyway. The worst performance impact of this should
be that some dirops get delayed a little bit.
(b) Create a new lfs_writer_tryenter to use at this point so that the
test for fs->lfs_dirops == 0 and the acquisition of lfs_writer happen
atomically under lfs_lock.

Initialize/destroy lfs_allclean_wakeup in modcmd, not lfs_mountfs.

Fixes reloading lfs.kmod.

In lfs_update, hold lfs_writer around lfs_vflush.

Otherwise, we might do
lfs_vflush
-> lfs_seglock
-> lfs_segwait(SEGM_CKP)
-> lfs_writer_enter
which is the reverse of the lfs_writer -> lfs_seglock ordering.

Call lfs_orphan in lfs_rename while we're still in the dirop.
lfs_writer_enter can't fail; keep it simple and don't pretend it can.

Assert that mtsleep can't fail either -- it doesn't catch signals and
there's no timeout.

Teach LFS_ORPHAN_NEXTFREE about lfs64.

Dust off the orphan detection code and try to make it work.

Fix !DIAGNOSTIC compile

Fix userland references to LFS_ORPHAN_NEXTFREE.

Forgot to grep for these or do a full distribution build, oops!

Fix missing <sys/evcnt.h> by removing the evcnts instead.

Just wanted to confirm that a race might happen, and indeed it did.
These serve little diagnostic value otherwise.

OR into bp->b_cflags; don't overwrite.

CTASSERT lfs on-disk structure sizes.

Avoid misaligned access to lfs64 on-disk records in memory.
lfs64 directory entries are only 32-bit aligned in order to conserve
space in directory blocks, and we had a hack to stuff a 64-bit inode
in them. This replaces the hack by __aligned(4) __packed, and goes
further:

1. It's not clear that all the other lfs64 data structures are 64-bit
aligned on disk to begin with. We can go through these later and
upgrade them from
struct foo64 {
...
} __aligned(4) __packed;
union foo {
struct foo64 f64;
...
};
to
struct foo64 {
...
};
union foo {
struct foo64 f64 __aligned(8);
...
} __aligned(4) __packed;
if we really want to take advantage of 64-bit memory accesses.
However, the __aligned(4) __packed must remain on the union
because:
2. We access even the lfs32 data structures via a union that has
lfs64 members, and it turns out that compilers will assume access
through a union with 64-bit aligned members implies the whole
union has 64-bit alignment, even if we're only accessing a 32-bit
aligned member.

Fix clang build after packed lfs64 accessor change.

Suppress spurious address-of-packed error in rump lfs too.
 1.70.12.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.70.12.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.1 21-Nov-2024  riastradh branches: 1.1.4;
libp2k: Add expected symbols list.

PR lib/58838: shared libraries in base should all have expsym lists
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 21-Nov-2024  perseant file p2k.expsym was added on branch perseant-exfatfs on 2025-08-02 05:54:53 +0000
 1.8 21-Mar-2011  pooka update copyright
 1.7 03-Dec-2009  pooka Adapt ukfs users to the new ukfs_part interface.
 1.6 21-Nov-2009  pooka nuke leading whitespace
 1.5 18-Oct-2009  pooka Split init routines a bit more to allow for p2k init without having
to pass any real configuration data. This benefits things like
rump_smbfs which need to init rump before running the userspace
mount routines (because they make rump system calls) but cannot
run p2k_setup() at that stage because it requires data provided by
the userspace mount routines. And p2k_setup() in turn forks (to
detach), so it cannot be run after rump has been inited and threads
have been created.
 1.4 09-Oct-2009  pooka Expose a separate mount and run interface for those servers which
want to perform actions after mounting.
 1.3 07-Oct-2009  pooka Provide p2k_run_diskfs(), which acts like p2k_run_fs(), but taps
into ukfs_mount_disk() instead of ukfs_mount()
 1.2 01-Aug-2008  pooka branches: 1.2.2;
__{BEGIN,END}_DECLS
 1.1 29-Jul-2008  pooka Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 01-Aug-2008  wrstuden file p2k.h was added on branch wrstuden-revivesa on 2008-09-18 04:39:23 +0000
 1.3 21-May-2010  pooka bump major of libs NEEDING libpuffs
 1.2 11-Jan-2009  christos bump shared libraries.
 1.1 29-Jul-2008  pooka branches: 1.1.2;
Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 29-Jul-2008  wrstuden file shlib_version was added on branch wrstuden-revivesa on 2008-09-18 04:39:23 +0000

RSS XML Feed