case ACL_TYPE_DEFAULT: if (!S_ISDIR(inode->i_mode)) return NULL; args.mask = NFS_DFACLCNT|NFS_DFACL; break;  default: return ERR_PTR(-EINVAL); } 
/* * Only get the access acl when explicitly requested: We don't * need it for access decisions, and only some applications use * it. Applications which request the access acl first are not * penalized from this optimization. */ if (type == ACL_TYPE_ACCESS) args.mask |= NFS_ACLCNT|NFS_ACL; if (S_ISDIR(inode->i_mode)) args.mask |= NFS_DFACLCNT|NFS_DFACL; if (args.mask == 0) return NULL; 
struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type){	struct nfs_server *server = NFS_SERVER(inode);	struct nfs_fattr fattr;	struct page *pages[NFSACL_MAXPAGES] = { };	struct nfs3_getaclargs args = {		.fh = NFS_FH(inode),		/* The xdr layer may allocate pages here. */		.pages = pages,	};	struct nfs3_getaclres res = {		.fattr =	&fattr,	};	struct posix_acl *acl = NULL;	int status, count;	if (!nfs_server_capable(inode, NFS_CAP_ACLS))		return ERR_PTR(-EOPNOTSUPP);	switch (type) {		case ACL_TYPE_ACCESS:			args.mask = NFS_ACLCNT|NFS_ACL;			break;		case ACL_TYPE_DEFAULT:			if (!S_ISDIR(inode->i_mode))				return NULL;			args.mask = NFS_DFACLCNT|NFS_DFACL;			break;		default:			return ERR_PTR(-EINVAL);	}	dprintk("NFS call getacl\n");	status = rpc_call(server->client_acl, ACLPROC3_GETACL,			  &args, &res, 0);	dprintk("NFS reply getacl: %d\n", status);	/* pages may have been allocated at the xdr layer. */	for (count = 0; count < NFSACL_MAXPAGES && args.pages[count]; count++)		__free_page(args.pages[count]);	switch (status) {		case 0:			status = nfs_refresh_inode(inode, &fattr);			break;		case -EPFNOSUPPORT:		case -EPROTONOSUPPORT:			dprintk("NFS_V3_ACL extension not supported; disabling\n");			server->caps &= ~NFS_CAP_ACLS;		case -ENOTSUPP:			status = -EOPNOTSUPP;		default:			goto getout;	}	if ((args.mask & res.mask) != args.mask) {		status = -EIO;		goto getout;	}	if (res.acl_access != NULL) {		if (posix_acl_equiv_mode(res.acl_access, NULL) == 0) {			posix_acl_release(res.acl_access);			res.acl_access = NULL;		}	}	switch(type) {		case ACL_TYPE_ACCESS:			acl = res.acl_access;			res.acl_access = NULL;			break;		case ACL_TYPE_DEFAULT:			acl = res.acl_default;			res.acl_default = NULL;	}getout:	posix_acl_release(res.acl_access);	posix_acl_release(res.acl_default);	if (status != 0) {		posix_acl_release(acl);		acl = ERR_PTR(status);	}	return acl;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5c6a9f7d92291c832d47e792ed1fafa44acb066e/nfs3acl.c/buggy/fs/nfs/nfs3acl.c