Message ID | 20170222124653.GA11726@dustball.brq.redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Jan Stancek <jstancek@redhat.com> wrote: > I'm running into following warning with 4.10 reliably (on ppc64le) > when I mount NFS volume (exported by RHEL6 system): Yeah. I've seen this before. > Patch below makes it go away for me, but I'm not sure it's the correct way. The right solution is to split user_key_payload(). It's actually getting used for two different things. We really need a user_key_payload_rcu() that just uses rcu_dereference(). David -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index c444285bb1b1..a67d1c04ba40 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -309,7 +309,7 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen, goto out; } - rcu_read_lock(); + down_read(&rkey->sem); rkey->perm |= KEY_USR_VIEW; ret = key_validate(rkey); @@ -329,7 +329,7 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen, ret = -EINVAL; out_up: - rcu_read_unlock(); + up_read(&rkey->sem); key_put(rkey); out: return ret;