summaryrefslogtreecommitdiff
path: root/lib/libperfuse
AgeCommit message (Collapse)Author
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
2012-03-08The kernel can lookup the same node multiple time and will reclaim asmanu
many times it looked up. All reclaims but the last one must be ignored, otherwise we discard a node which will still get operations. We therefore have to keep track of lookup/reclaim count and hnour reclaims only when the count reaches zero.
2012-02-03Make sure perfused exit when the filesystem crashed, so that unmountmanu
is done. Failure to do so caused deadlocks, with operation that held a lock on the root vnode and got stuck in perfused forever. Approved by releng.
2012-01-29Fix 32-bit builddholland
2012-01-29Improve FUSE trace facilitymanu
2011-12-29Redo previous; remove all the casts I added, and use PRI* macros instead.riz
(by popular demand - makes sense, too)
2011-12-29Cast time_t to intmax_t for printf purposes, and format with %j. Fixesriz
build on amd64 and probably i386 as well.
2011-12-28Add a FUSE trace facility, with statistics collection. This should helpmanu
tracking bugs and performance issues
2011-12-16Rework puffs_framebuf management toremove leaks and abusive reuses. Onmanu
exchange error, the puffs_framebuf is now freed immediatly, before requeuing outstanding requests.
2011-11-28- Add missing ENOENT or ESTALL when accessing deleted nodemanu
- Fix a warning, fix style (80 chars for a line)
2011-11-17Copy node expiration date before comparing it, otherwise the comparisonmanu
does not work (no idea why) and cached node is never used.
2011-11-16Correctly pass the advlock owner id from kernel to filesystem, instead ofmanu
using process PID. Allow the usage of the read filehandle for advlock, in order to support shared locks on read-only files
2011-11-10Return EISDIR for read/write to directories. NetBSD directory read shouldmanu
instead return a getent(2) output, but is that really used?
2011-10-30- Fix the confusion between fileno (opaque FUSE reference) and inodemanu
numbers. fileno must be used when exchanging FUSE messages. - Do not use kernel name cache anymore, as it caused modification from other machines to be invisible. - Honour name and attribute cache directive from FUSE filesystem
2011-10-23perfuse memory usage can grow quite large when using a lot of vnodes,manu
and the amount of data memory involved is not easy to forcast. We therefore raise the limit to the maximum. Patch from Manuel Bouyer. It helps completing a cvs update on a glusterfs colume.
2011-10-18mlockall is not necessary after all, once we have fixed a kernel bug involvingmanu
agedaemon sleeping form memory
2011-09-10Avoid comparison between signed and unsigned integer expressions bytron
casting the offset to a unsigned type. This fixes the NetBSD/i386 and hopefully the NetBSD/amd64 build.
2011-09-09make this build on amd64 and remove redundant and unused code.christos
2011-09-09Serialize access to file size. We already have such a thing in themanu
kernel, where it fixes race for PUFFS filesystems, but we need it again in perfused since FUSE filesystems are allowed to reorder requests. The huge issue is in the asyncrhonous SETATTR sent by fsync. It is followed by a syncrhnous FSYNC, so if the filesystem does not reorder requests, once the FSYNC returns, we are confident the SETATTR is done. But since FUSE can reorder, we need to implement sync in perfused.
2011-09-09Make sure perfused remains locked in memory, otherwise we can getmanu
deadlocks in low memory situations, where ioflush waits for perfused to fsync vnodes, and perfused waits for memory to be freed.
2011-08-14simplify and eliminate non literal string formats.christos
2011-08-13- fix warn/err confusiogchristos
- fix debugging printf - add func arguments to simple formats
2011-08-09Fix uninitiaized variable usage (never though lint would miss that whenmanu
used by return statement) that caused unprivilegied user to fail on unlink(2) and rename(2) operations.
2011-08-09Remove PUFFS_KFLAG_WTCACHE, which caused data corruption and slowdownmanu
2011-08-02Do not reject reads on directory, it raises a useless EBADFD while themanu
thing can just fail silently.
2011-08-02Fix creds passed to FUSE when requests are done on behalf of the kernel.manu
We previously sent uid/gid set to -1, we now set it to 0.
2011-07-19Make sure libperfuse still builds on netbsd-5.1manu
2011-07-18ftruncate(2) cause a SETATTR with only va_size set, and some filesystemsmanu
(e.g.: glusterfs) will do a custom handling in such a situation. This breaks because libpuffs folds a metadata (va_atime and va_mtime) update in each SETATTR. We try to identify SETATTR caused by ftruncate(2) and remove va_atime and va_mtime in such situation. This fixes a bug with glusterfs, where parts of a file downloaded by FTP was filled with zeros because of a ftruncate(2) sent out of order with write(2) requests. glusterfs behavior depends on the undocumented FUSE rule that ftruncate(2) will only set va_size in SETATTR.
2011-07-14FUSE struct dirent's off is not the offset in the buffer, it is an opaquemanu
cookie that the filesystem passes us, and that we need to send back on the next READDIR. Most filesystem just ignore the value and send the next chunk of buffer, but not all of them. Fixing this allows glusterfs distributed volume to work.
2011-07-04Add a flag to VOP_LISTEXTATTR(9) so that the vnode interface can tell themanu
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.
2011-06-28Don't hardcode the libpuffs path to /usr/src/lib/libpuffs.riz
2011-06-28Add support for extended attributesmanu
2011-06-01Fix race conditions between write and getattr/setattr, which lead tomanu
inconsitencies between kernel and filesystem idea of file size during writes with IO_APPEND. At mine, this resulted in a configure script producing config.status with ": clr\n" lines stripped (not 100% reproductible, but always this specific string. That is of little interest except for my own future reference). When a write is in progress, getattr/setattr get/set the maximum size among kernel idea (grown by write) and filesystem idea (not yet grown).
2011-06-01Remove outdated comment about a fixed bugmanu