1. 14 11月, 2015 2 次提交
    • A
      9p: xattr simplifications · e409de99
      Andreas Gruenbacher 提交于
      Now that the xattr handler is passed to the xattr handler operations, we
      can use the same get and set operations for the user, trusted, and security
      xattr namespaces.  In those namespaces, we can access the full attribute
      name by "reattaching" the name prefix the vfs has skipped for us.  Add a
      xattr_full_name helper to make this obvious in the code.
      
      For the "system.posix_acl_access" and "system.posix_acl_default"
      attributes, handler->prefix is the full attribute name; the suffix is the
      empty string.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Ron Minnich <rminnich@sandia.gov>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Cc: v9fs-developer@lists.sourceforge.net
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e409de99
    • A
      xattr handlers: Pass handler to operations instead of flags · d9a82a04
      Andreas Gruenbacher 提交于
      The xattr_handler operations are currently all passed a file system
      specific flags value which the operations can use to disambiguate between
      different handlers; some file systems use that to distinguish the xattr
      namespace, for example.  In some oprations, it would be useful to also have
      access to the handler prefix.  To allow that, pass a pointer to the handler
      to operations instead of the flags value alone.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d9a82a04
  2. 11 11月, 2015 1 次提交
  3. 10 11月, 2015 1 次提交
  4. 06 11月, 2015 1 次提交
  5. 23 10月, 2015 1 次提交
  6. 24 8月, 2015 2 次提交
  7. 12 7月, 2015 1 次提交
  8. 08 6月, 2015 1 次提交
    • T
      v9fs: fix error handling in v9fs_session_init() · 412a19b6
      Tejun Heo 提交于
      On failure, v9fs_session_init() returns with the v9fs_session_info
      struct partially initialized and expects the caller to invoke
      v9fs_session_close() to clean it up; however, it doesn't track whether
      the bdi is initialized or not and curiously invokes bdi_destroy() in
      both vfs_session_init() failure path too.
      
      A. If v9fs_session_init() fails before the bdi is initialized, the
         follow-up v9fs_session_close() will invoke bdi_destroy() on an
         uninitialized bdi.
      
      B. If v9fs_session_init() fails after the bdi is initialized,
         bdi_destroy() will be called twice on the same bdi - once in the
         failure path of v9fs_session_init() and then by
         v9fs_session_close().
      
      A is broken no matter what.  B used to be okay because bdi_destroy()
      allowed being invoked multiple times on the same bdi, which BTW was
      broken in its own way - if bdi_destroy() was invoked on an initialiezd
      but !registered bdi, it'd fail to free percpu counters.  Since
      f0054bb1 ("writeback: move backing_dev_info->wb_lock and
      ->worklist into bdi_writeback"), this no longer work - bdi_destroy()
      on an initialized but not registered bdi works correctly but multiple
      invocations of bdi_destroy() is no longer allowed.
      
      The obvious culprit here is v9fs_session_init()'s odd and broken error
      behavior.  It should simply clean up after itself on failures.  This
      patch makes the following updates to v9fs_session_init().
      
      * @rc -> @retval error return propagation removed.  It didn't serve
        any purpose.  Just use @rc.
      
      * Move addition to v9fs_sessionlist to the end of the function so that
        incomplete sessions are not put on the list or iterated and error
        path doesn't have to worry about it.
      
      * Update error handling so that it cleans up after itself.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      412a19b6
  9. 15 5月, 2015 1 次提交
  10. 11 5月, 2015 4 次提交
  11. 25 4月, 2015 1 次提交
    • J
      fs/9p: fix readdir() · 8e3c5005
      Johannes Berg 提交于
      Al Viro's IOV changes broke 9p readdir() because the new code
      didn't abort the read when it returned nothing. The original
      code checked if the combined error/length was <= 0 but in the
      new code that accidentally got changed to just an error check.
      
      Add back the return from the function when nothing is read.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Fixes: e1200fe6 ("9p: switch p9_client_read() to passing struct iov_iter *")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      8e3c5005
  12. 16 4月, 2015 1 次提交
  13. 12 4月, 2015 13 次提交
  14. 26 3月, 2015 1 次提交
  15. 22 3月, 2015 1 次提交
  16. 20 3月, 2015 3 次提交
  17. 23 2月, 2015 1 次提交
    • D
      VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) · e36cb0b8
      David Howells 提交于
      Convert the following where appropriate:
      
       (1) S_ISLNK(dentry->d_inode) to d_is_symlink(dentry).
      
       (2) S_ISREG(dentry->d_inode) to d_is_reg(dentry).
      
       (3) S_ISDIR(dentry->d_inode) to d_is_dir(dentry).  This is actually more
           complicated than it appears as some calls should be converted to
           d_can_lookup() instead.  The difference is whether the directory in
           question is a real dir with a ->lookup op or whether it's a fake dir with
           a ->d_automount op.
      
      In some circumstances, we can subsume checks for dentry->d_inode not being
      NULL into this, provided we the code isn't in a filesystem that expects
      d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
      use d_inode() rather than d_backing_inode() to get the inode pointer).
      
      Note that the dentry type field may be set to something other than
      DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
      manages the fall-through from a negative dentry to a lower layer.  In such a
      case, the dentry type of the negative union dentry is set to the same as the
      type of the lower dentry.
      
      However, if you know d_inode is not NULL at the call site, then you can use
      the d_is_xxx() functions even in a filesystem.
      
      There is one further complication: a 0,0 chardev dentry may be labelled
      DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE.  Strictly, this was
      intended for special directory entry types that don't have attached inodes.
      
      The following perl+coccinelle script was used:
      
      use strict;
      
      my @callers;
      open($fd, 'git grep -l \'S_IS[A-Z].*->d_inode\' |') ||
          die "Can't grep for S_ISDIR and co. callers";
      @callers = <$fd>;
      close($fd);
      unless (@callers) {
          print "No matches\n";
          exit(0);
      }
      
      my @cocci = (
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISLNK(E->d_inode->i_mode)',
          '+ d_is_symlink(E)',
          '',
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISDIR(E->d_inode->i_mode)',
          '+ d_is_dir(E)',
          '',
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISREG(E->d_inode->i_mode)',
          '+ d_is_reg(E)' );
      
      my $coccifile = "tmp.sp.cocci";
      open($fd, ">$coccifile") || die $coccifile;
      print($fd "$_\n") || die $coccifile foreach (@cocci);
      close($fd);
      
      foreach my $file (@callers) {
          chomp $file;
          print "Processing ", $file, "\n";
          system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
      	die "spatch failed";
      }
      
      [AV: overlayfs parts skipped]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e36cb0b8
  18. 11 2月, 2015 1 次提交
  19. 21 1月, 2015 1 次提交
  20. 20 11月, 2014 2 次提交