aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/inode.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index e64867eec895..2fe6657a5048 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -393,8 +393,8 @@ int
393nfs_setattr(struct dentry *dentry, struct iattr *attr) 393nfs_setattr(struct dentry *dentry, struct iattr *attr)
394{ 394{
395 struct inode *inode = dentry->d_inode; 395 struct inode *inode = dentry->d_inode;
396 struct nfs_fattr fattr; 396 struct nfs_fattr *fattr;
397 int error; 397 int error = -ENOMEM;
398 398
399 nfs_inc_stats(inode, NFSIOS_VFSSETATTR); 399 nfs_inc_stats(inode, NFSIOS_VFSSETATTR);
400 400
@@ -417,14 +417,20 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
417 filemap_write_and_wait(inode->i_mapping); 417 filemap_write_and_wait(inode->i_mapping);
418 nfs_wb_all(inode); 418 nfs_wb_all(inode);
419 } 419 }
420
421 fattr = nfs_alloc_fattr();
422 if (fattr == NULL)
423 goto out;
420 /* 424 /*
421 * Return any delegations if we're going to change ACLs 425 * Return any delegations if we're going to change ACLs
422 */ 426 */
423 if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) 427 if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0)
424 nfs_inode_return_delegation(inode); 428 nfs_inode_return_delegation(inode);
425 error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr); 429 error = NFS_PROTO(inode)->setattr(dentry, fattr, attr);
426 if (error == 0) 430 if (error == 0)
427 nfs_refresh_inode(inode, &fattr); 431 nfs_refresh_inode(inode, fattr);
432 nfs_free_fattr(fattr);
433out:
428 return error; 434 return error;
429} 435}
430 436