Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299643
b: refs/heads/master
c: 451146b
h: refs/heads/master
i:
  299641: 1f34513
  299639: 5010f3d
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Apr 19, 2012
1 parent 5581d2c commit c27042b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55725513b5ef9d462aa3e18527658a0362aaae83
refs/heads/master: 451146be933e26e21277852b5e40c6a52266ef96
4 changes: 2 additions & 2 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
}

open_flags = nd->intent.open.flags;
attr.ia_valid = 0;
attr.ia_valid = ATTR_OPEN;

ctx = create_nfs_open_context(dentry, open_flags);
res = ERR_CAST(ctx);
Expand Down Expand Up @@ -1536,7 +1536,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
if (IS_ERR(ctx))
goto out;

attr.ia_valid = 0;
attr.ia_valid = ATTR_OPEN;
if (openflags & O_TRUNC) {
attr.ia_valid |= ATTR_SIZE;
attr.ia_size = 0;
Expand Down
15 changes: 12 additions & 3 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1954,10 +1954,19 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
};
int err;
do {
err = nfs4_handle_exception(server,
_nfs4_do_setattr(inode, cred, fattr, sattr, state),
&exception);
err = _nfs4_do_setattr(inode, cred, fattr, sattr, state);
switch (err) {
case -NFS4ERR_OPENMODE:
if (state && !(state->state & FMODE_WRITE)) {
err = -EBADF;
if (sattr->ia_valid & ATTR_OPEN)
err = -EACCES;
goto out;
}
}
err = nfs4_handle_exception(server, err, &exception);
} while (exception.retry);
out:
return err;
}

Expand Down

0 comments on commit c27042b

Please sign in to comment.