--- ./fs/nfs/dir.c.orig 2005-02-02 21:56:16.000000000 +0100 +++ ./fs/nfs/dir.c 2005-02-02 22:07:45.000000000 +0100 @@ -1149,13 +1149,14 @@ static int nfs_rmdir(struct inode *dir, struct dentry *dentry) { int error; + struct rpc_groups fsg = { 1, { dir->i_gid } }; dfprintk(VFS, "NFS: rmdir(%s/%ld, %s\n", dir->i_sb->s_id, dir->i_ino, dentry->d_name.name); lock_kernel(); nfs_begin_data_update(dir); - error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); + error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name, &fsg); /* Ensure the VFS deletes this inode */ if (error == 0 && dentry->d_inode != NULL) dentry->d_inode->i_nlink = 0; @@ -1250,6 +1251,7 @@ { struct inode *dir = dentry->d_parent->d_inode; struct inode *inode = dentry->d_inode; + struct rpc_groups fsg = { 1, { dir->i_gid } }; int error = -EBUSY; dfprintk(VFS, "NFS: safe_remove(%s/%s)\n", @@ -1264,13 +1266,13 @@ nfs_begin_data_update(dir); if (inode != NULL) { nfs_begin_data_update(inode); - error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); + error = NFS_PROTO(dir)->remove(dir, &dentry->d_name, &fsg); /* The VFS may want to delete this inode */ if (error == 0) inode->i_nlink--; nfs_end_data_update(inode); } else - error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); + error = NFS_PROTO(dir)->remove(dir, &dentry->d_name, &fsg); nfs_end_data_update(dir); out: return error; --- ./fs/nfs/nfs3proc.c.orig 2005-02-02 21:56:16.000000000 +0100 +++ ./fs/nfs/nfs3proc.c 2005-02-02 22:08:37.000000000 +0100 @@ -378,7 +378,7 @@ } static int -nfs3_proc_remove(struct inode *dir, struct qstr *name) +nfs3_proc_remove(struct inode *dir, struct qstr *name, struct rpc_groups *fsg) { struct nfs_fattr dir_attr; struct nfs3_diropargs arg = { @@ -390,7 +390,7 @@ dprintk("NFS call remove %s\n", name->name); dir_attr.valid = 0; - status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_REMOVE, &arg, &dir_attr); + status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_REMOVE, &arg, &dir_attr, fsg); nfs_refresh_inode(dir, &dir_attr); dprintk("NFS reply remove: %d\n", status); return status; @@ -549,7 +549,7 @@ } static int -nfs3_proc_rmdir(struct inode *dir, struct qstr *name) +nfs3_proc_rmdir(struct inode *dir, struct qstr *name, struct rpc_groups *fsg) { struct nfs_fattr dir_attr; struct nfs3_diropargs arg = { @@ -561,7 +561,7 @@ dprintk("NFS call rmdir %s\n", name->name); dir_attr.valid = 0; - status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_RMDIR, &arg, &dir_attr); + status = nfs3_rpc(NFS_CLIENT(dir), NFS3PROC_RMDIR, &arg, &dir_attr, fsg); nfs_refresh_inode(dir, &dir_attr); dprintk("NFS reply rmdir: %d\n", status); return status; --- ./fs/nfs/nfs4proc.c.orig 2005-02-02 21:56:16.000000000 +0100 +++ ./fs/nfs/nfs4proc.c 2005-02-02 21:56:22.000000000 +0100 @@ -1377,7 +1377,8 @@ return status; } -static int nfs4_proc_remove(struct inode *dir, struct qstr *name) +static int nfs4_proc_remove(struct inode *dir, struct qstr *name, + struct rpc_groups *fsg) { struct nfs4_exception exception = { }; int err; --- ./fs/nfs/proc.c.orig 2005-02-02 21:45:41.000000000 +0100 +++ ./fs/nfs/proc.c 2005-02-02 22:08:07.000000000 +0100 @@ -305,7 +305,7 @@ } static int -nfs_proc_remove(struct inode *dir, struct qstr *name) +nfs_proc_remove(struct inode *dir, struct qstr *name, struct rpc_groups *fsg) { struct nfs_diropargs arg = { .fh = NFS_FH(dir), @@ -315,7 +315,7 @@ int status; dprintk("NFS call remove %s\n", name->name); - status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_REMOVE, &arg, NULL); + status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_REMOVE, &arg, NULL, fsg); dprintk("NFS reply remove: %d\n", status); return status; @@ -434,7 +434,7 @@ } static int -nfs_proc_rmdir(struct inode *dir, struct qstr *name) +nfs_proc_rmdir(struct inode *dir, struct qstr *name, struct rpc_groups *fsg) { struct nfs_diropargs arg = { .fh = NFS_FH(dir), @@ -444,7 +444,7 @@ int status; dprintk("NFS call rmdir %s\n", name->name); - status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_RMDIR, &arg, NULL); + status = nfs2_rpc(NFS_CLIENT(dir), NFSPROC_RMDIR, &arg, NULL, fsg); dprintk("NFS reply rmdir: %d\n", status); return status; } --- ./include/linux/nfs_xdr.h.orig 2005-02-02 21:56:16.000000000 +0100 +++ ./include/linux/nfs_xdr.h 2005-02-02 22:10:31.000000000 +0100 @@ -683,7 +683,7 @@ int (*commit) (struct nfs_write_data *); struct inode * (*create) (struct inode *, struct qstr *, struct iattr *, int, struct rpc_groups *); - int (*remove) (struct inode *, struct qstr *); + int (*remove) (struct inode *, struct qstr *, struct rpc_groups *); int (*unlink_setup) (struct rpc_message *, struct dentry *, struct qstr *); int (*unlink_done) (struct dentry *, struct rpc_task *); @@ -696,7 +696,7 @@ struct nfs_fattr *); int (*mkdir) (struct inode *, struct qstr *, struct iattr *, struct nfs_fh *, struct nfs_fattr *); - int (*rmdir) (struct inode *, struct qstr *); + int (*rmdir) (struct inode *, struct qstr *, struct rpc_groups *); int (*readdir) (struct dentry *, struct rpc_cred *, u64, struct page *, unsigned int, int); int (*mknod) (struct inode *, struct qstr *, struct iattr *, --- ./fs/nfs/unlink.c.orig 2005-02-02 21:10:03.000000000 +0100 +++ ./fs/nfs/unlink.c 2005-02-03 21:55:54.000000000 +0100 @@ -160,6 +160,7 @@ struct nfs_unlinkdata *data; struct rpc_task *task; struct rpc_clnt *clnt = NFS_CLIENT(dir->d_inode); + struct rpc_groups fsg = { 1, { dir->d_inode->i_gid } }; int status = -ENOMEM; data = kmalloc(sizeof(*data), GFP_KERNEL); @@ -183,7 +184,7 @@ spin_lock(&dentry->d_lock); dentry->d_flags |= DCACHE_NFSFS_RENAMED; spin_unlock(&dentry->d_lock); - data->cred = rpcauth_lookupcred(clnt->cl_auth, NULL, 0); + data->cred = rpcauth_lookupcred(clnt->cl_auth, &fsg, 0); rpc_sleep_on(&nfs_delete_queue, task, NULL, NULL); status = 0;