Commit 642ac549 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Return delegations in case we're changing ACLs

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent cae7a073
...@@ -853,6 +853,11 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -853,6 +853,11 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
filemap_fdatawait(inode->i_mapping); filemap_fdatawait(inode->i_mapping);
nfs_wb_all(inode); nfs_wb_all(inode);
} }
/*
* Return any delegations if we're going to change ACLs
*/
if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
nfs_inode_return_delegation(inode);
error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr); error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr);
if (error == 0) if (error == 0)
nfs_refresh_inode(inode, &fattr); nfs_refresh_inode(inode, &fattr);
......
...@@ -2405,6 +2405,7 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen ...@@ -2405,6 +2405,7 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
if (!nfs4_server_supports_acls(server)) if (!nfs4_server_supports_acls(server))
return -EOPNOTSUPP; return -EOPNOTSUPP;
nfs_inode_return_delegation(inode);
buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase); buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase);
ret = rpc_call_sync(NFS_SERVER(inode)->client, &msg, 0); ret = rpc_call_sync(NFS_SERVER(inode)->client, &msg, 0);
if (ret == 0) if (ret == 0)
......
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