Commit e6863f8b authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Invalid notify_change(symlink, [ATTR_MODE]) in nfsd

Make sure NFS client doesn't see errors from mode setting on new symlinks.

When nfsd creates a symlink, it tries to set the mode as the mode is 
carried in the NFS request and some filesystems store a mode.

If the filesystem refuses to set the mode (e.g. -EOPNOTSUPP), this
error should not be returned to the client.
parent 37433f98
...@@ -1219,16 +1219,18 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1219,16 +1219,18 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
if (EX_ISSYNC(fhp->fh_export)) if (EX_ISSYNC(fhp->fh_export))
nfsd_sync_dir(dentry); nfsd_sync_dir(dentry);
if (iap) { if (iap) {
iap->ia_valid &= ATTR_MODE /* ~(ATTR_MODE|ATTR_UID|ATTR_GID)*/; iap->ia_valid &= ATTR_MODE; /* Only the MODE ATTRibute is
* even vaguely meaningful */
if (iap->ia_valid) { if (iap->ia_valid) {
iap->ia_valid |= ATTR_CTIME; iap->ia_valid |= ATTR_CTIME;
iap->ia_mode = (iap->ia_mode&S_IALLUGO) iap->ia_mode = (iap->ia_mode&S_IALLUGO)
| S_IFLNK; | S_IFLNK;
err = notify_change(dnew, iap); if (notify_change(dnew, iap)==0)
if (err) if (EX_ISSYNC(fhp->fh_export))
err = nfserrno(err);
else if (EX_ISSYNC(fhp->fh_export))
write_inode_now(dentry->d_inode, 1); write_inode_now(dentry->d_inode, 1);
/* errors from notify_change are not
* propagated to client
*/
} }
} }
} else } else
......
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