summaryrefslogtreecommitdiff
path: root/sys/fs/union
AgeCommit message (Collapse)Author
2023-02-13When mounting a union file system set its lower mount only on success.hannken
Reported-by: syzbot+b81b69971581b4f4db00@syzkaller.appspotmail.com
2023-02-06Set IMNT_MPSAFE only if all lower layers have it set.hannken
2022-11-21When testing whiteout support on the underlying file systemhannken
union_mount() should not use a NULL componentname as not all file systems can handle it. Use static { LOOKUP, NOCRED } componentname instead. Reported-by: syzbot+ecda308a1dd9652836d0@syzkaller.appspotmail.com Reported-by: syzbot+9b687847ee5f43e94ca3@syzkaller.appspotmail.com Reported-by: syzbot+9f9d1a841734f9f50de2@syzkaller.appspotmail.com
2022-11-04Add a helper to set or clear lower mount and use it.hannken
Always add a reference to the lower mount. Ride 9.99.105
2022-09-12kmem_alloc -> kmem_zalloc, thanks Rin.christos
2022-09-11- avoid another credential leak on error from Chris J-Dchristos
(chris at accessvector dot net) - KNF - use kmem
2022-07-18Make kqueue event status for vnodes shareable, and for stacked file systemsthorpej
like nullfs, make the upper vnode share that status with the lower vnode. And, lo, NetBSD 9.99.99. Fixes PR kern/56713.
2022-03-19Remove now unused VV_LOCKSWORK, all file systems support locking.hannken
Remove unused predicates vn_locked() and vn_anylocked(). Welcome to 9.99.95
2022-03-19As FSTRANS is part of VOP_*LOCK() since June 4, 2017 the vdead_check()hannken
from union_lock() is no longer needed. Adapt union_lock() to the recent addition of upgrade or downgrade. VV_LOCKSWORK now.
2021-12-10s/unaccessible/inaccessible/andvar
2021-12-10Fix previous, don't copy up if the underlying node is unreadable.hannken
2021-12-05In union_access() copy up regular files before checking permissions.hannken
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-10-20Overhaul of the EVFILT_VNODE kevent(2) filter:thorpej
- 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-07-04Fix union_parsepath(), either the upper or the lower dvp may be NULL.hannken
2021-06-29Now remove cn_consume from struct componentname.dholland
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-29Onionfs needs to know about parsepath too, in case it has one of thedholland
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- Add a new vnode op: VOP_PARSEPATH.dholland
- 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.
2020-08-18Operation union_readdirhook() stores the lower directory as un_uppervp.hannken
This breaks the assumption that un_uppervp->v_mount is the upper mount. Fix by storing the directory as un_lowervp and adapt union_readdir(). Should fix PR kern/55552: panic with union mount
2020-05-16Add ACL support for FFS. From FreeBSD.christos
2020-03-16Use the module subsystem's ability to process SYSCTL_SETUP() entries topgoyette
automate installation of sysctl nodes. Note that there are still a number of device and pseudo-device modules that create entries tied to individual device units, rather than to the module itself. These are not changed.
2020-02-23UVM locking changes, proposed on tech-kern:ad
- 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.
2020-01-17VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, toad
allow us to get shared locks (or no lock) on the returned vnode. Matches FreeBSD.
2019-02-20Set "mnt_lower" before the first file system operation on the new file system.hannken
2018-01-28CID-1428639: make sure we always initialiaze hash, because if ultimatelychristos
the file is not found and we end up looping we need them.
2017-07-17Make union_newlower() ans union_newupper() local to union_subr.c,hannken
expand and remove union_updatevp() and take care to transfer the vnode lock from the union vnode to its new upper vnode without breaking the fstrans state. Add assertions that un_lowervp and un_uppervp never change from non-NULL to non-NULL.
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
2017-05-26Make VOP_RECLAIM do the last unlock of the vnode.riastradh
VOP_RECLAIM naturally has exclusive access to the vnode, so having it locked on entry is not strictly necessary -- but it means if there are any final operations that must be done on the vnode, such as ffs_update, requiring exclusive access to it, we can now kassert that the vnode is locked in those operations. We can't just have the caller release the last lock because some file systems don't use genfs_lock, and require the vnode to remain valid for VOP_UNLOCK to work, notably unionfs.
2017-05-24Use VCALL() to lock or unlock the lower node.hannken
2017-05-07Move v_writecount adjustment from revoke to reclaim.hannken
2017-04-26Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.riastradh
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
2017-04-17Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().hannken
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.
2017-04-11Make VOP_INACTIVE preserve vnode lock on return.riastradh
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!
2017-04-01KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector.riastradh
2017-03-06Add field "mnt_lower" to "struct mount" to track the file systemhannken
a layered file system is mounted on. Welcome to 7.99.65
2017-03-06Handle v_writecount from union_open(), union_close() and union_revoke()hannken
so lower file system vnodes get marked as open for writing.
2017-02-17Add generic genfs_suspendctl() and use it for all file systems.hannken
Layered file systems need work.
2016-08-20Remove now obsolete operation vcache_remove().hannken
Welcome to 7.99.36
2015-07-23union_unmount: use vfs_vnode_iterator to count attached vnodes.hannken
2015-04-20Make VOP_LINK return directory still locked and referenced.riastradh
Ride 7.99.10 bump.
2015-04-20Cull unused vnode v_iflags: VI_LAYER, VI_LOCKSHARE.riastradh
2015-04-20Make vget always return vnode unlocked.riastradh
Convert callers who want locks to use vn_lock afterward. Add extra argument so the compiler will report stragglers.
2015-02-24A union node may be reactivated while it is being reclaimed sohannken
change union_freevp() to detach the vnode from the union node by clearing the vnode backpointer and the lower node sizes.
2015-02-16Change union to vcache. Use address of the union node as key.hannken
It would be better to use (uppervp, lowervp) as key, but either may be NULL and may change any time.
2015-02-16Add reference count to union node.hannken
2015-02-16Remove a superfluous vref(), VOP_CREATE() was changed tohannken
keep dvp referenced and locked some time ago.
2014-10-18src is too big these days to tolerate superfluous apostrophes. It'ssnj
"its", people!
2014-10-11Define filesystem attributes with vfs dependency.uebayasi
2014-09-05Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to getmatt
a correctly typed pointer.
2014-07-25Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I candholland
find. The filesystem ones all call genfs_eopnotsupp - right now I am only implementing the plumbing and we can implement fallocate and/or fdiscard for files later. The device ones call spec_fallocate (which is also genfs_eopnotsupp) and spec_fdiscard, which dispatches to the device-level op. The fifo ones all call vn_fifo_bypass, which also ends up being EOPNOTSUPP.
2014-06-17Unlock directory vnode after VOP_CREATE.hannken