summaryrefslogtreecommitdiff
path: root/lib/libperfuse
AgeCommit message (Collapse)Author
2019-08-13Pull up following revision(s) (requested by manu in ticket #50):martin
lib/libperfuse/ops.c: revision 1.87 Rollback directory filehandle screening for FUSE lock operations libfuse has a different usage of filehandles for files and directories. A directory filehandle is valid only for directory operations such as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c 1.85-1.86 made sure filehandles of directories were only sent for that operations. However, the status of lock operations GETLK, SETLK, SETLKW was overlooked. The only FUSE filesystem I found using locks is GlusterFS, and it needs directory filehandles to be provided on lock operations, otherwise locking crashes the filesystem. Hence this change brings back filehandles for lock operations on directories.
2019-04-17fix typomaya
2019-02-09Fix directory filehandle usage with libufse. Fix lookup countmanu
libfuse does not use filehandle the same way for directories and other objects. As a result, filehandles obtained by OPENDIR should not be sent on non-directory related operations like READ/WRITE/GETATTR... While there, fix the lookup count sent to the FORGET operation, which led to leaked nodes.
2019-01-23It's section 3 page, not section 2. While here, xref puffs(3) in theuwe
SEE ALSO section too.
2018-11-16Use reclaim2 to fix reclaim/lookup race conditionsmanu
The PUFFS reclaim operation had a race condition with lookups: we could be asked to lookup a node, then to reclaim it before lookup completion. At lookup completion, we would then create a leaked node. Enter the PUFFS reclaim2 operation, which features a nlookup argument. That let us count how many lookups are pending and avoid the above described scenario. It also makes the codes simplier.
2016-10-19make the env stuff visible.christos
2016-10-18Sort sections. new sentence, new line. Whitespace.wiz
2016-10-18make this compile again, and simplify.christos
2016-10-18Make FUSE socket buffer tunablemanu
When dealing with high I/O throughput, we could run out of buffer space if the filesystem was not consuming requests fast enough. Here we slightly raise the buffer size, and we make it tunable through the PERFUSE_BUFSIZE environment variable so that we can cope with higher requirement later. While there, document PERFUSE_OPTIONS environment variable.
2016-01-23Define _KERNTYPES for things that need it.christos
2016-01-22Needs sys/cdefs.h for __BEGIN_DECLS and sys/types.h for mode_t.dholland
2015-06-19Deal with limits properly.christos
Don't print strerror() 2ice. XXX: pullup-7
2015-06-03Fix dot-lookup when readdir does not provide inodesmanu
Some filesystems do not provide inode numbers through readdir (FUSE mounts without -o use_ino). We therefore have to lookup each directory entry to get the missing numbers. dot and double-dot are exceptions, as we already know the values. Moreover, the lookup code does not expect to get requests for dot and will abort perfused(8) when it gets some. In order to fix that, we just check for dot and double-dot special case and use the known values instead of sending a lookup.
2015-02-15Add PUFFS_KFLAG_NOFLUSH_META to prevent sending metadata flush to FUSEmanu
FUSE filesystems do not expect to get metadata updates for [amc]time and size, they updates the value on their own after operations. The PUFFS PUFFS_KFLAG_NOFLUSH_META option prevents regular metadata cache flushes to the filesystem , and libperfuse uses it to match Linux FUSE behavior. While there, fix a bug in SETATTR: do not update kernel metadata cache from SETATTR reply when the request is asynchronous, as we do not have the reply yet.
2015-01-13Fix atime updatemanu
FUSE filesystems assume that SETATTR with atime is the result of utiimes() being called. As a result, atime and mtime will be updated. This happens with MooseFS and glusterFS. atime is supposed to be updated by the filesystem itself when it gets read operations. We fix the problem in SETATTR operations by 1) do not create a mtime update when we have an atime update (and vice versa), just fill the fields to avoid the filesystem restting the missing field to Epoch, but do not pretend we want to update it. 2) If the change is limited to atime, iscard it, as updates should be done by READ operations 3) Kernel part of PUFFS has been fixed to make sure reads on empty file are sent to the filesystem: http://mail-index.netbsd.org/source-changes/2015/01/13/msg062364.html Thanks to Tom Ivar Helbekkmo for reporting this issue.
2014-11-12Allow setxattr to be called with a NULL value, instead of crashing.manu
2014-11-04Restore build with -DDEBUG, and avoid a spurious diagnostic error with -DDEBUGmanu
2014-10-31Avoid deadlocks on write errorsmanu
On write errors, we failed to dequeue some operations, leading to rare but unpleasant deadlocks
2014-10-31FUSE fallocate supportmanu
There seems to be no fdiscard FUSE operation at the moment, hence that one is left unused.
2014-10-28Fix invalid free in deletextattr FUSE handlermanu
Do not free FUSE message on error as it was not allocated.
2014-10-11Report allocated bytes on FS correctly, instead of using file sizemanu
(which is wrong for sparse files)
2014-09-30Do not trust the filesystem's readdir to give us nul-terminated file namesmanu
2014-09-11Avoid a file resize serialization deadlock when writing withmanu
PUFFS_IO_APPEND flag. The symptom was a hang when appending to a file with a null size.
2014-09-05rmdir dir/.. must return an error. Use ENOTEMPRY like FFS does.manu
2014-09-03Fix build failure on amd64.enami
2014-09-03Improve POSIX compliance of FUSE filesystems through PERUSEmanu
- access denied is EPERM and not EACCES - access to file owned by someone else in a sticy-bit directory should be allowed for the sticy-bit directory owner - setting sticky-bit on a non directory should produce EFTYPE - implement PATHCONF method as much as we can.
2014-08-29We used to remove the trailing zeros in FUSE readlink replies, butmanu
it seems it does not always happen. Just remove them if present.
2014-08-19Remove usless warning that happens often with direct IOmanu
2014-08-16Removed unimplemented mmap and seek method. seek's declaration causedmanu
seek request to be passed backand forth between kernel and userland while we did nothing about them.
2014-08-16Use just introduced open2 PUFFS method and its PUFFS_OPEN_IO_DIRECT oflagmanu
to implement FUSE's OPEN_IO_DIRECT, by which the filesystem tells the kernel that read/write to the file should bypass the page cache. Remove a warning about read beyond EOF which will now normally appear when page cache is bypassed.
2014-08-10- Make sure non root users cannot access system namespace attributesmanu
- honour namespace specification when listing attributes - Also fix message memory leak introduced by previous commit
2014-08-09getextattr: fix attribute length being reported to caller. If buffermanu
is too small, return ENORANGE. Caught by glusterFS regression tests
2014-08-09Send GETATTR to filesystem for removed but still-open files, asmanu
it is the expected behavior (bug caught by glusterFS regression tests)
2014-01-06For filesystems mounted without -o use_ino, readdir is notmanu
able to fetch inode number. We perfom an addtional lookup on each file to get it. In that case, do not lookup .. from root, as it breaks out of the filesystem and hits NULL pointers.
2013-07-19Catch open without FREAD|FWRITE (it should not happen)manu
2013-07-18One more explicit error log, and two bug fixesmanu
1) with recent FUSE, when lookup returns a null ino, it means ENOENT 2) odd corner case that caused a bug on dd if=test of=test conv=notrunc This caused the file to be open first ro, then rw. A logic bug in perfuse_node_open caused it to skip the second operation, whereas it should open for writing, and store the write FH without touching the read FH.
2012-11-03When lookup returns a node with null inode number, it means the ENOENT,manu
with negative caching. We do not implement negative caching yet, but we honour the ENOENT.
2012-09-10Turn a fatal error into a warning.manu
2012-09-06Disable default build of debugging info.riz
2012-08-10Add PUFFS_KFLAG_CACHE_DOTDOT so that vnodes hold a reference on theirmanu
parent, keeping them active, and allowing to lookup .. without sending a request to the filesystem. Enable the featuure for perfused, as this is how FUSE works.
2012-07-21- Fix same vnodes associated with multiple cookiesmanu
The scheme used to retreive known nodes on lookup was flawed, as it only used parent and name. This produced a different cookie for the same file if it was renamed, when looking up ../ or when dealing with multiple files associated with the same name through link(2). We therefore abandon the use of node name and introduce hashed lists of inodes. This causes a huge rewrite of reclaim code, which do not attempt to keep parents allocated until all their children are reclaimed - Fix race conditions in reclaim There are a few situations where we issue multiple FUSE operations for a PUFFS operation. On reclaim, we therefore have to wait for all FUSE operation to complete, not just the current exchanges. We do this by introducing node reference count with node_ref() and node_rele(). - Detect data loss caused by FAF VOP_PUTPAGES causes FAF writes where the kernel does not check the operation result. At least issue a warning on error. - Enjoy FAF shortcut on setattr No need to wait for the result if the kernel does not want it. There is however an exception for setattr that touch the size, we need to wait for completion because we have other operations queued for after the resize. - Fix fchmod() on write-open file fchmod() on a node open with write privilege will send setattr with both mode and size set. This confuses some FUSE filesystem. Therefore we send two FUSE operations, one for mode, and one for size. - Remove node TTL handling for netbsd-5 for simplicity sake. The code still builds on netbsd-5 but does not have the node TTL feature anymore. It works fine with kernel support on netbsd-6.
2012-06-28Fix the build by adding (unused) flags argument to perfuse_node_setattr_ttlabs
2012-06-14Fix memory leak when we discard a voided setattr operationmanu
2012-06-13Fix memory leak on setattrmanu
2012-06-05Add placeholder so that we can later add allbacks without breaking the ABImanu
2012-05-28Setting mode by fchmod(2) will break on glusterfs-3.3 is we attemptmanu
to set atime and mtime at the same time. Detect that situation just like we detected ftruncate(2) and wipe atime and mtime if it occurs.
2012-04-18- When using PUFFS_KFLAG_CACHE_FS_TTL, do not use puffs_node to carrymanu
attribute and TTL fora newly created node. Instead extend puffs_newinfo and add puffs_newinfo_setva() and puffs_newinfo_setttl() - Remove node_mk_common_final in libperfuse. It used to set uid/gid for a newly created vnode but has been made redundant along time ago since uid and gid are properly set in FUSE header. - In libperfuse, check for corner case where opc = 0 on INACTIVE and RECLAIM (how is it possible? Check for it to avoid a crash anyway) - In libperfuse, make sure we unlimit RLIMIT_AS and RLIMIT_DATA so that we do notrun out of memory because the kernel is lazy at reclaiming vnodes. - In libperfuse, cleanup style of perfuse_destroy_pn()
2012-04-08Use new PUFFS_KFLAG_CACHE_FS_TTL option to puffs_init(3) so thatmanu
FUSE TTL on name and attributes are used. This save many PUFFS operations and improves performances. PUFFS_KFLAG_CACHE_FS_TTL is #ifdef'ed in many places for now so that libperfuse can still be used on netbsd-5.
2012-03-21Use C89 function definitionmatt
2012-03-21These directories default to WARNS?=5matt