Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45838
b: refs/heads/master
c: c397852
h: refs/heads/master
v: v3
  • Loading branch information
Peter Staubach authored and Linus Torvalds committed Jan 26, 2007
1 parent b5c96af commit 4b890ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 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: e2df0c8644db3d01e3c6fc5f7670fdd7b4c2b234
refs/heads/master: c397852c3ddad582ead8c57fbc48bdeccd995a30
21 changes: 5 additions & 16 deletions trunk/fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,6 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
__be32 err;
int host_err;
__u32 v_mtime=0, v_atime=0;
int v_mode=0;

err = nfserr_perm;
if (!flen)
Expand Down Expand Up @@ -1282,16 +1281,11 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
goto out;

if (createmode == NFS3_CREATE_EXCLUSIVE) {
/* while the verifier would fit in mtime+atime,
* solaris7 gets confused (bugid 4218508) if these have
* the high bit set, so we use the mode as well
/* solaris7 gets confused (bugid 4218508) if these have
* the high bit set, so just clear the high bits.
*/
v_mtime = verifier[0]&0x7fffffff;
v_atime = verifier[1]&0x7fffffff;
v_mode = S_IFREG
| ((verifier[0]&0x80000000) >> (32-7)) /* u+x */
| ((verifier[1]&0x80000000) >> (32-9)) /* u+r */
;
}

if (dchild->d_inode) {
Expand Down Expand Up @@ -1319,7 +1313,6 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
case NFS3_CREATE_EXCLUSIVE:
if ( dchild->d_inode->i_mtime.tv_sec == v_mtime
&& dchild->d_inode->i_atime.tv_sec == v_atime
&& dchild->d_inode->i_mode == v_mode
&& dchild->d_inode->i_size == 0 )
break;
/* fallthru */
Expand All @@ -1341,26 +1334,22 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
}

if (createmode == NFS3_CREATE_EXCLUSIVE) {
/* Cram the verifier into atime/mtime/mode */
/* Cram the verifier into atime/mtime */
iap->ia_valid = ATTR_MTIME|ATTR_ATIME
| ATTR_MTIME_SET|ATTR_ATIME_SET
| ATTR_MODE;
| ATTR_MTIME_SET|ATTR_ATIME_SET;
/* XXX someone who knows this better please fix it for nsec */
iap->ia_mtime.tv_sec = v_mtime;
iap->ia_atime.tv_sec = v_atime;
iap->ia_mtime.tv_nsec = 0;
iap->ia_atime.tv_nsec = 0;
iap->ia_mode = v_mode;
}

/* Set file attributes.
* Mode has already been set but we might need to reset it
* for CREATE_EXCLUSIVE
* Irix appears to send along the gid when it tries to
* implement setgid directories via NFS. Clear out all that cruft.
*/
set_attr:
if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID)) != 0) {
if ((iap->ia_valid &= ~(ATTR_UID|ATTR_GID|ATTR_MODE)) != 0) {
__be32 err2 = nfsd_setattr(rqstp, resfhp, iap, 0, (time_t)0);
if (err2)
err = err2;
Expand Down

0 comments on commit 4b890ce

Please sign in to comment.