X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fnfsd%2Fvfs.c;h=2e6315b0516321fde43d38f7ebbe371f0ec0741e;hb=3ec04f3d2903fdf6d9849a8633af59b8628164a5;hp=378ca30413c72da725b24b7bd974cbe23f201dd9;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 378ca3041..2e6315b05 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -448,47 +448,49 @@ _get_posix_acl(struct dentry *dentry, char *key) int buflen, error = 0; struct posix_acl *pacl = NULL; - error = -EOPNOTSUPP; - if (inode->i_op == NULL) - goto out_err; - if (inode->i_op->getxattr == NULL) - goto out_err; - - error = security_inode_getxattr(dentry, key); - if (error) - goto out_err; + down(&inode->i_sem); error = -EOPNOTSUPP; if (inode->i_op == NULL) - goto out_err; + goto out_sem; if (inode->i_op->getxattr == NULL) - goto out_err; + goto out_sem; error = security_inode_getxattr(dentry, key); if (error) - goto out_err; + goto out_sem; buflen = inode->i_op->getxattr(dentry, key, NULL, 0); if (buflen <= 0) { error = buflen < 0 ? buflen : -ENODATA; - goto out_err; + goto out_sem; } buf = kmalloc(buflen, GFP_KERNEL); if (buf == NULL) { error = -ENOMEM; - goto out_err; + goto out_sem; } - error = inode->i_op->getxattr(dentry, key, buf, buflen); + error = -EOPNOTSUPP; + if (inode->i_op && inode->i_op->getxattr) { + error = security_inode_getxattr(dentry, key); + if (error) + goto out_sem; + error = inode->i_op->getxattr(dentry, key, buf, buflen); + } if (error < 0) - goto out_err; + goto out_sem; + + error = 0; + up(&inode->i_sem); pacl = posix_acl_from_xattr(buf, buflen); out: kfree(buf); return pacl; - out_err: + out_sem: + up(&inode->i_sem); pacl = ERR_PTR(error); goto out; }