inode->i_mode contains a lot more than just the mode bits. Make sure that
 we mask away this extra stuff in SETATTR calls to the server.
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
 {
        if (attr->ia_valid & ATTR_MODE) {
                *p++ = xdr_one;
-               *p++ = htonl(attr->ia_mode);
+               *p++ = htonl(attr->ia_mode & S_IALLUGO);
        } else {
                *p++ = xdr_zero;
        }
 
        }
        if (iap->ia_valid & ATTR_MODE) {
                bmval1 |= FATTR4_WORD1_MODE;
-               WRITE32(iap->ia_mode);
+               WRITE32(iap->ia_mode & S_IALLUGO);
        }
        if (iap->ia_valid & ATTR_UID) {
                bmval1 |= FATTR4_WORD1_OWNER;
 
        };
        int     status;
 
+       /* Mask out the non-modebit related stuff from attr->ia_mode */
+       sattr->ia_mode &= S_IALLUGO;
+
        dprintk("NFS call  setattr\n");
        nfs_fattr_init(fattr);
        status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0);