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) ...@@ -448,39 +448,35 @@ _get_posix_acl(struct dentry *dentry, char *key)
int buflen, error = 0; int buflen, error = 0;
struct posix_acl *pacl = NULL; struct posix_acl *pacl = NULL;
down(&inode->i_sem);
buflen = inode->i_op->getxattr(dentry, key, NULL, 0); buflen = inode->i_op->getxattr(dentry, key, NULL, 0);
if (buflen <= 0) { if (buflen <= 0) {
error = buflen < 0 ? buflen : -ENODATA; error = buflen < 0 ? buflen : -ENODATA;
goto out_sem; goto out_err;
} }
buf = kmalloc(buflen, GFP_KERNEL); buf = kmalloc(buflen, GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
error = -ENOMEM; error = -ENOMEM;
goto out_sem; goto out_err;
} }
error = -EOPNOTSUPP; error = -EOPNOTSUPP;
if (inode->i_op && inode->i_op->getxattr) { if (inode->i_op && inode->i_op->getxattr) {
error = security_inode_getxattr(dentry, key); error = security_inode_getxattr(dentry, key);
if (error) if (error)
goto out_sem; goto out_err;
error = inode->i_op->getxattr(dentry, key, buf, buflen); error = inode->i_op->getxattr(dentry, key, buf, buflen);
} }
if (error < 0) if (error < 0)
goto out_sem; goto out_err;
error = 0; error = 0;
up(&inode->i_sem);
pacl = posix_acl_from_xattr(buf, buflen); pacl = posix_acl_from_xattr(buf, buflen);
out: out:
kfree(buf); kfree(buf);
return pacl; return pacl;
out_sem: out_err:
up(&inode->i_sem);
pacl = ERR_PTR(error); pacl = ERR_PTR(error);
goto out; 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