1. 26 2月, 2013 1 次提交
  2. 15 11月, 2012 1 次提交
    • E
      userns: Support fuse interacting with multiple user namespaces · 499dcf20
      Eric W. Biederman 提交于
      Use kuid_t and kgid_t in struct fuse_conn and struct fuse_mount_data.
      
      The connection between between a fuse filesystem and a fuse daemon is
      established when a fuse filesystem is mounted and provided with a file
      descriptor the fuse daemon created by opening /dev/fuse.
      
      For now restrict the communication of uids and gids between the fuse
      filesystem and the fuse daemon to the initial user namespace.  Enforce
      this by verifying the file descriptor passed to the mount of fuse was
      opened in the initial user namespace.  Ensuring the mount happens in
      the initial user namespace is not necessary as mounts from non-initial
      user namespaces are not yet allowed.
      
      In fuse_req_init_context convert the currrent fsuid and fsgid into the
      initial user namespace for the request that will be sent to the fuse
      daemon.
      
      In fuse_fill_attr convert the uid and gid passed from the fuse daemon
      from the initial user namespace into kuids and kgids.
      
      In iattr_to_fattr called from fuse_setattr convert kuids and kgids
      into the uids and gids in the initial user namespace before passing
      them to the fuse filesystem.
      
      In fuse_change_attributes_common called from fuse_dentry_revalidate,
      fuse_permission, fuse_geattr, and fuse_setattr, and fuse_iget convert
      the uid and gid from the fuse daemon into a kuid and a kgid to store
      on the fuse inode.
      
      By default fuse mounts are restricted to task whose uid, suid, and
      euid matches the fuse user_id and whose gid, sgid, and egid matches
      the fuse group id.  Convert the user_id and group_id mount options
      into kuids and kgids at mount time, and use uid_eq and gid_eq to
      compare the in fuse_allow_task.
      
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      499dcf20
  3. 03 10月, 2012 1 次提交
  4. 31 8月, 2012 1 次提交
    • M
      cuse: fix fuse_conn_kill() · bbd99797
      Miklos Szeredi 提交于
      fuse_conn_kill() removed fc->entry, called fuse_ctl_remove_conn() and
      fuse_bdi_destroy().  None of which is appropriate for cuse cleanup.
      
      The fuse_ctl_remove_conn() decrements the nlink on the control filesystem, which
      is totally bogus.  The others are harmless but unnecessary.
      
      So move these out from fuse_conn_kill() to fuse_put_super() where they belong.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      bbd99797
  5. 18 7月, 2012 3 次提交
  6. 30 5月, 2012 1 次提交
  7. 14 5月, 2012 1 次提交
    • P
      fuse: fix stat call on 32 bit platforms · 45c72cd7
      Pavel Shilovsky 提交于
      Now we store attr->ino at inode->i_ino, return attr->ino at the
      first time and then return inode->i_ino if the attribute timeout
      isn't expired. That's wrong on 32 bit platforms because attr->ino
      is 64 bit and inode->i_ino is 32 bit in this case.
      
      Fix this by saving 64 bit ino in fuse_inode structure and returning
      it every time we call getattr. Also squash attr->ino into inode->i_ino
      explicitly.
      Signed-off-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      45c72cd7
  8. 06 5月, 2012 1 次提交
  9. 11 4月, 2012 1 次提交
  10. 21 3月, 2012 1 次提交
  11. 07 1月, 2012 1 次提交
  12. 04 1月, 2012 1 次提交
    • A
      vfs: fix the stupidity with i_dentry in inode destructors · 6b520e05
      Al Viro 提交于
      Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
      it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
      the cost of taking it into inode_init_always() will be negligible for pipes
      and sockets and negative for everything else.  Not to mention the removal of
      boilerplate code from ->destroy_inode() instances...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6b520e05
  13. 14 12月, 2011 1 次提交
  14. 02 11月, 2011 1 次提交
  15. 13 9月, 2011 1 次提交
  16. 08 8月, 2011 1 次提交
    • M
      fuse: fix flock · 37fb3a30
      Miklos Szeredi 提交于
      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
      library).
      Reported-by: NSebastian Pipping <webmaster@hartwork.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      37fb3a30
  17. 04 6月, 2011 1 次提交
    • A
      more conservative S_NOSEC handling · 9e1f1de0
      Al Viro 提交于
      Caching "we have already removed suid/caps" was overenthusiastic as merged.
      On network filesystems we might have had suid/caps set on another client,
      silently picked by this client on revalidate, all of that *without* clearing
      the S_NOSEC flag.
      
      AFAICS, the only reasonably sane way to deal with that is
      	* new superblock flag; unless set, S_NOSEC is not going to be set.
      	* local block filesystems set it in their ->mount() (more accurately,
      mount_bdev() does, so does btrfs ->mount(), users of mount_bdev() other than
      local block ones clear it)
      	* if any network filesystem (or a cluster one) wants to use S_NOSEC,
      it'll need to set MS_NOSEC in sb->s_flags *AND* take care to clear S_NOSEC when
      inode attribute changes are picked from other clients.
      
      It's not an earth-shattering hole (anybody that can set suid on another client
      will almost certainly be able to write to the file before doing that anyway),
      but it's a bug that needs fixing.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9e1f1de0
  18. 01 6月, 2011 1 次提交
  19. 14 3月, 2011 1 次提交
  20. 10 3月, 2011 1 次提交
  21. 13 1月, 2011 1 次提交
  22. 07 1月, 2011 2 次提交
    • N
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin 提交于
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      
      Patched with:
      
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fb045adb
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
  23. 08 12月, 2010 1 次提交
    • M
      fuse: separate queue for FORGET requests · 07e77dca
      Miklos Szeredi 提交于
      Terje Malmedal reports that a fuse filesystem with 32 million inodes
      on a machine with lots of memory can go unresponsive for up to 30
      minutes when all those inodes are evicted from the icache.
      
      The reason is that FORGET messages, sent when the inode is evicted,
      are queued up together with regular filesystem requests, and while the
      huge queue of FORGET messages are processed no other filesystem
      operation can proceed.
      
      Since a full fuse request structure is allocated for each inode, these
      take up quite a bit of memory as well.
      
      To solve these issues, create a slim 'fuse_forget_link' structure
      containing just the minimum of information required to send the FORGET
      request and chain these on a separate queue.
      
      When userspace is asking for a request make sure that FORGET and
      non-FORGET requests are selected fairly: for each 8 non-FORGET allow
      16 FORGET requests.  This will make sure FORGETs do not pile up, yet
      other requests are also allowed to proceed while the queued FORGETs
      are processed.
      Reported-by: NTerje Malmedal <terje.malmedal@usit.uio.no>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      07e77dca
  24. 29 10月, 2010 2 次提交
  25. 10 8月, 2010 1 次提交
  26. 09 2月, 2010 1 次提交
  27. 24 9月, 2009 1 次提交
  28. 16 9月, 2009 3 次提交
  29. 11 9月, 2009 1 次提交
  30. 07 7月, 2009 1 次提交
  31. 01 7月, 2009 2 次提交
    • J
      fuse: invalidation reverse calls · 3b463ae0
      John Muir 提交于
      Add notification messages that allow the filesystem to invalidate VFS
      caches.
      
      Two notifications are added:
      
       1) inode invalidation
      
         - invalidate cached attributes
         - invalidate a range of pages in the page cache (this is optional)
      
       2) dentry invalidation
      
         - try to invalidate a subtree in the dentry cache
      
      Care must be taken while accessing the 'struct super_block' for the
      mount, as it can go away while an invalidation is in progress.  To
      prevent this, introduce a rw-semaphore, that is taken for read during
      the invalidation and taken for write in the ->kill_sb callback.
      
      Cc: Csaba Henk <csaba@gluster.com>
      Cc: Anand Avati <avati@zresearch.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      3b463ae0
    • M
      fuse: allow umask processing in userspace · e0a43ddc
      Miklos Szeredi 提交于
      This patch lets filesystems handle masking the file mode on creation.
      This is needed if filesystem is using ACLs.
      
       - The CREATE, MKDIR and MKNOD requests are extended with a "umask"
         parameter.
      
       - A new FUSE_DONT_MASK flag is added to the INIT request/reply.  With
         this the filesystem may request that the create mode is not masked.
      
      CC: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      e0a43ddc
  32. 17 6月, 2009 1 次提交
  33. 09 5月, 2009 1 次提交