1. 31 Mar, 2011 1 commit
  2. 21 Mar, 2011 1 commit
  3. 25 Feb, 2011 1 commit
  4. 07 Dec, 2010 2 commits
  5. 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+]
  6. 24 Nov, 2010 1 commit
  7. 07 Sep, 2010 1 commit
  8. 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>
  9. 28 May, 2010 1 commit
  10. 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>
  11. 03 Feb, 2010 1 commit
    • anfei zhou's avatar
      mm: flush dcache before writing into page to avoid alias · 931e80e4
      anfei zhou authored
      The cache alias problem will happen if the changes of user shared mapping
      is not flushed before copying, then user and kernel mapping may be mapped
      into two different cache line, it is impossible to guarantee the coherence
      after iov_iter_copy_from_user_atomic.  So the right steps should be:
      	write to page;
      More precisely, we might create two new APIs flush_dcache_user_page and
      flush_dcache_kern_page to replace the two flush_dcache_page accordingly.
      Here is a snippet tested on omap2430 with VIPT cache, and I think it is
      not ARM-specific:
      	int val = 0x11111111;
      	fd = open("abc", O_RDWR);
      	addr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
      	*(addr+0) = 0x44444444;
      	tmp = *(addr+0);
      	*(addr+1) = 0x77777777;
      	write(fd, &val, sizeof(int));
      The results are not always 0x11111111 0x77777777 at the beginning as expected.  Sometimes we see 0x44444444 0x77777777.
      Signed-off-by: default avatarAnfei <anfei.zhou@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: <linux-arch@vger.kernel.org>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  12. 04 Nov, 2009 2 commits
  13. 27 Sep, 2009 1 commit
  14. 30 Jun, 2009 1 commit
  15. 28 Apr, 2009 12 commits
  16. 09 Apr, 2009 2 commits
  17. 02 Apr, 2009 2 commits
    • Miklos Szeredi's avatar
      fuse: allow private mappings of "direct_io" files · fc280c96
      Miklos Szeredi authored
      Allow MAP_PRIVATE mmaps of "direct_io" files.  This is necessary for
      execute support.
      MAP_SHARED mappings require some sort of coherency between the
      underlying file and the mapping.  With "direct_io" it is difficult to
      provide this, so for the moment just disallow shared (read-write and
      read-only) mappings altogether.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    • Miklos Szeredi's avatar
      fuse: allow kernel to access "direct_io" files · f4975c67
      Miklos Szeredi authored
      Allow the kernel read and write on "direct_io" files.  This is
      necessary for nfs export and execute support.
      The implementation is simple: if an access from the kernel is
      detected, don't perform get_user_pages(), just use the kernel address
      provided by the requester to copy from/to the userspace filesystem.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
  18. 01 Apr, 2009 1 commit
    • Nick Piggin's avatar
      mm: page_mkwrite change prototype to match fault · c2ec175c
      Nick Piggin authored
      Change the page_mkwrite prototype to take a struct vm_fault, and return
      VM_FAULT_xxx flags.  There should be no functional change.
      This makes it possible to return much more detailed error information to
      the VM (and also can provide more information eg.  virtual_address to the
      driver, which might be important in some special cases).
      This is required for a subsequent fix.  And will also make it easier to
      merge page_mkwrite() with fault() in future.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Artem Bityutskiy <dedekind@infradead.org>
      Cc: Felix Blyakher <felixb@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  19. 30 Mar, 2009 1 commit
  20. 26 Jan, 2009 1 commit
  21. 04 Jan, 2009 1 commit
    • Nick Piggin's avatar
      fs: symlink write_begin allocation context fix · 54566b2c
      Nick Piggin authored
      With the write_begin/write_end aops, page_symlink was broken because it
      could no longer pass a GFP_NOFS type mask into the point where the
      allocations happened.  They are done in write_begin, which would always
      assume that the filesystem can be entered from reclaim.  This bug could
      cause filesystem deadlocks.
      The funny thing with having a gfp_t mask there is that it doesn't really
      allow the caller to arbitrarily tinker with the context in which it can be
      called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
      take the page lock.  The only thing any callers care about is __GFP_FS
      anyway, so turn that into a single flag.
      Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
      this flag in their write_begin function.  Change __grab_cache_page to
      accept a nofs argument as well, to honour that flag (while we're there,
      change the name to grab_cache_page_write_begin which is more instructive
      and does away with random leading underscores).
      This is really a more flexible way to go in the end anyway -- if a
      filesystem happens to want any extra allocations aside from the pagecache
      ones in ints write_begin function, it may now use GFP_KERNEL (rather than
      GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
      random example).
      [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
      [kosaki.motohiro@jp.fujitsu.com: fix fuse]
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Reviewed-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.28.x]
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      [ Cleaned up the calling convention: just pass in the AOP flags
        untouched to the grab_cache_page_write_begin() function.  That
        just simplifies everybody, and may even allow future expansion of the
        logic.   - Linus ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>