Commit 1bf63d07 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: don't take i_sem around call to ->getxattr

The ->getxattr op doesn't take the i_sem (see
Documentation/filesystems/Locking)
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 41a0466f
......@@ -448,39 +448,35 @@ _get_posix_acl(struct dentry *dentry, char *key)
int buflen, error = 0;
struct posix_acl *pacl = NULL;
down(&inode->i_sem);
buflen = inode->i_op->getxattr(dentry, key, NULL, 0);
if (buflen <= 0) {
error = buflen < 0 ? buflen : -ENODATA;
goto out_sem;
goto out_err;
}
buf = kmalloc(buflen, GFP_KERNEL);
if (buf == NULL) {
error = -ENOMEM;
goto out_sem;
goto out_err;
}
error = -EOPNOTSUPP;
if (inode->i_op && inode->i_op->getxattr) {
error = security_inode_getxattr(dentry, key);
if (error)
goto out_sem;
goto out_err;
error = inode->i_op->getxattr(dentry, key, buf, buflen);
}
if (error < 0)
goto out_sem;
goto out_err;
error = 0;
up(&inode->i_sem);
pacl = posix_acl_from_xattr(buf, buflen);
out:
kfree(buf);
return pacl;
out_sem:
up(&inode->i_sem);
out_err:
pacl = ERR_PTR(error);
goto out;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment