diff options
-rw-r--r-- | fs/nfs/nfs3xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 2 | ||||
-rw-r--r-- | fs/nfs/proc.c | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 0498bd36602c..b6c0b5012bce 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -182,7 +182,7 @@ xdr_encode_sattr(u32 *p, struct iattr *attr) | |||
182 | { | 182 | { |
183 | if (attr->ia_valid & ATTR_MODE) { | 183 | if (attr->ia_valid & ATTR_MODE) { |
184 | *p++ = xdr_one; | 184 | *p++ = xdr_one; |
185 | *p++ = htonl(attr->ia_mode); | 185 | *p++ = htonl(attr->ia_mode & S_IALLUGO); |
186 | } else { | 186 | } else { |
187 | *p++ = xdr_zero; | 187 | *p++ = xdr_zero; |
188 | } | 188 | } |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 12be1d682164..4bbf5ef57785 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -566,7 +566,7 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
566 | } | 566 | } |
567 | if (iap->ia_valid & ATTR_MODE) { | 567 | if (iap->ia_valid & ATTR_MODE) { |
568 | bmval1 |= FATTR4_WORD1_MODE; | 568 | bmval1 |= FATTR4_WORD1_MODE; |
569 | WRITE32(iap->ia_mode); | 569 | WRITE32(iap->ia_mode & S_IALLUGO); |
570 | } | 570 | } |
571 | if (iap->ia_valid & ATTR_UID) { | 571 | if (iap->ia_valid & ATTR_UID) { |
572 | bmval1 |= FATTR4_WORD1_OWNER; | 572 | bmval1 |= FATTR4_WORD1_OWNER; |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 6145e82b45e8..f5150d71c03d 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -111,6 +111,9 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
111 | }; | 111 | }; |
112 | int status; | 112 | int status; |
113 | 113 | ||
114 | /* Mask out the non-modebit related stuff from attr->ia_mode */ | ||
115 | sattr->ia_mode &= S_IALLUGO; | ||
116 | |||
114 | dprintk("NFS call setattr\n"); | 117 | dprintk("NFS call setattr\n"); |
115 | nfs_fattr_init(fattr); | 118 | nfs_fattr_init(fattr); |
116 | status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0); | 119 | status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0); |