--- ./fs/nfs/dir.c.orig 2005-01-30 20:07:59.000000000 +0100 +++ ./fs/nfs/dir.c 2005-02-01 22:09:29.000000000 +0100 @@ -584,6 +584,7 @@ struct nfs_fattr fattr; unsigned long verifier; int isopen = 0; + struct rpc_groups fsg; parent = dget_parent(dentry); lock_kernel(); @@ -633,7 +634,9 @@ if (NFS_STALE(inode)) goto out_bad; - error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr); + fsg.ngroups = 1; + fsg.groups[0] = dir->i_gid; + error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr, &fsg); if (error) goto out_bad; if (nfs_compare_fh(NFS_FH(inode), &fhandle)) @@ -748,8 +751,9 @@ error = nfs_cached_lookup(dir, dentry, &fhandle, &fattr); if (error != 0) { + struct rpc_groups fsg = { 1, { dir->i_gid } }; error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, - &fhandle, &fattr); + &fhandle, &fattr, &fsg); if (error == -ENOENT) goto no_entry; if (error != 0) @@ -989,7 +993,7 @@ * Code common to create, mkdir, and mknod. */ static int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle, - struct nfs_fattr *fattr) + struct nfs_fattr *fattr, struct rpc_groups *fsg) { struct inode *inode; int error = -EACCES; @@ -999,7 +1003,7 @@ return 0; if (fhandle->size == 0) { struct inode *dir = dentry->d_parent->d_inode; - error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr); + error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, fsg); if (error) goto out_err; } @@ -1079,6 +1083,7 @@ struct nfs_fattr fattr; struct nfs_fh fhandle; int error; + struct rpc_groups fsg = { 1, { dir->i_gid } }; dfprintk(VFS, "NFS: mknod(%s/%ld, %s\n", dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); @@ -1095,7 +1100,7 @@ &fhandle, &fattr); nfs_end_data_update(dir); if (!error) - error = nfs_instantiate(dentry, &fhandle, &fattr); + error = nfs_instantiate(dentry, &fhandle, &fattr, &fsg); else d_drop(dentry); unlock_kernel(); @@ -1111,6 +1116,7 @@ struct nfs_fattr fattr; struct nfs_fh fhandle; int error; + struct rpc_groups fsg = { 1, { dir->i_gid } }; dfprintk(VFS, "NFS: mkdir(%s/%ld, %s\n", dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); @@ -1133,7 +1139,7 @@ &fattr); nfs_end_data_update(dir); if (!error) - error = nfs_instantiate(dentry, &fhandle, &fattr); + error = nfs_instantiate(dentry, &fhandle, &fattr, &fsg); else d_drop(dentry); unlock_kernel(); @@ -1317,6 +1323,7 @@ struct nfs_fh sym_fh; struct qstr qsymname; int error; + struct rpc_groups fsg = { 1, { dir->i_gid } }; dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s)\n", dir->i_sb->s_id, dir->i_ino, dentry->d_name.name, symname); @@ -1342,7 +1349,7 @@ &attr, &sym_fh, &sym_attr); nfs_end_data_update(dir); if (!error) { - error = nfs_instantiate(dentry, &sym_fh, &sym_attr); + error = nfs_instantiate(dentry, &sym_fh, &sym_attr, &fsg); } else { if (error == -EEXIST) printk("nfs_proc_symlink: %s/%s already exists??\n", --- ./fs/nfs/proc.c.orig 2005-01-30 20:07:59.000000000 +0100 +++ ./fs/nfs/proc.c 2005-01-31 23:33:22.000000000 +0100 @@ -147,7 +147,8 @@ static int nfs_proc_lookup(struct inode *dir, struct qstr *name, - struct nfs_fh *fhandle, struct nfs_fattr *fattr) + struct nfs_fh *fhandle, struct nfs_fattr *fattr, + struct rpc_groups *fsg) { struct nfs_diropargs arg = { .fh = NFS_FH(dir), @@ -162,7 +163,7 @@ dprintk("NFS call lookup %s\n", name->name); fattr->valid = 0; - status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_LOOKUP, &arg, &res); + status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_LOOKUP, &arg, &res, fsg); dprintk("NFS reply lookup: %d\n", status); return status; } --- ./fs/nfs/nfs3proc.c.orig 2005-01-30 20:07:59.000000000 +0100 +++ ./fs/nfs/nfs3proc.c 2005-02-01 22:23:47.000000000 +0100 @@ -131,7 +131,8 @@ static int nfs3_proc_lookup(struct inode *dir, struct qstr *name, - struct nfs_fh *fhandle, struct nfs_fattr *fattr) + struct nfs_fh *fhandle, struct nfs_fattr *fattr, + struct rpc_groups *fsg) { struct nfs_fattr dir_attr; struct nfs3_diropargs arg = { @@ -149,7 +150,7 @@ dprintk("NFS call lookup %s\n", name->name); dir_attr.valid = 0; fattr->valid = 0; - status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_LOOKUP, &arg, &res); + status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_LOOKUP, &arg, &res, fsg); if (status >= 0 && !(fattr->valid & NFS_ATTR_FATTR)) status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_GETATTR, fhandle, fattr); @@ -338,7 +339,7 @@ if (status != 0) goto out; if (fhandle.size == 0 || !(fattr.valid & NFS_ATTR_FATTR)) { - status = nfs3_proc_lookup(dir, name, &fhandle, &fattr); + status = nfs3_proc_lookup(dir, name, &fhandle, &fattr, fsg); if (status != 0) goto out; } --- ./fs/nfs/nfs4proc.c.orig 2005-01-30 20:07:59.000000000 +0100 +++ ./fs/nfs/nfs4proc.c 2005-01-31 23:42:45.000000000 +0100 @@ -1081,7 +1081,9 @@ return status; } -static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr) +static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, + struct nfs_fh *fhandle, struct nfs_fattr *fattr, + struct rpc_groups *fsg) { struct nfs4_exception exception = { }; int err; --- ./include/linux/nfs_xdr.h.orig 2005-01-30 20:07:59.000000000 +0100 +++ ./include/linux/nfs_xdr.h 2005-01-31 23:44:23.000000000 +0100 @@ -673,8 +673,8 @@ struct nfs_fattr *); int (*setattr) (struct dentry *, struct nfs_fattr *, struct iattr *); - int (*lookup) (struct inode *, struct qstr *, - struct nfs_fh *, struct nfs_fattr *); + int (*lookup) (struct inode *, struct qstr *, struct nfs_fh *, + struct nfs_fattr *, struct rpc_groups *); int (*access) (struct inode *, struct nfs_access_entry *); int (*readlink)(struct inode *, struct page *, unsigned int, unsigned int);