04 Nov, 2006

1 commit


17 Oct, 2006

1 commit

  • Fuse didn't always call i_size_write() with i_mutex held which caused rare
    hangs on SMP/32bit. This bug has been present since fuse-2.2, well before
    being merged into mainline.

    The simplest solution is to protect i_size_write() with the per-connection
    spinlock. Using i_mutex for this purpose would require some restructuring of
    the code and I'm not even sure it's always safe to acquire i_mutex in all
    places i_size needs to be set.

    Since most of vmtruncate is already duplicated for other reasons, duplicate
    the remaining part as well, making all i_size_write() calls internal to fuse.

    Using i_size_write() was unnecessary in fuse_init_inode(), since this function
    is only called on a newly created locked inode.

    Reported by a few people over the years, but special thanks to Dana Henriksen
    who was persistent enough in helping me debug it.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

01 Oct, 2006

1 commit

  • This patch cleans up generic_file_*_read/write() interfaces. Christoph
    Hellwig gave me the idea for this clean ups.

    In a nutshell, all filesystems should set .aio_read/.aio_write methods and use
    do_sync_read/ do_sync_write() as their .read/.write methods. This allows us
    to cleanup all variants of generic_file_* routines.

    Final available interfaces:

    generic_file_aio_read() - read handler
    generic_file_aio_write() - write handler
    generic_file_aio_write_nolock() - no lock write handler

    __generic_file_aio_write_nolock() - internal worker routine

    Signed-off-by: Badari Pulavarty
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     

15 Aug, 2006

1 commit


29 Jun, 2006

1 commit


26 Jun, 2006

5 commits

  • VFS uses current->files pointer as lock owner ID, and it wouldn't be
    prudent to expose this value to userspace. So scramble it with XTEA using
    a per connection random key, known only to the kernel. Only one direction
    needs to be implemented, since the ID is never sent in the reverse
    direction.

    The XTEA algorithm is implemented inline since it's simple enough to do so,
    and this adds less complexity than if the crypto API were used.

    Thanks to Jesper Juhl for the idea.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Add synchronous request interruption. This is needed for file locking
    operations which have to be interruptible. However filesystem may implement
    interruptibility of other operations (e.g. like NFS 'intr' mount option).

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • All POSIX locks owned by the current task are removed on close(). If the
    FLUSH request resulting initiated by close() fails to reach userspace, there
    might be locks remaining, which cannot be removed.

    The only reason it could fail, is if allocating the request fails. In this
    case use the request reserved for RELEASE, or if that is currently used by
    another FLUSH, wait for it to become available.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds POSIX file locking support to the fuse interface.

    This implementation doesn't keep any locking state in kernel. Unlocking on
    close() is handled by the FLUSH message, which now contains the lock owner id.

    Mandatory locking is not supported. The filesystem may enfoce mandatory
    locking in userspace if needed.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Don't put requests into the background when a fatal interrupt occurs while the
    request is in userspace. This removes a major wart from the implementation.

    Backgrounding of requests was introduced to allow breaking of deadlocks.
    However now the same can be achieved by aborting the filesystem through the
    'abort' sysfs attribute.

    This is a change in the interface, but should not cause problems, since these
    kinds of deadlocks never happen during normal operation.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

23 Jun, 2006

1 commit

  • Pass the POSIX lock owner ID to the flush operation.

    This is useful for filesystems which don't want to store any locking state
    in inode->i_flock but want to handle locking/unlocking POSIX locks
    internally. FUSE is one such filesystem but I think it possible that some
    network filesystems would need this also.

    Also add a flag to indicate that a POSIX locking request was generated by
    close(), so filesystems using the above feature won't send an extra locking
    request in this case.

    Signed-off-by: Miklos Szeredi
    Cc: Trond Myklebust
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

12 Apr, 2006

1 commit


11 Apr, 2006

2 commits

  • FUSE allocated most requests from a fixed size pool filled at mount time.
    However in some cases (release/forget) non-pool requests were used. File
    locking operations aren't well served by the request pool, since they may
    block indefinetly thus exhausting the pool.

    This patch removes the request pool and always allocates requests on demand.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • During heavy parallel filesystem activity it was possible to Oops the kernel.
    The reason is that read_cache_pages() could skip pages which have already been
    inserted into the cache by another task. Occasionally this may result in zero
    pages actually being sent, while fuse_send_readpages() relies on at least one
    page being in the request.

    So check this corner case and just free the request instead of trying to send
    it.

    Reported and tested by Konstantin Isakov.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

29 Mar, 2006

1 commit

  • This is a conversion to make the various file_operations structs in fs/
    const. Basically a regexp job, with a few manual fixups

    The goal is both to increase correctness (harder to accidentally write to
    shared datastructures) and reducing the false sharing of cachelines with
    things that get dirty in .data (while .rodata is nicely read only and thus
    cache clean)

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

18 Feb, 2006

1 commit

  • There's a rather theoretical case of the BUG triggering in
    fuse_reset_request():

    - iget() fails because of OOM after a successful CREATE_OPEN request
    - during IO on the resulting RELEASE request the connection is aborted

    Fix and add warning to fuse_reset_request().

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

02 Feb, 2006

1 commit

  • While asynchronous reads mean a performance improvement in most cases, if
    the filesystem assumed that reads are synchronous, then async reads may
    degrade performance (filesystem may receive reads out of order, which can
    confuse it's own readahead logic).

    With sshfs a 1.5 to 4 times slowdown can be measured.

    There's also a need for userspace filesystems to know whether asynchronous
    reads are supported by the kernel or not.

    To achive these, negotiate in the INIT request whether async reads will be
    used and the maximum readahead value. Update interface version to 7.6

    If userspace uses a version earlier than 7.6, then disable async reads, and
    set maximum readahead value to the maximum read size, as done in previous
    versions.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

17 Jan, 2006

4 commits


10 Jan, 2006

1 commit


07 Jan, 2006

3 commits


07 Nov, 2005

1 commit

  • This patch adds an atomic create+open operation. This does not yet work if
    the file type changes between lookup and create+open, but solves the
    permission checking problems for the separte create and open methods.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

01 Oct, 2005

1 commit

  • Check O_DIRECT and return -EINVAL error in open. dentry_open() also checks
    this but only after the open method is called. This patch optimizes away
    the unnecessary upcalls in this case.

    It could be a correctness issue too: if filesystem has open() with side
    effect, then it should fail before doing the open, not after.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

10 Sep, 2005

9 commits

  • This patch removes ability to interrupt and restart operations while there
    hasn't been any side-effect.

    The reason: applications. There are some apps it seems that generate
    signals at a fast rate. This means, that if the operation cannot make
    enough progress between two signals, it will be restarted for ever. This
    bug actually manifested itself with 'krusader' trying to open a file for
    writing under sshfs. Thanks to Eduard Czimbalmos for the report.

    The problem can be solved just by making open() uninterruptible, because in
    this case it was the truncate operation that slowed down the progress. But
    it's better to solve this by simply not allowing interrupts at all (except
    SIGKILL), because applications don't expect file operations to be
    interruptible anyway. As an added bonus the code is simplified somewhat.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds a new FSYNCDIR request, which is sent when fsync is called
    on directories. This operation is available in libfuse 2.3-pre1 or
    greater.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Don't change mtime/ctime/atime to local time on read/write. Rather invalidate
    file attributes, so next stat() will force a GETATTR call. Bug reported by
    Ben Grimm.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Make data caching behavior selectable on a per-open basis instead of
    per-mount. Compatibility for the old mount options 'kernel_cache' and
    'direct_io' is retained in the userspace library (version 2.4.0-pre1 or
    later).

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch removes a long lasting "hack" in FUSE, which used a separate
    channel (a file descriptor refering to a disk-file) to transfer directory
    contents from userspace to the kernel.

    The patch adds three new operations (OPENDIR, READDIR, RELEASEDIR), which
    have semantics and implementation exactly maching the respective file
    operations (OPEN, READ, RELEASE).

    This simplifies the directory reading code. Also disk space is not
    necessary, which can be important in embedded systems.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds support for the "direct_io" mount option of FUSE.

    When this mount option is specified, the page cache is bypassed for
    read and write operations. This is useful for example, if the
    filesystem doesn't know the size of files before reading them, or when
    any kind of caching is harmful.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds readpages support to FUSE.

    With the help of the readpages() operation multiple reads are bundled
    together and sent as a single request to userspace. This can improve
    reading performace.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds miscellaneous mount options to the FUSE filesystem.

    The following mount options are added:

    o default_permissions: check permissions with generic_permission()
    o allow_other: allow other users to access files
    o allow_root: allow root to access files
    o kernel_cache: don't invalidate page cache on open

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • This patch adds the file operations of FUSE.

    The following operations are added:

    o open
    o flush
    o release
    o fsync
    o readpage
    o commit_write

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi