Commit f155a04d authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] NFSv3: Fix SETATTR call after O_EXCL create

Ensure that when we send the SETATTR call after doing an O_EXCL create,
we always set the atime and ctime fields.

See RFC1813 for details on why the server is allowed to clobber these
two fields in order to cache a verifier that protects CREATE in case of
a timeout+resend from the client.

Patch is by Olaf Kirch.
parent 1daa1f21
......@@ -374,6 +374,11 @@ nfs3_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr,
};
dprintk("NFS call setattr (post-create)\n");
if (!(sattr->ia_valid & ATTR_ATIME_SET))
sattr->ia_valid |= ATTR_ATIME;
if (!(sattr->ia_valid & ATTR_MTIME_SET))
sattr->ia_valid |= ATTR_MTIME;
/* Note: we could use a guarded setattr here, but I'm
* not sure this buys us anything (and I'd have
* to revamp the NFSv3 XDR code) */
......
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