332023 |
04-Apr-2018 |
emaste |
MFC r330354 (eadler): sys/fuse: fix off by one error
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> |
325164 |
30-Oct-2017 |
pfg |
MFC r324620 (by fsu@): Add extended attributes support to fuse kernel module.
Author: ken Reviewed by: cem, pfg (mentor) Approved by: pfg (mentor)
Differential Revision: https://reviews.freebsd.org/D12485 |
301164 |
01-Jun-2016 |
rmacklem |
MFC: r300169 If a local (AF_LOCAL, AF_UNIX) socket creation (bind) is attempted on a fuse mounted file system, it will crash. Although it may be possible to make this work correctly, this patch avoids the crash in the meantime. I removed the MPASS(), since panicing for the FIFO case didn't make a lot of sense when it returns an error for the others. |
300978 |
29-May-2016 |
rmacklem |
MFC: r299872 Fix fuse for "cp" of a mode 0444 file to the file system.
When "cp" of a file with read-only (mode 0444) to a fuse mounted file system was attempted it would fail with EACCES. This was because fuse would attempt to open the file WRONLY and the open would fail. This patch changes the fuse_vnop_open() to test for an extant read-write open and use that, if it is available. This makes the "cp" of a read-only file to the fuse mounted file system work ok. There are simpler ways to fix this than adding the fuse_filehandle_validrw() function, but this function is useful for future patches related to exporting a fuse filesystem via NFS. |
300977 |
29-May-2016 |
rmacklem |
MFC: r299816 Fix fuse so that stale buffer cache data isn't read.
When I/O on a file under fuse is switched from buffered to DIRECT_IO, it was possible to read stale (before a recent modification) data from the buffer cache. This patch invalidates the buffer cache for the file to fix this. |
300916 |
28-May-2016 |
rmacklem |
MFC: r299753 Fix fuse to use DIRECT_IO when required.
When a file is opened write-only and a partial block was written, buffered I/O would try and read the whole block in. This would result in a hung thread, since there was no open (fuse filehandle) that allowed reading. This patch avoids the problem by forcing DIRECT_IO for this case. It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO flag in its reply to the open. |
282960 |
15-May-2015 |
trasz |
MFC r279536:
Make fuse(4) respect FOPEN_DIRECT_IO. This is required for correct operation of GlusterFS.
PR: 192701 Submitted by: harsha at harshavardhana.net Reviewed by: kib@ Sponsored by: The FreeBSD Foundation |
282270 |
30-Apr-2015 |
rmacklem |
MFC: r281562 File systems that do not use the buffer cache (such as ZFS) must use VOP_FSYNC() to perform the NFS server's Commit operation. This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which is set by file systems that use the buffer cache. If this flag is not set, the NFS server always does a VOP_FSYNC(). This should be ok for old file system modules that do not set MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although it might not be optimal for file systems that use the buffer cache. |
280258 |
19-Mar-2015 |
rwatson |
Merge r263233 from HEAD to stable/10:
Update kernel inclusions of capability.h to use capsicum.h instead; some further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h.
Sponsored by: Google, Inc. |
276500 |
01-Jan-2015 |
kib |
MFC r275897: Set NOCACHE flag for CREATE namei() calls, do not specially handle MAKEENTRY in VOP_LOOKUP(). |
273736 |
27-Oct-2014 |
hselasky |
MFC r263710, r273377, r273378, r273423 and r273455:
- De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros.
Sponsored by: Mellanox Technologies |
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
255219 |
05-Sep-2013 |
pjd |
Change the cap_rights_t type from uint64_t to a structure that we can extend in the future in a backward compatible (API and ABI) way.
The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough.
The structure definition looks like this:
struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; };
The initial CAP_RIGHTS_VERSION is 0.
The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements.
The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future.
To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg.
#define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)
We still support aliases that combine few rights, but the rights have to belong to the same array element, eg:
#define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL)
#define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)
There is new API to manage the new cap_rights_t structure:
cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...);
bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);
Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg:
cap_rights_t rights;
cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);
There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg:
#define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...);
Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1:
cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);
Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition.
This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x.
Sponsored by: The FreeBSD Foundation
|
254138 |
09-Aug-2013 |
attilio |
The soft and hard busy mechanism rely on the vm object lock to work. Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it.
Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag
The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code.
Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl
|
253619 |
24-Jul-2013 |
pfg |
fuse: revert kernel_header update.
It seems to be causing problems due to the lack of the new features.
Found by: bapt Pointed hat: pfg
|
253498 |
20-Jul-2013 |
pfg |
fuse: revert birthtime support.
The creation time support breaks the data structures used in linux fuse. libfuse carries it's own header.
Revert the changes for now. We will try to get an agreement with the fuse upstream maintainers to avoid having to patch the library headers all the time.
|
253479 |
20-Jul-2013 |
pfg |
Adjust outsizes:
Recalculate FUSE_COMPAT_ENTRY_OUT_SIZE and COMPAT_ATTR_OUT_SIZE. These were wrong in the previous commit. They are actually unused in FreeBSD though.
Pointed out by: Jan Beich
|
253478 |
20-Jul-2013 |
pfg |
Adjust outsizes:
When birthtime was added (r253331) we missed adding the weight of the new fields in FUSE_COMPAT_ENTRY_OUT_SIZE and COMPAT_ATTR_OUT_SIZE. Adjust them accordingly.
Pointed out by: Jan Beich
|
253344 |
15-Jul-2013 |
pfg |
Update fuse_kernel header.
Bring in the changes from the FUSE kernel interface 7.10 (available under a BSD license).
After 7.10 the linux FUSE developers added support for a controversial CUSE driver and some linux especific features that are unlikely to find its way into FreeBSD.
We currently don't implement any of the new features so we are *not* bumping the FUSE_KERNEL_MINOR_VERSION. The header should, nevertheless, serve as a template to add the new features in a compatible manner.
While here adopt some minor cleanups from the upstream version like removing FUSE_MAJOR and FUSE_MINOR which were never used. Also add multiple inclusion header guards,
|
253331 |
13-Jul-2013 |
pfg |
Add creation timestamp (birthtime) support for fuse.
I was keeping this #ifdef'd for reference with the MacFUSE change[1] but on second thought, this is a FreeBSD-only header so the SVN history should be enough.
Add missing padding while here.
Reference [1]: http://code.google.com/p/macfuse/source/detail?spec=svn1686&r=1360
|
253276 |
12-Jul-2013 |
pfg |
Add creation timestamp (birthtime) support for fuse.
This is based on similar support in MacFUSE.
|
248084 |
09-Mar-2013 |
attilio |
Switch the vm_object mutex to be a rwlock. This will enable in the future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes.
The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs.
The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example).
Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho
|
247312 |
26-Feb-2013 |
alc |
Eliminate a duplicate #include.
Sponsored by: EMC / Isilon Storage Division
|
247297 |
26-Feb-2013 |
attilio |
Merge from vmobj-rwlock branch: Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h.
Sponsored by: EMC / Isilon storage division Tested by: pho Reviewed by: alc
|
245164 |
08-Jan-2013 |
bapt |
Add support for IO_APPEND flag in fuse This make open(..., O_APPEND) actually works on fuse filesystem.
Reviewed by: attilio
|
242875 |
10-Nov-2012 |
attilio |
- Protect mnt_data and mnt_flags under the mount interlock - Move mp->mnt_stat manipulation where all of them happens
Reported by: davide Discussed with: kib Tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616, 242727
|
242833 |
09-Nov-2012 |
attilio |
Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag. Porters should refer to __FreeBSD_version 1000021 for this change as it may have happened at the same timeframe.
|
242727 |
08-Nov-2012 |
attilio |
- Current caching mode is completely broken because it simply relies on timing of the operations and not real lookup, bringing too many false positives. Remove the whole mechanism. If it needs to be implemented, next time it should really be done in the proper way. - Fix VOP_GETATTR() in order to cope with userland bugs that would change the type of file and not panic. Instead it gets the entry as if it is not existing.
Reported and tested by: flo MFC after: 2 months X-MFC: 241519, 242536,242616
|
242616 |
05-Nov-2012 |
attilio |
fuse_io* must be able to crunch also VDIR vnodes. Update assert appropriately.
Reported and Tested by: flo MFC after: 2 months X-MFC: 241519,242536
|
242536 |
03-Nov-2012 |
attilio |
Fix a bug where operations was carried on even if not implemented, leading to handling of an invalid fdip object.
Reported and tested by: flo MFC after: 2 months X-MFC: 241519
|
241702 |
18-Oct-2012 |
ed |
Remove unneeded D_NEEDMINOR.
This is only needed when using clonelists. This got remove in r238693.
|
241521 |
14-Oct-2012 |
attilio |
Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to avoid a name clash in sparc64.
MFC after: 2 months X-MFC: r241519
|
241519 |
14-Oct-2012 |
attilio |
Import a FreeBSD port of the FUSE Linux module. This has been developed during 2 summer of code mandates and being revived by gnn recently. The functionality in this commit mirrors entirely content of fusefs-kmod port, which doesn't need to be installed anymore for -CURRENT setups.
In order to get some sparse technical notes, please refer to: http://lists.freebsd.org/pipermail/freebsd-fs/2012-March/013876.html
or to the project branch: svn://svn.freebsd.org/base/projects/fuse/
which also contains granular history of changes happened during port refinements. This commit does not came from the branch reintegration itself because it seems svn is not behaving properly for this functionaly at the moment.
Partly Sponsored by: Google, Summer of Code program 2005, 2011 Originally submitted by: ilya, Csaba Henk <csaba-ml AT creo DOT hu > In collabouration with: pho Tested by: flo, gnn, Gustau Perez, Kevin Oberman <rkoberman AT gmail DOT com> MFC after: 2 months
|