--- x/fs/netfs/write_collect.c +++ y/fs/netfs/write_collect.c @@ -548,7 +548,9 @@ void netfs_write_collection_worker(struc return; } + mutex_lock(&ictx->wb_lock); netfs_collect_write_results(wreq); + mutex_unlock(&ictx->wb_lock); /* We're done when the app thread has finished posting subreqs and all * the queues in all the streams are empty. --- l/net/9p/client.c +++ c/net/9p/client.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -979,6 +980,7 @@ struct p9_client *p9_client_create(const int err; struct p9_client *clnt; char *client_id; + static int fcc = 0; clnt = kmalloc(sizeof(*clnt), GFP_KERNEL); if (!clnt) @@ -991,6 +993,11 @@ struct p9_client *p9_client_create(const client_id = utsname()->nodename; memcpy(clnt->name, client_id, strlen(client_id) + 1); + clnt->name[__NEW_UTS_LEN] = 0; + if (__NEW_UTS_LEN <= snprintf(clnt->name, __NEW_UTS_LEN, "9pfcc%d", ++fcc)) { + kfree(clnt); + return ERR_PTR(-ENOMEM); + } spin_lock_init(&clnt->lock); idr_init(&clnt->fids); idr_init(&clnt->reqs); @@ -1039,7 +1046,7 @@ struct p9_client *p9_client_create(const * followed by data accessed from userspace by read */ clnt->fcall_cache = - kmem_cache_create_usercopy("9p-fcall-cache", clnt->msize, + kmem_cache_create_usercopy(clnt->name, clnt->msize, 0, 0, P9_HDRSZ + 4, clnt->msize - (P9_HDRSZ + 4), NULL);