[PATCH 1/1] NFSv4: Files become unwritable
by Steve Dickson
This patch resolves
https://bugzilla.redhat.com/show_bug.cgi?id=794780
Thank you Orion for doing the unit testing!
Signed-off-by: Steve Dickson <steved(a)redhat.com>
Tested-by: Orion Poplawski <orion(a)cora.nwra.com>
---
...the-owner-group-name-string-when-doing-op.patch | 605 ++++++++++++++++++++
kernel.spec | 5 +
2 files changed, 610 insertions(+), 0 deletions(-)
create mode 100644 NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
diff --git a/NFSv4-Save-the-owner-group-name-string-when-doing-op.patch b/NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
new file mode 100644
index 0000000..610ec01
--- /dev/null
+++ b/NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
@@ -0,0 +1,605 @@
+ommit 6926afd1925a54a13684ebe05987868890665e2b
+Author: Trond Myklebust <Trond.Myklebust(a)netapp.com>
+Date: Sat Jan 7 13:22:46 2012 -0500
+
+ NFSv4: Save the owner/group name string when doing open
+
+ ...so that we can do the uid/gid mapping outside the asynchronous RPC
+ context.
+ This fixes a bug in the current NFSv4 atomic open code where the client
+ isn't able to determine what the true uid/gid fields of the file are,
+ (because the asynchronous nature of the OPEN call denies it the ability
+ to do an upcall) and so fills them with default values, marking the
+ inode as needing revalidation.
+ Unfortunately, in some cases, the VFS will do some additional sanity
+ checks on the file, and may override the server's decision to allow
+ the open because it sees the wrong owner/group fields.
+
+ Signed-off-by: Trond Myklebust <Trond.Myklebust(a)netapp.com>
+
+diff -up linux-3.2.noarch/fs/nfs/idmap.c.orig linux-3.2.noarch/fs/nfs/idmap.c
+--- linux-3.2.noarch/fs/nfs/idmap.c.orig 2012-03-15 10:38:58.876578000 -0400
++++ linux-3.2.noarch/fs/nfs/idmap.c 2012-03-15 10:51:10.344228000 -0400
+@@ -38,6 +38,89 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/nfs_idmap.h>
++#include <linux/nfs_fs.h>
++
++/**
++ * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
++ * @fattr: fully initialised struct nfs_fattr
++ * @owner_name: owner name string cache
++ * @group_name: group name string cache
++ */
++void nfs_fattr_init_names(struct nfs_fattr *fattr,
++ struct nfs4_string *owner_name,
++ struct nfs4_string *group_name)
++{
++ fattr->owner_name = owner_name;
++ fattr->group_name = group_name;
++}
++
++static void nfs_fattr_free_owner_name(struct nfs_fattr *fattr)
++{
++ fattr->valid &= ~NFS_ATTR_FATTR_OWNER_NAME;
++ kfree(fattr->owner_name->data);
++}
++
++static void nfs_fattr_free_group_name(struct nfs_fattr *fattr)
++{
++ fattr->valid &= ~NFS_ATTR_FATTR_GROUP_NAME;
++ kfree(fattr->group_name->data);
++}
++
++static bool nfs_fattr_map_owner_name(struct nfs_server *server, struct nfs_fattr *fattr)
++{
++ struct nfs4_string *owner = fattr->owner_name;
++ __u32 uid;
++
++ if (!(fattr->valid & NFS_ATTR_FATTR_OWNER_NAME))
++ return false;
++ if (nfs_map_name_to_uid(server, owner->data, owner->len, &uid) == 0) {
++ fattr->uid = uid;
++ fattr->valid |= NFS_ATTR_FATTR_OWNER;
++ }
++ return true;
++}
++
++static bool nfs_fattr_map_group_name(struct nfs_server *server, struct nfs_fattr *fattr)
++{
++ struct nfs4_string *group = fattr->group_name;
++ __u32 gid;
++
++ if (!(fattr->valid & NFS_ATTR_FATTR_GROUP_NAME))
++ return false;
++ if (nfs_map_group_to_gid(server, group->data, group->len, &gid) == 0) {
++ fattr->gid = gid;
++ fattr->valid |= NFS_ATTR_FATTR_GROUP;
++ }
++ return true;
++}
++
++/**
++ * nfs_fattr_free_names - free up the NFSv4 owner and group strings
++ * @fattr: a fully initialised nfs_fattr structure
++ */
++void nfs_fattr_free_names(struct nfs_fattr *fattr)
++{
++ if (fattr->valid & NFS_ATTR_FATTR_OWNER_NAME)
++ nfs_fattr_free_owner_name(fattr);
++ if (fattr->valid & NFS_ATTR_FATTR_GROUP_NAME)
++ nfs_fattr_free_group_name(fattr);
++}
++
++/**
++ * nfs_fattr_map_and_free_names - map owner/group strings into uid/gid and free
++ * @server: pointer to the filesystem nfs_server structure
++ * @fattr: a fully initialised nfs_fattr structure
++ *
++ * This helper maps the cached NFSv4 owner/group strings in fattr into
++ * their numeric uid/gid equivalents, and then frees the cached strings.
++ */
++void nfs_fattr_map_and_free_names(struct nfs_server *server, struct nfs_fattr *fattr)
++{
++ if (nfs_fattr_map_owner_name(server, fattr))
++ nfs_fattr_free_owner_name(fattr);
++ if (nfs_fattr_map_group_name(server, fattr))
++ nfs_fattr_free_group_name(fattr);
++}
+
+ static int nfs_map_string_to_numeric(const char *name, size_t namelen, __u32 *res)
+ {
+diff -up linux-3.2.noarch/fs/nfs/inode.c.orig linux-3.2.noarch/fs/nfs/inode.c
+--- linux-3.2.noarch/fs/nfs/inode.c.orig 2012-03-15 10:39:00.362624000 -0400
++++ linux-3.2.noarch/fs/nfs/inode.c 2012-03-15 10:51:10.352227000 -0400
+@@ -1020,6 +1020,8 @@ void nfs_fattr_init(struct nfs_fattr *fa
+ fattr->valid = 0;
+ fattr->time_start = jiffies;
+ fattr->gencount = nfs_inc_attr_generation_counter();
++ fattr->owner_name = NULL;
++ fattr->group_name = NULL;
+ }
+
+ struct nfs_fattr *nfs_alloc_fattr(void)
+diff -up linux-3.2.noarch/fs/nfs/nfs4proc.c.orig linux-3.2.noarch/fs/nfs/nfs4proc.c
+--- linux-3.2.noarch/fs/nfs/nfs4proc.c.orig 2012-03-15 10:39:00.380629000 -0400
++++ linux-3.2.noarch/fs/nfs/nfs4proc.c 2012-03-15 10:51:10.362231000 -0400
+@@ -52,6 +52,7 @@
+ #include <linux/namei.h>
+ #include <linux/mount.h>
+ #include <linux/module.h>
++#include <linux/nfs_idmap.h>
+ #include <linux/sunrpc/bc_xprt.h>
+ #include <linux/xattr.h>
+ #include <linux/utsname.h>
+@@ -765,6 +766,8 @@ struct nfs4_opendata {
+ struct nfs_openres o_res;
+ struct nfs_open_confirmargs c_arg;
+ struct nfs_open_confirmres c_res;
++ struct nfs4_string owner_name;
++ struct nfs4_string group_name;
+ struct nfs_fattr f_attr;
+ struct nfs_fattr dir_attr;
+ struct dentry *dir;
+@@ -788,6 +791,7 @@ static void nfs4_init_opendata_res(struc
+ p->o_res.server = p->o_arg.server;
+ nfs_fattr_init(&p->f_attr);
+ nfs_fattr_init(&p->dir_attr);
++ nfs_fattr_init_names(&p->f_attr, &p->owner_name, &p->group_name);
+ }
+
+ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
+@@ -819,6 +823,7 @@ static struct nfs4_opendata *nfs4_openda
+ p->o_arg.name = &dentry->d_name;
+ p->o_arg.server = server;
+ p->o_arg.bitmask = server->attr_bitmask;
++ p->o_arg.dir_bitmask = server->cache_consistency_bitmask;
+ p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
+ if (flags & O_CREAT) {
+ u32 *s;
+@@ -855,6 +860,7 @@ static void nfs4_opendata_free(struct kr
+ dput(p->dir);
+ dput(p->dentry);
+ nfs_sb_deactive(sb);
++ nfs_fattr_free_names(&p->f_attr);
+ kfree(p);
+ }
+
+@@ -1579,6 +1585,8 @@ static int _nfs4_recover_proc_open(struc
+ if (status != 0 || !data->rpc_done)
+ return status;
+
++ nfs_fattr_map_and_free_names(NFS_SERVER(dir), &data->f_attr);
++
+ nfs_refresh_inode(dir, o_res->dir_attr);
+
+ if (o_res->rflags & NFS4_OPEN_RESULT_CONFIRM) {
+@@ -1611,6 +1619,8 @@ static int _nfs4_proc_open(struct nfs4_o
+ return status;
+ }
+
++ nfs_fattr_map_and_free_names(server, &data->f_attr);
++
+ if (o_arg->open_flags & O_CREAT) {
+ update_changeattr(dir, &o_res->cinfo);
+ nfs_post_op_update_inode(dir, o_res->dir_attr);
+diff -up linux-3.2.noarch/fs/nfs/nfs4xdr.c.orig linux-3.2.noarch/fs/nfs/nfs4xdr.c
+--- linux-3.2.noarch/fs/nfs/nfs4xdr.c.orig 2012-03-15 10:38:54.054438000 -0400
++++ linux-3.2.noarch/fs/nfs/nfs4xdr.c 2012-03-15 10:51:10.373231000 -0400
+@@ -2298,7 +2298,7 @@ static void nfs4_xdr_enc_open(struct rpc
+ encode_getfh(xdr, &hdr);
+ encode_getfattr(xdr, args->bitmask, &hdr);
+ encode_restorefh(xdr, &hdr);
+- encode_getfattr(xdr, args->bitmask, &hdr);
++ encode_getfattr(xdr, args->dir_bitmask, &hdr);
+ encode_nops(&hdr);
+ }
+
+@@ -3791,7 +3791,8 @@ out_overflow:
+ }
+
+ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap,
+- const struct nfs_server *server, uint32_t *uid, int may_sleep)
++ const struct nfs_server *server, uint32_t *uid,
++ struct nfs4_string *owner_name)
+ {
+ uint32_t len;
+ __be32 *p;
+@@ -3808,8 +3809,12 @@ static int decode_attr_owner(struct xdr_
+ p = xdr_inline_decode(xdr, len);
+ if (unlikely(!p))
+ goto out_overflow;
+- if (!may_sleep) {
+- /* do nothing */
++ if (owner_name != NULL) {
++ owner_name->data = kmemdup(p, len, GFP_NOWAIT);
++ if (owner_name->data != NULL) {
++ owner_name->len = len;
++ ret = NFS_ATTR_FATTR_OWNER_NAME;
++ }
+ } else if (len < XDR_MAX_NETOBJ) {
+ if (nfs_map_name_to_uid(server, (char *)p, len, uid) == 0)
+ ret = NFS_ATTR_FATTR_OWNER;
+@@ -3829,7 +3834,8 @@ out_overflow:
+ }
+
+ static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap,
+- const struct nfs_server *server, uint32_t *gid, int may_sleep)
++ const struct nfs_server *server, uint32_t *gid,
++ struct nfs4_string *group_name)
+ {
+ uint32_t len;
+ __be32 *p;
+@@ -3846,8 +3852,12 @@ static int decode_attr_group(struct xdr_
+ p = xdr_inline_decode(xdr, len);
+ if (unlikely(!p))
+ goto out_overflow;
+- if (!may_sleep) {
+- /* do nothing */
++ if (group_name != NULL) {
++ group_name->data = kmemdup(p, len, GFP_NOWAIT);
++ if (group_name->data != NULL) {
++ group_name->len = len;
++ ret = NFS_ATTR_FATTR_GROUP_NAME;
++ }
+ } else if (len < XDR_MAX_NETOBJ) {
+ if (nfs_map_group_to_gid(server, (char *)p, len, gid) == 0)
+ ret = NFS_ATTR_FATTR_GROUP;
+@@ -4284,7 +4294,7 @@ xdr_error:
+
+ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
+ struct nfs_fattr *fattr, struct nfs_fh *fh,
+- const struct nfs_server *server, int may_sleep)
++ const struct nfs_server *server)
+ {
+ int status;
+ umode_t fmode = 0;
+@@ -4351,12 +4361,12 @@ static int decode_getfattr_attrs(struct
+ goto xdr_error;
+ fattr->valid |= status;
+
+- status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, may_sleep);
++ status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, fattr->owner_name);
+ if (status < 0)
+ goto xdr_error;
+ fattr->valid |= status;
+
+- status = decode_attr_group(xdr, bitmap, server, &fattr->gid, may_sleep);
++ status = decode_attr_group(xdr, bitmap, server, &fattr->gid, fattr->group_name);
+ if (status < 0)
+ goto xdr_error;
+ fattr->valid |= status;
+@@ -4397,7 +4407,7 @@ xdr_error:
+ }
+
+ static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr,
+- struct nfs_fh *fh, const struct nfs_server *server, int may_sleep)
++ struct nfs_fh *fh, const struct nfs_server *server)
+ {
+ __be32 *savep;
+ uint32_t attrlen,
+@@ -4416,7 +4426,7 @@ static int decode_getfattr_generic(struc
+ if (status < 0)
+ goto xdr_error;
+
+- status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server, may_sleep);
++ status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server);
+ if (status < 0)
+ goto xdr_error;
+
+@@ -4427,9 +4437,9 @@ xdr_error:
+ }
+
+ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr,
+- const struct nfs_server *server, int may_sleep)
++ const struct nfs_server *server)
+ {
+- return decode_getfattr_generic(xdr, fattr, NULL, server, may_sleep);
++ return decode_getfattr_generic(xdr, fattr, NULL, server);
+ }
+
+ /*
+@@ -5710,8 +5720,7 @@ static int nfs4_xdr_dec_open_downgrade(s
+ status = decode_open_downgrade(xdr, res);
+ if (status != 0)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5737,8 +5746,7 @@ static int nfs4_xdr_dec_access(struct rp
+ status = decode_access(xdr, res);
+ if (status != 0)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5767,8 +5775,7 @@ static int nfs4_xdr_dec_lookup(struct rp
+ status = decode_getfh(xdr, res->fh);
+ if (status)
+ goto out;
+- status = decode_getfattr(xdr, res->fattr, res->server
+- ,!RPC_IS_ASYNC(rqstp->rq_task));
++ status = decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5794,8 +5801,7 @@ static int nfs4_xdr_dec_lookup_root(stru
+ goto out;
+ status = decode_getfh(xdr, res->fh);
+ if (status == 0)
+- status = decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ status = decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5821,8 +5827,7 @@ static int nfs4_xdr_dec_remove(struct rp
+ status = decode_remove(xdr, &res->cinfo);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->dir_attr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->dir_attr, res->server);
+ out:
+ return status;
+ }
+@@ -5855,14 +5860,12 @@ static int nfs4_xdr_dec_rename(struct rp
+ if (status)
+ goto out;
+ /* Current FH is target directory */
+- if (decode_getfattr(xdr, res->new_fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
++ if (decode_getfattr(xdr, res->new_fattr, res->server))
+ goto out;
+ status = decode_restorefh(xdr);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->old_fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->old_fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5898,14 +5901,12 @@ static int nfs4_xdr_dec_link(struct rpc_
+ * Note order: OP_LINK leaves the directory as the current
+ * filehandle.
+ */
+- if (decode_getfattr(xdr, res->dir_attr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
++ if (decode_getfattr(xdr, res->dir_attr, res->server))
+ goto out;
+ status = decode_restorefh(xdr);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5937,14 +5938,12 @@ static int nfs4_xdr_dec_create(struct rp
+ status = decode_getfh(xdr, res->fh);
+ if (status)
+ goto out;
+- if (decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
++ if (decode_getfattr(xdr, res->fattr, res->server))
+ goto out;
+ status = decode_restorefh(xdr);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->dir_fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->dir_fattr, res->server);
+ out:
+ return status;
+ }
+@@ -5976,8 +5975,7 @@ static int nfs4_xdr_dec_getattr(struct r
+ status = decode_putfh(xdr);
+ if (status)
+ goto out;
+- status = decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ status = decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6079,8 +6077,7 @@ static int nfs4_xdr_dec_close(struct rpc
+ * an ESTALE error. Shouldn't be a problem,
+ * though, since fattr->valid will remain unset.
+ */
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6111,13 +6108,11 @@ static int nfs4_xdr_dec_open(struct rpc_
+ goto out;
+ if (decode_getfh(xdr, &res->fh) != 0)
+ goto out;
+- if (decode_getfattr(xdr, res->f_attr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
++ if (decode_getfattr(xdr, res->f_attr, res->server) != 0)
+ goto out;
+ if (decode_restorefh(xdr) != 0)
+ goto out;
+- decode_getfattr(xdr, res->dir_attr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->dir_attr, res->server);
+ out:
+ return status;
+ }
+@@ -6165,8 +6160,7 @@ static int nfs4_xdr_dec_open_noattr(stru
+ status = decode_open(xdr, res);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->f_attr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->f_attr, res->server);
+ out:
+ return status;
+ }
+@@ -6193,8 +6187,7 @@ static int nfs4_xdr_dec_setattr(struct r
+ status = decode_setattr(xdr);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6374,8 +6367,7 @@ static int nfs4_xdr_dec_write(struct rpc
+ if (status)
+ goto out;
+ if (res->fattr)
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ if (!status)
+ status = res->count;
+ out:
+@@ -6404,8 +6396,7 @@ static int nfs4_xdr_dec_commit(struct rp
+ if (status)
+ goto out;
+ if (res->fattr)
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6564,8 +6555,7 @@ static int nfs4_xdr_dec_delegreturn(stru
+ status = decode_delegreturn(xdr);
+ if (status != 0)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6594,8 +6584,7 @@ static int nfs4_xdr_dec_fs_locations(str
+ goto out;
+ xdr_enter_page(xdr, PAGE_SIZE);
+ status = decode_getfattr(xdr, &res->fs_locations->fattr,
+- res->fs_locations->server,
+- !RPC_IS_ASYNC(req->rq_task));
++ res->fs_locations->server);
+ out:
+ return status;
+ }
+@@ -6844,8 +6833,7 @@ static int nfs4_xdr_dec_layoutcommit(str
+ status = decode_layoutcommit(xdr, rqstp, res);
+ if (status)
+ goto out;
+- decode_getfattr(xdr, res->fattr, res->server,
+- !RPC_IS_ASYNC(rqstp->rq_task));
++ decode_getfattr(xdr, res->fattr, res->server);
+ out:
+ return status;
+ }
+@@ -6976,7 +6964,7 @@ int nfs4_decode_dirent(struct xdr_stream
+ goto out_overflow;
+
+ if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
+- entry->server, 1) < 0)
++ entry->server) < 0)
+ goto out_overflow;
+ if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
+ entry->ino = entry->fattr->mounted_on_fileid;
+diff -up linux-3.2.noarch/include/linux/nfs_idmap.h.orig linux-3.2.noarch/include/linux/nfs_idmap.h
+--- linux-3.2.noarch/include/linux/nfs_idmap.h.orig 2012-01-04 18:55:44.000000000 -0500
++++ linux-3.2.noarch/include/linux/nfs_idmap.h 2012-03-15 10:51:10.395228000 -0400
+@@ -66,6 +66,8 @@ struct idmap_msg {
+ /* Forward declaration to make this header independent of others */
+ struct nfs_client;
+ struct nfs_server;
++struct nfs_fattr;
++struct nfs4_string;
+
+ #ifdef CONFIG_NFS_USE_NEW_IDMAPPER
+
+@@ -97,6 +99,12 @@ void nfs_idmap_delete(struct nfs_client
+
+ #endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
+
++void nfs_fattr_init_names(struct nfs_fattr *fattr,
++ struct nfs4_string *owner_name,
++ struct nfs4_string *group_name);
++void nfs_fattr_free_names(struct nfs_fattr *);
++void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *);
++
+ int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *);
+ int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *);
+ int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t);
+diff -up linux-3.2.noarch/include/linux/nfs_xdr.h.orig linux-3.2.noarch/include/linux/nfs_xdr.h
+--- linux-3.2.noarch/include/linux/nfs_xdr.h.orig 2012-03-15 10:38:54.464449000 -0400
++++ linux-3.2.noarch/include/linux/nfs_xdr.h 2012-03-15 10:51:10.415229000 -0400
+@@ -18,6 +18,11 @@
+ /* Forward declaration for NFS v3 */
+ struct nfs4_secinfo_flavors;
+
++struct nfs4_string {
++ unsigned int len;
++ char *data;
++};
++
+ struct nfs_fsid {
+ uint64_t major;
+ uint64_t minor;
+@@ -61,6 +66,8 @@ struct nfs_fattr {
+ struct timespec pre_ctime; /* pre_op_attr.ctime */
+ unsigned long time_start;
+ unsigned long gencount;
++ struct nfs4_string *owner_name;
++ struct nfs4_string *group_name;
+ };
+
+ #define NFS_ATTR_FATTR_TYPE (1U << 0)
+@@ -85,6 +92,8 @@ struct nfs_fattr {
+ #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
+ #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
+ #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 21)
++#define NFS_ATTR_FATTR_OWNER_NAME (1U << 22)
++#define NFS_ATTR_FATTR_GROUP_NAME (1U << 23)
+
+ #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
+ | NFS_ATTR_FATTR_MODE \
+@@ -324,6 +333,7 @@ struct nfs_openargs {
+ const struct qstr * name;
+ const struct nfs_server *server; /* Needed for ID mapping */
+ const u32 * bitmask;
++ const u32 * dir_bitmask;
+ __u32 claim;
+ struct nfs4_sequence_args seq_args;
+ };
+@@ -342,6 +352,8 @@ struct nfs_openres {
+ __u32 do_recall;
+ __u64 maxsize;
+ __u32 attrset[NFS4_BITMAP_SIZE];
++ struct nfs4_string *owner;
++ struct nfs4_string *group_owner;
+ struct nfs4_sequence_res seq_res;
+ };
+
+@@ -778,11 +790,6 @@ struct nfs3_getaclres {
+ struct posix_acl * acl_default;
+ };
+
+-struct nfs4_string {
+- unsigned int len;
+- char *data;
+-};
+-
+ #ifdef CONFIG_NFS_V4
+
+ typedef u64 clientid4;
diff --git a/kernel.spec b/kernel.spec
index f8e5ee4..f953b74 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -741,6 +741,7 @@ Patch3500: jbd-jbd2-validate-sb-s_first-in-journal_get_superblo.patch
# NFSv4
Patch4000: NFSv4-Reduce-the-footprint-of-the-idmapper.patch
Patch4001: NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
+Patch4003: NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
# patches headed upstream
@@ -1409,6 +1410,7 @@ ApplyPatch jbd-jbd2-validate-sb-s_first-in-journal_get_superblo.patch
# NFSv4
ApplyPatch NFSv4-Reduce-the-footprint-of-the-idmapper.patch
ApplyPatch NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
+ApplyPatch NFSv4-Save-the-owner-group-name-string-when-doing-op.patch
# USB
@@ -2392,6 +2394,9 @@ fi
# and build.
%changelog
+* Mon Mar 19 2012 Steve Dickson <steved(a)redhat.com>
+- NFSv4: Save the owner/group name string when doing open (bz 794780)
+
* Thu Mar 15 2012 Justin M. Forbes <jforbes(a)redhat.com> - 3.2.10-3
- CVE-2012-1179 fix pmd_bad() triggering in code paths holding mmap_sem read mode (rhbz 803809)
--
1.7.7.6
11 years, 6 months
Re: Draft schedule for tomorrow's FESCo meeting (19 March 2012)
by Thorsten Leemhuis
Hi!
/me gave the mail a subject
Jon Ciesla wrote on 18.03.2012 23:33:
>
> = New business =
> [...]
>
> #topic #822 F18 Feature: AE1000 USB wifi driver -
> https://fedoraproject.org/wiki/Features/AE1000usb
> .fesco 822
I must be missing something here. Is that a early April fools joke or is
that simply a feature where the Feature owner (and apparently nobody
else) first asked for advise on this list and on
kernel(a)lists.fedoraproject.org. If he did it I missed that, which is
possible, but I'd assume he would have quickly been told that Fedora
normally(¹) doesn't do things like that (e.g. include kernel drivers
that are not in the upstream kernel).
CU
knurd
(¹) yes, there are exceptions, but I doubt one will be given here
11 years, 6 months
Fedora Kernel Meeting 03-02-2012 Minutes
by Justin Forbes
=======================
#fedora-meeting: kernel
=======================
Meeting started by jforbes at 18:00:51 UTC. The full logs are available
at
http://meetbot.fedoraproject.org/fedora-meeting/2012-03-02/fedora-meeting...
.
Meeting summary
---------------
* common bugs (jforbes, 18:01:44)
* ACTION: disable threaded compression in hibernate code (davej,
18:10:10)
* ACTION: check if abrt will still file bugs if we taint on hibernate
(davej, 18:11:57)
* ACTION: davej to taint hibernate (jforbes, 18:21:36)
* ACTION: jforbes to disable threading in hibernate compression
(jforbes, 18:21:50)
* ACTION: jwb to troll through bugzilla and add bugs to hibernate
blocker (jwb, 18:22:33)
* open floor (jforbes, 18:51:58)
* ACTION: jwb to clean up the "powertop rcu spew bugs" (jwb,
18:55:47)
Meeting ended at 19:01:22 UTC.
Action Items
------------
* disable threaded compression in hibernate code
* check if abrt will still file bugs if we taint on hibernate
* davej to taint hibernate
* jforbes to disable threading in hibernate compression
* jwb to troll through bugzilla and add bugs to hibernate blocker
* jwb to clean up the "powertop rcu spew bugs"
Action Items, by person
-----------------------
* davej
* davej to taint hibernate
* jforbes
* jforbes to disable threading in hibernate compression
* jwb
* jwb to troll through bugzilla and add bugs to hibernate blocker
* jwb to clean up the "powertop rcu spew bugs"
* **UNASSIGNED**
* disable threaded compression in hibernate code
* check if abrt will still file bugs if we taint on hibernate
People Present (lines said)
---------------------------
* davej (86)
* jwb (57)
* jforbes (33)
* pjones (12)
* gholms (8)
* rbergeron (4)
* zodbot (3)
* nirik (1)
* djones (0)
Generated by `MeetBot`_ 0.1.4
11 years, 6 months
I need help on helping :-)
by Peter Senna
Dear list,
I'm focused on Kernel Development and I want to help. But I do not
know how to start.
I know C, and basics of Kernel Internals. I can play with: modules,
syscalls, kernel threads, read and write locking and data structures
like Kernel implementation of linked lists.
What is the path to start helping? To me it would be wonderful to act
like a trainee having tasks to do but with someone who can answer my
questions during the solution.
Thank you,
Peter
--
Peter Senna Tschudin
peter.senna(a)gmail.com
gpg id: 48274C36
11 years, 6 months
[PATCH 0/1] NFSv4: Reduced the footprint of the NFSv4 ID mapper
by Steve Dickson
Reduced the footprint of the NFSv4 ID mapper
The following two (destine to be) upstream patches
reduce the footprint of the the ID mapping code
which resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=593035
Author: Trond Myklebust <Trond.Myklebust(a)netapp.com>
Date: Wed Feb 8 13:39:15 2012 -0500
NFSv4: Further reduce the footprint of the idmapper
Don't allocate the legacy idmapper tables until we actually need
them.
Signed-off-by: Trond Myklebust <Trond.Myklebust(a)netapp.com>
Reviewed-by: Jeff Layton <jlayton(a)redhat.com>
Author: Trond Myklebust <Trond.Myklebust(a)netapp.com>
Date: Tue Feb 7 14:59:05 2012 -0500
NFSv4: Reduce the footprint of the idmapper
Instead of pre-allocating the storage for all the strings, we can
significantly reduce the size of that table by doing the allocation
when we do the downcall.
Signed-off-by: Trond Myklebust <Trond.Myklebust(a)netapp.com>
Reviewed-by: Jeff Layton <jlayton(a)redhat.com>
Steve Dickson (1):
Reduced the footprint of the NFSv4 ID mapper
...FSv4-Reduce-the-footprint-of-the-idmapper.patch | 46 ++++++++
...ther-reduce-the-footprint-of-the-idmapper.patch | 109 ++++++++++++++++++++
kernel.spec | 7 ++
3 files changed, 162 insertions(+), 0 deletions(-)
create mode 100644 0001-NFSv4-Reduce-the-footprint-of-the-idmapper.patch
create mode 100644 0002-NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
--
1.7.7.5
11 years, 6 months
Severity level of disable IRQ messages?
by Bruno Wolff III
I am getting syslog warnings sent out to my terminal sessions when
IRQs get disabled. Is this really something severe enough to deserve
that kind of notice? If so, should I be filing bugs?
Sample message:
Message from syslogd@wolff at Mar 7 16:29:51 ...
kernel:[63120.139549] Disabling IRQ 15
This is with 3.3.0-0.rc6.git0.2.fc17.i686.PAE.
11 years, 6 months
No rc6.git0 for f18?
by Bruno Wolff III
Was the nodebug rc6.git0 build skipped for rawhide intentionally?
11 years, 6 months
[PATCH] Add -r to debuginfo_args to invoke eu-strip --reloc-debug-sections.
by Mark Wielaard
The -r flag to find-debuginfo.sh to invoke eu-strip --reloc-debug-sections
reduces the number of unnecessary relocations in kernel module .ko.debug
files. This saves ~500MB on the installed size of the kernel-debuginfo
package and makes the rpm file ~30MB smaller.
---
kernel.spec | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/kernel.spec b/kernel.spec
index 1f801f0..b9715fe 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -54,7 +54,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
-%global baserelease 2
+%global baserelease 3
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -566,8 +566,11 @@ BuildRequires: pciutils-devel gettext
BuildConflicts: rhbuildsys(DiskFree) < 500Mb
%if %{with_debuginfo}
# Fancy new debuginfo generation introduced in Fedora 8/RHEL 6.
-BuildRequires: rpm-build >= 4.4.2.1-4
-%define debuginfo_args --strict-build-id
+# The -r flag to find-debuginfo.sh to invoke eu-strip --reloc-debug-sections
+# reduces the number of relocations in kernel module .ko.debug files and was
+# introduced with rpm 4.9 and elfutils 0.153.
+BuildRequires: rpm-build >= 4.9.0-1, elfutils >= elfutils-0.153-1
+%define debuginfo_args --strict-build-id -r
%endif
Source0: ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-%{kversion}.tar.xz
@@ -2376,6 +2379,9 @@ fi
# ||----w |
# || ||
%changelog
+* Wed Feb 29 2012 Mark Wielaard <mark(a)klomp.org> - 3.3.0-0.rc5.git2.3
+- Add -r to debuginfo_args to invoke eu-strip --reloc-debug-sections.
+
* Tue Feb 28 2012 Josh Boyer <jwboyer(a)redhat.com>
- Add patch to enable keyboard backlight on Sony laptops (rhbz 728478)
--
1.7.7.6
11 years, 7 months
Fedora Kernel Team Meeting agenda Mar 2 2012
by Dave Jones
The kernel has several widespread bugs that are affecting all releases,
that are impacting a lot of users.
* Hibernation
There are so many bugs here it's hard to know where to begin.
- We have cases where it fails to sleep, or resumes instantly.
- There are cases where it looks to be working ok, but shortly
after resuming, we see oopses/panics etc. It looks like something
is scribbling over random parts of memory (usually landing on the dcache)
- For some of those cases, it's an i915 bug where disabling modesetting
works around it. We've seen similar bugs from non-i915 hardware though.
* Root dentry has weird name <>
A number of users are seeing this message, which again, looks like
something scribbled over the dcache. Some, but not all were using
hibernate, so we have possibly another case of kernel memory corruption.
(or perhaps resuming from hibernate makes this bug easier to hit)
* Page table corruption.
We have an alarming number of reports from users seeing 'bad page map'
or 'bad page entry' messages from the kernel. There's no real pattern
here that we can see.
We have a number of ideas to try and further diagnose this, which we'll
discuss at 18:00UTC today, in our bi-weekly kernel meeting in #fedora-meeting.
Dave
11 years, 7 months