From e6863f8bdca23fc1a3c5f9b7ec442585d72511a0 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 19 May 2004 18:28:38 -0700 Subject: [PATCH] [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. --- fs/nfsd/vfs.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index d3308f54f2e49..76c1eebd32bfd 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1219,16 +1219,18 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, if (EX_ISSYNC(fhp->fh_export)) nfsd_sync_dir(dentry); 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) { iap->ia_valid |= ATTR_CTIME; iap->ia_mode = (iap->ia_mode&S_IALLUGO) | S_IFLNK; - err = notify_change(dnew, iap); - if (err) - err = nfserrno(err); - else if (EX_ISSYNC(fhp->fh_export)) - write_inode_now(dentry->d_inode, 1); + if (notify_change(dnew, iap)==0) + if (EX_ISSYNC(fhp->fh_export)) + write_inode_now(dentry->d_inode, 1); + /* errors from notify_change are not + * propagated to client + */ } } } else -- 2.53.0