--- ./fs/nfs/dir.c.orig 2005-02-07 22:44:00.000000000 +0100 +++ ./fs/nfs/dir.c 2005-02-07 22:57:38.000000000 +0100 @@ -580,6 +580,7 @@ struct nfs_fattr fattr; unsigned long verifier; int isopen = 0; + struct rpc_groups fsg; parent = dget_parent(dentry); lock_kernel(); @@ -615,7 +616,9 @@ goto out_bad; verifier = nfs_save_change_attribute(dir); - 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)) @@ -709,6 +712,7 @@ int error; struct nfs_fh fhandle; struct nfs_fattr fattr; + struct rpc_groups fsg; dfprintk(VFS, "NFS: lookup(%s/%s)\n", dentry->d_parent->d_name.name, dentry->d_name.name); @@ -728,7 +732,9 @@ if (nfs_is_exclusive_create(dir, nd)) goto no_entry; - 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 == -ENOENT) goto no_entry; if (error < 0) { @@ -939,7 +945,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; @@ -949,7 +955,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; } @@ -1023,6 +1029,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); @@ -1039,7 +1046,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(); @@ -1055,6 +1062,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); @@ -1077,7 +1085,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(); @@ -1261,6 +1269,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); @@ -1286,7 +1295,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-02-07 22:45:51.000000000 +0100 +++ ./fs/nfs/proc.c 2005-02-07 22:51:35.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-02-07 22:46:26.000000000 +0100 +++ ./fs/nfs/nfs3proc.c 2005-02-07 22:59:42.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, &dentry->d_name, &fhandle, &fattr); + status = nfs3_proc_lookup(dir, &dentry->d_name, &fhandle, &fattr, fsg); if (status != 0) goto out; } --- ./fs/nfs/nfs4proc.c.orig 2005-02-07 22:48:07.000000000 +0100 +++ ./fs/nfs/nfs4proc.c 2005-02-07 22:51:35.000000000 +0100 @@ -1070,7 +1070,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-02-07 22:49:55.000000000 +0100 +++ ./include/linux/nfs_xdr.h 2005-02-07 22:51:35.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);