Merge commit '2c563880ea' into work.xattr
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 8 Oct 2016 00:09:18 +0000 (20:09 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 8 Oct 2016 00:09:18 +0000 (20:09 -0400)
pick xattr_handler conversion from lustre tree

1  2 
drivers/staging/lustre/lustre/llite/namei.c

@@@ -388,7 -388,6 +388,7 @@@ static int ll_lookup_it_finish(struct p
        struct inode *inode = NULL;
        __u64 bits = 0;
        int rc = 0;
 +      struct dentry *alias;
  
        /* NB 1 request reference will be taken away by ll_intent_lock()
         * when I return
                 */
        }
  
 -      /* Only hash *de if it is unhashed (new dentry).
 -       * Atoimc_open may passing hashed dentries for open.
 -       */
 -      if (d_unhashed(*de)) {
 -              struct dentry *alias;
 -
 -              alias = ll_splice_alias(inode, *de);
 -              if (IS_ERR(alias)) {
 -                      rc = PTR_ERR(alias);
 -                      goto out;
 -              }
 -              *de = alias;
 -      } else if (!it_disposition(it, DISP_LOOKUP_NEG)  &&
 -                 !it_disposition(it, DISP_OPEN_CREATE)) {
 -              /* With DISP_OPEN_CREATE dentry will be
 -               * instantiated in ll_create_it.
 -               */
 -              LASSERT(!d_inode(*de));
 -              d_instantiate(*de, inode);
 +      alias = ll_splice_alias(inode, *de);
 +      if (IS_ERR(alias)) {
 +              rc = PTR_ERR(alias);
 +              goto out;
        }
 +      *de = alias;
  
        if (!it_disposition(it, DISP_LOOKUP_NEG)) {
                /* we have lookup look - unhide dentry */
@@@ -574,24 -587,6 +574,24 @@@ static int ll_atomic_open(struct inode 
               dentry, PFID(ll_inode2fid(dir)), dir, file, open_flags, mode,
               *opened);
  
 +      /* Only negative dentries enter here */
 +      LASSERT(!d_inode(dentry));
 +
 +      if (!d_in_lookup(dentry)) {
 +              /* A valid negative dentry that just passed revalidation,
 +               * there's little point to try and open it server-side,
 +               * even though there's a minuscle chance it might succeed.
 +               * Either way it's a valid race to just return -ENOENT here.
 +               */
 +              if (!(open_flags & O_CREAT))
 +                      return -ENOENT;
 +
 +              /* Otherwise we just unhash it to be rehashed afresh via
 +               * lookup if necessary
 +               */
 +              d_drop(dentry);
 +      }
 +
        it = kzalloc(sizeof(*it), GFP_NOFS);
        if (!it)
                return -ENOMEM;
@@@ -1106,10 -1101,10 +1106,10 @@@ const struct inode_operations ll_dir_in
        .setattr            = ll_setattr,
        .getattr            = ll_getattr,
        .permission      = ll_inode_permission,
-       .setxattr          = ll_setxattr,
-       .getxattr          = ll_getxattr,
+       .setxattr          = generic_setxattr,
+       .getxattr          = generic_getxattr,
        .listxattr        = ll_listxattr,
-       .removexattr    = ll_removexattr,
+       .removexattr    = generic_removexattr,
        .get_acl            = ll_get_acl,
  };
  
@@@ -1117,9 -1112,9 +1117,9 @@@ const struct inode_operations ll_specia
        .setattr        = ll_setattr,
        .getattr        = ll_getattr,
        .permission     = ll_inode_permission,
-       .setxattr       = ll_setxattr,
-       .getxattr       = ll_getxattr,
+       .setxattr       = generic_setxattr,
+       .getxattr       = generic_getxattr,
        .listxattr      = ll_listxattr,
-       .removexattr    = ll_removexattr,
+       .removexattr    = generic_removexattr,
        .get_acl            = ll_get_acl,
  };