projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] knfsd: fix setattr-on-symlink error return
[firefly-linux-kernel-4.4.55.git]
/
fs
/
nfsd
/
vfs.c
diff --git
a/fs/nfsd/vfs.c
b/fs/nfsd/vfs.c
index 4f2cd3d2756665a1f600f8bcac96b4f2756b1ded..af7c3c3074b0075243a5850743a07ede58ebd863 100644
(file)
--- a/
fs/nfsd/vfs.c
+++ b/
fs/nfsd/vfs.c
@@
-254,12
+254,19
@@
nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
/* Get inode */
err = fh_verify(rqstp, fhp, ftype, accmode);
/* Get inode */
err = fh_verify(rqstp, fhp, ftype, accmode);
- if (err
|| !iap->ia_valid
)
+ if (err)
goto out;
dentry = fhp->fh_dentry;
inode = dentry->d_inode;
goto out;
dentry = fhp->fh_dentry;
inode = dentry->d_inode;
+ /* Ignore any mode updates on symlinks */
+ if (S_ISLNK(inode->i_mode))
+ iap->ia_valid &= ~ATTR_MODE;
+
+ if (!iap->ia_valid)
+ goto out;
+
/* NFSv2 does not differentiate between "set-[ac]time-to-now"
* which only requires access, and "set-[ac]time-to-X" which
* requires ownership.
/* NFSv2 does not differentiate between "set-[ac]time-to-now"
* which only requires access, and "set-[ac]time-to-X" which
* requires ownership.