diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
| -rw-r--r-- | fs/nfs/nfs4proc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1b76f80aedb9..0c5a308e4963 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -753,6 +753,7 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | |||
| 753 | .rpc_argp = &arg, | 753 | .rpc_argp = &arg, |
| 754 | .rpc_resp = &res, | 754 | .rpc_resp = &res, |
| 755 | }; | 755 | }; |
| 756 | int status; | ||
| 756 | 757 | ||
| 757 | fattr->valid = 0; | 758 | fattr->valid = 0; |
| 758 | 759 | ||
| @@ -762,7 +763,8 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | |||
| 762 | } else | 763 | } else |
| 763 | memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); | 764 | memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); |
| 764 | 765 | ||
| 765 | return rpc_call_sync(server->client, &msg, 0); | 766 | status = rpc_call_sync(server->client, &msg, 0); |
| 767 | return status; | ||
| 766 | } | 768 | } |
| 767 | 769 | ||
| 768 | static int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | 770 | static int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, |
| @@ -1145,6 +1147,8 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
| 1145 | 1147 | ||
| 1146 | status = nfs4_do_setattr(NFS_SERVER(inode), fattr, | 1148 | status = nfs4_do_setattr(NFS_SERVER(inode), fattr, |
| 1147 | NFS_FH(inode), sattr, state); | 1149 | NFS_FH(inode), sattr, state); |
| 1150 | if (status == 0) | ||
| 1151 | nfs_setattr_update_inode(inode, sattr); | ||
| 1148 | if (state != NULL) | 1152 | if (state != NULL) |
| 1149 | nfs4_close_state(state, FMODE_WRITE); | 1153 | nfs4_close_state(state, FMODE_WRITE); |
| 1150 | put_rpccred(cred); | 1154 | put_rpccred(cred); |
| @@ -1449,8 +1453,10 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
| 1449 | struct nfs_fattr fattr; | 1453 | struct nfs_fattr fattr; |
| 1450 | status = nfs4_do_setattr(NFS_SERVER(dir), &fattr, | 1454 | status = nfs4_do_setattr(NFS_SERVER(dir), &fattr, |
| 1451 | NFS_FH(state->inode), sattr, state); | 1455 | NFS_FH(state->inode), sattr, state); |
| 1452 | if (status == 0) | 1456 | if (status == 0) { |
| 1457 | nfs_setattr_update_inode(state->inode, sattr); | ||
| 1453 | goto out; | 1458 | goto out; |
| 1459 | } | ||
| 1454 | } else if (flags != 0) | 1460 | } else if (flags != 0) |
| 1455 | goto out; | 1461 | goto out; |
| 1456 | nfs4_close_state(state, flags); | 1462 | nfs4_close_state(state, flags); |
