Commit Graph

129 Commits

Author SHA1 Message Date
andvar a299e6608d fix various typos in comments. 2022-07-06 12:33:41 +00:00
andvar de0a2812df s/sould/should/ and s/shoud/should/ 2022-04-12 21:05:36 +00:00
andvar 1daa1a7b85 fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
2022-02-23 21:54:40 +00:00
andvar 0e6a3361ec fix typos in word "request(s)". 2021-12-12 09:00:07 +00:00
andvar c46bd13f44 some love to double letters (in comments). 2021-09-17 08:13:06 +00:00
andvar 80f2027016 sysinst/partitions.h: fix typos comments, also fix same typos in other files. 2021-09-11 21:30:46 +00:00
nia 213aa76def introduce a SOL_LOCAL for unix-domain socket level socket options
as an alias of the current 0 used for these options, as in FreeBSD.

reviewed by many.
2021-08-08 20:54:48 +00:00
msaitoh 05893f30c2 miscelaneous -> miscellaneous in comment. 2020-03-05 15:56:20 +00:00
christos 38a0431bfa Restore binary compatibility by using the statvfs90 structure internally. 2019-09-23 12:00:57 +00:00
uwe 6ba5b90bdf Use the right values for .Bl -width
Typeset "fuse" literal (default value for type) as a literal.
2019-09-08 11:34:56 +00:00
manu bf00e86bc9 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-08-10 07:08:11 +00:00
maya bac778e85c fix typo 2019-04-17 12:30:51 +00:00
manu ef486683cc Fix directory filehandle usage with libufse. Fix lookup count
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-02-09 02:22:45 +00:00
uwe 7142fa3957 It's section 3 page, not section 2. While here, xref puffs(3) in the
SEE ALSO section too.
2019-01-23 19:43:49 +00:00
manu b553c427d4 Use reclaim2 to fix reclaim/lookup race conditions
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.
2018-11-16 02:39:02 +00:00
christos 95c12ccdf1 make the env stuff visible. 2016-10-19 01:30:35 +00:00
wiz 90f5b47a4a Sort sections. new sentence, new line. Whitespace. 2016-10-18 22:26:13 +00:00
christos 476dcf2b00 make this compile again, and simplify. 2016-10-18 17:56:31 +00:00
manu edb96218ee Make FUSE socket buffer tunable
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-10-18 15:06:17 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
dholland f6f5ee7dea Needs sys/cdefs.h for __BEGIN_DECLS and sys/types.h for mode_t. 2016-01-22 22:25:50 +00:00
christos a73bc7adc9 Deal with limits properly.
Don't print strerror() 2ice.
XXX: pullup-7
2015-06-19 17:33:20 +00:00
manu 4c4ecb7844 Fix dot-lookup when readdir does not provide inodes
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-06-03 14:07:05 +00:00
manu 8abab6b782 Add PUFFS_KFLAG_NOFLUSH_META to prevent sending metadata flush to FUSE
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-02-15 20:21:29 +00:00
manu 575ae72270 Fix atime update
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.
2015-01-13 16:51:30 +00:00
manu efbefee25c Allow setxattr to be called with a NULL value, instead of crashing. 2014-11-12 05:08:43 +00:00
manu ec8879c99e Restore build with -DDEBUG, and avoid a spurious diagnostic error with -DDEBUG 2014-11-04 09:17:31 +00:00
manu 25834497bf Avoid deadlocks on write errors
On write errors, we failed to dequeue some operations, leading to
rare but unpleasant deadlocks
2014-10-31 15:20:08 +00:00
manu 6645d5252e FUSE fallocate support
There seems to be no fdiscard FUSE operation at the moment, hence that one
is left unused.
2014-10-31 15:12:15 +00:00
manu 94c72edb04 Fix invalid free in deletextattr FUSE handler
Do not free FUSE message on error as it was not allocated.
2014-10-28 16:54:11 +00:00
manu f14b589944 Report allocated bytes on FS correctly, instead of using file size
(which is wrong for sparse files)
2014-10-11 04:19:38 +00:00
manu 95e87e4336 Do not trust the filesystem's readdir to give us nul-terminated file names 2014-09-30 00:06:19 +00:00
manu e6dc4d2455 Avoid a file resize serialization deadlock when writing with
PUFFS_IO_APPEND flag. The symptom was a hang when appending to
a file with a null size.
2014-09-11 04:05:52 +00:00
manu 4f16513e03 rmdir dir/.. must return an error. Use ENOTEMPRY like FFS does. 2014-09-05 15:20:16 +00:00
enami 21a900455a Fix build failure on amd64. 2014-09-03 23:59:58 +00:00
manu bcfebaff94 Improve POSIX compliance of FUSE filesystems through PERUSE
- 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-09-03 16:01:45 +00:00
manu 38582b4fe4 We used to remove the trailing zeros in FUSE readlink replies, but
it seems it does not always happen. Just remove them if present.
2014-08-29 04:58:40 +00:00
manu fb724fffd1 Remove usless warning that happens often with direct IO 2014-08-19 15:29:14 +00:00
manu beafd5bc7c Removed unimplemented mmap and seek method. seek's declaration caused
seek request to be passed backand forth between kernel and userland
while we did nothing about them.
2014-08-16 16:31:15 +00:00
manu 781f78b809 Use just introduced open2 PUFFS method and its PUFFS_OPEN_IO_DIRECT oflag
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-16 16:28:43 +00:00
manu ac7134332d - Make sure non root users cannot access system namespace attributes
- honour namespace specification when listing attributes
- Also fix message memory leak introduced by previous commit
2014-08-10 03:22:33 +00:00
manu 6a9d039fd1 getextattr: fix attribute length being reported to caller. If buffer
is too small, return ENORANGE.

Caught by glusterFS regression tests
2014-08-09 19:06:50 +00:00
manu 4bef47b350 Send GETATTR to filesystem for removed but still-open files, as
it is the expected behavior (bug caught by glusterFS regression tests)
2014-08-09 03:17:11 +00:00
manu b76d3b3fa5 For filesystems mounted without -o use_ino, readdir is not
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.
2014-01-06 08:56:34 +00:00
manu 42e0a87c26 Catch open without FREAD|FWRITE (it should not happen) 2013-07-19 07:32:35 +00:00
manu f7b644965d One more explicit error log, and two bug fixes
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.
2013-07-18 09:01:20 +00:00
manu 299c086640 When lookup returns a node with null inode number, it means the ENOENT,
with negative caching. We do not implement negative caching yet, but
we honour the ENOENT.
2012-11-03 15:43:20 +00:00
manu 3cd0e66ce4 Turn a fatal error into a warning. 2012-09-10 13:56:18 +00:00
riz d41e703879 Disable default build of debugging info. 2012-09-06 16:39:07 +00:00
manu 2a9a80bb36 Add PUFFS_KFLAG_CACHE_DOTDOT so that vnodes hold a reference on their
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-08-10 16:49:35 +00:00