1. 24 Jan, 2013 3 commits
  2. 17 Jan, 2013 1 commit
  3. 18 Dec, 2012 1 commit
  4. 09 Oct, 2012 1 commit
    • Konstantin Khlebnikov's avatar
      mm: kill vma flag VM_CAN_NONLINEAR · 0b173bc4
      Konstantin Khlebnikov authored
      Move actual pte filling for non-linear file mappings into the new special
      vma operation: ->remap_pages().
      Filesystems must implement this method to get non-linear mapping support,
      if it uses filemap_fault() then generic_file_remap_pages() can be used.
      Now device drivers can implement this method and obtain nonlinear vma support.
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>	#arch/tile
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Morris <james.l.morris@oracle.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Venkatesh Pallipadi <venki@google.com>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  5. 06 Aug, 2012 1 commit
    • Zach Brown's avatar
      fuse: verify all ioctl retry iov elements · fb6ccff6
      Zach Brown authored
      Commit 7572777e
       attempted to verify that
      the total iovec from the client doesn't overflow iov_length() but it
      only checked the first element.  The iovec could still overflow by
      starting with a small element.  The obvious fix is to check all the
      The overflow case doesn't look dangerous to the kernel as the copy is
      limited by the length after the overflow.  This fix restores the
      intention of returning an error instead of successfully copying less
      than the iovec represented.
      I found this by code inspection.  I built it but don't have a test case.
      I'm cc:ing stable because the initial commit did as well.
      Signed-off-by: default avatarZach Brown <zab@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      CC: <stable@vger.kernel.org>         [2.6.37+]
  6. 31 Jul, 2012 1 commit
  7. 18 Jul, 2012 1 commit
    • Brian Foster's avatar
      fuse: update attributes on aio_read · a8894274
      Brian Foster authored
      A fuse-based network filesystem might allow for the inode
      and/or file data to change unexpectedly. A local client
      that opens and repeatedly reads a file might never pick
      up on such changes and indefinitely return stale data.
      Always invoke fuse_update_attributes() in the read path
      to cause an attr revalidation when the attributes expire.
      This leads to a page cache invalidation if necessary and
      ensures fuse issues new read requests to the fuse client.
      The original logic (reval only on reads beyond EOF) is
      preserved unless the client specifies FUSE_AUTO_INVAL_DATA
      on init.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
  8. 01 Jun, 2012 1 commit
    • Josef Bacik's avatar
      fs: introduce inode operation ->update_time · c3b2da31
      Josef Bacik authored
      Btrfs has to make sure we have space to allocate new blocks in order to modify
      the inode, so updating time can fail.  We've gotten around this by having our
      own file_update_time but this is kind of a pain, and Christoph has indicated he
      would like to make xfs do something different with atime updates.  So introduce
      ->update_time, where we will deal with i_version an a/m/c time updates and
      indicate which changes need to be made.  The normal version just does what it
      has always done, updates the time and marks the inode dirty, and then
      filesystems can choose to do something different.
      I've gone through all of the users of file_update_time and made them check for
      errors with the exception of the fault code since it's complicated and I wasn't
      quite sure what to do there, also Jan is going to be pushing the file time
      updates into page_mkwrite for those who have it so that should satisfy btrfs and
      make it not a big deal to check the file_update_time() return code in the
      generic fault path. Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
  9. 26 Apr, 2012 1 commit
  10. 25 Apr, 2012 1 commit
  11. 20 Mar, 2012 1 commit
  12. 05 Mar, 2012 1 commit
    • Anand Avati's avatar
      fuse: O_DIRECT support for files · 4273b793
      Anand Avati authored
      Implement ->direct_IO() method in aops. The ->direct_IO() method combines
      the existing fuse_direct_read/fuse_direct_write methods to implement
      O_DIRECT functionality.
      Reaching ->direct_IO() in the read path via generic_file_aio_read ensures
      proper synchronization with page cache with its existing framework.
      Reaching ->direct_IO() in the write path via fuse_file_aio_write is made
      to come via generic_file_direct_write() which makes it play nice with
      the page cache w.r.t other mmap pages etc.
      On files marked 'direct_io' by the filesystem server, IO always follows
      the fuse_direct_read/write path. There is no effect of fcntl(O_DIRECT)
      and it always succeeds.
      On files not marked with 'direct_io' by the filesystem server, the IO
      path depends on O_DIRECT flag by the application. This can be passed
      at the time of open() as well as via fcntl().
      Note that asynchronous O_DIRECT iocb jobs are completed synchronously
      always (this has been the case with FUSE even before this patch)
      Signed-off-by: default avatarAnand Avati <avati@redhat.com>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
  13. 13 Dec, 2011 5 commits
  14. 08 Aug, 2011 3 commits
    • Johannes Weiner's avatar
      fuse: mark pages accessed when written to · 478e0841
      Johannes Weiner authored
      As fuse does not use the page cache library functions when userspace
      writes to a file, it did not benefit from 'c8236db9
       mm: mark page
      accessed before we write_end()' that made sure pages are properly
      marked accessed when written to.
      Signed-off-by: default avatarJohannes Weiner <jweiner@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Johannes Weiner's avatar
      fuse: delete dead .write_begin and .write_end aops · b40cdd56
      Johannes Weiner authored
      Ever since 'ea9b9907
       fuse: implement perform_write', the .write_begin
      and .write_end aops have been dead code.
      Their task - acquiring a page from the page cache, sending out a write
      request and releasing the page again - is now done batch-wise to
      maximize the number of pages send per userspace request.
      Signed-off-by: default avatarJohannes Weiner <jweiner@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Miklos Szeredi's avatar
      fuse: fix flock · 37fb3a30
      Miklos Szeredi authored
      Commit a9ff4f87
       "fuse: support BSD locking semantics" overlooked a
      number of issues with supporing flock locks over existing POSIX
      locking infrastructure:
        - it's not backward compatible, passing flock(2) calls to userspace
          unconditionally (if userspace sets FUSE_POSIX_LOCKS)
        - it doesn't cater for the fact that flock locks are automatically
          unlocked on file release
        - it doesn't take into account the fact that flock exclusive locks
          (write locks) don't need an fd opened for write.
      The last one invalidates the original premise of the patch that flock
      locks can be emulated with POSIX locks.
      This patch fixes the first two issues.  The last one needs to be fixed
      in userspace if the filesystem assumed that a write lock will happen
      only on a file operned for write (as in the case of the current fuse
      Reported-by: default avatarSebastian Pipping <webmaster@hartwork.org>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
  15. 21 Jul, 2011 3 commits
  16. 31 Mar, 2011 1 commit
  17. 21 Mar, 2011 1 commit
  18. 25 Feb, 2011 1 commit
  19. 07 Dec, 2010 2 commits
  20. 30 Nov, 2010 2 commits
    • Miklos Szeredi's avatar
      fuse: verify ioctl retries · 7572777e
      Miklos Szeredi authored
      Verify that the total length of the iovec returned in FUSE_IOCTL_RETRY
      doesn't overflow iov_length().
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      CC: Tejun Heo <tj@kernel.org>
      CC: <stable@kernel.org>         [2.6.31+]
    • Miklos Szeredi's avatar
      fuse: fix ioctl when server is 32bit · d9d318d3
      Miklos Szeredi authored
      If a 32bit CUSE server is run on 64bit this results in EIO being
      returned to the caller.
      The reason is that FUSE_IOCTL_RETRY reply was defined to use 'struct
      iovec', which is different on 32bit and 64bit archs.
      Work around this by looking at the size of the reply to determine
      which struct was used.  This is only needed if CONFIG_COMPAT is
      A more permanent fix for the interface will be to use the same struct
      on both 32bit and 64bit.
      Reported-by: default avatar"ccmail111" <ccmail111@yahoo.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      CC: Tejun Heo <tj@kernel.org>
      CC: <stable@kernel.org>         [2.6.31+]
  21. 24 Nov, 2010 1 commit
  22. 07 Sep, 2010 1 commit
  23. 12 Jul, 2010 1 commit
    • Miklos Szeredi's avatar
      fuse: add store request · a1d75f25
      Miklos Szeredi authored
      Userspace filesystem can request data to be stored in the inode's
      mapping.  This request is synchronous and has no reply.  If the write
      to the fuse device returns an error then the store request was not
      fully completed (but may have updated some pages).
      If the stored data overflows the current file size, then the size is
      extended, similarly to a write(2) on the filesystem.
      Pages which have been completely stored are marked uptodate.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
  24. 28 May, 2010 1 commit
  25. 25 May, 2010 4 commits
    • Miklos Szeredi's avatar
      fuse: allow splice to move pages · ce534fb0
      Miklos Szeredi authored
      When splicing buffers to the fuse device with SPLICE_F_MOVE, try to
      move pages from the pipe buffer into the page cache.  This allows
      populating the fuse filesystem's cache without ever touching the page
      contents, i.e. zero copy read capability.
      The following steps are performed when trying to move a page into the
      page cache:
       - buf->ops->confirm() to make sure the new page is uptodate
       - buf->ops->steal() to try to remove the new page from it's previous place
       - remove_from_page_cache() on the old page
       - add_to_page_cache_locked() on the new page
      If any of the above steps fail (non fatally) then the code falls back
      to copying the page.  In particular ->steal() will fail if there are
      external references (other than the page cache and the pipe buffer) to
      the page.
      Also since the remove_from_page_cache() + add_to_page_cache_locked()
      are non-atomic it is possible that the page cache is repopulated in
      between the two and add_to_page_cache_locked() will fail.  This could
      be fixed by creating a new atomic replace_page_cache_page() function.
      fuse_readpages_end() needed to be reworked so it works even if
      page->mapping is NULL for some or all pages which can happen if the
      add_to_page_cache_locked() failed.
      A number of sanity checks were added to make sure the stolen pages
      don't have weird flags set, etc...  These could be moved into generic
      splice/steal code.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Miklos Szeredi's avatar
      fuse: get page reference for readpages · b5dd3285
      Miklos Szeredi authored
      Acquire a page ref on pages in ->readpages() and release them when the
      read has finished.  Not acquiring a reference didn't seem to cause any
      trouble since the page is locked and will not be kicked out of the
      page cache during the read.
      However the following patches will want to remove the page from the
      cache so a separate ref is needed.  Making the reference in req->pages
      explicit also makes the code easier to understand.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Miklos Szeredi's avatar
      fuse: use get_user_pages_fast() · 1bf94ca7
      Miklos Szeredi authored
      Replace uses of get_user_pages() with get_user_pages_fast().  It looks
      nicer and should be faster in most cases.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Dan Carpenter's avatar
      fuse: remove unneeded variable · 4aa0edd2
      Dan Carpenter authored
      "map" isn't needed any more after: 0bd87182
       "fuse: fix kunmap in
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>