summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2014-01-23 08:32:41 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-28 00:48:27 +0000
commit24183f5ec9c71db936e75060387941463d30d962 (patch)
tree56d0f61785a94fdb66be124d67bf74b19b74e4a5 /meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
parent56490921d267b784118df43cbd107925c8b94200 (diff)
downloadopenembedded-core-24183f5ec9c71db936e75060387941463d30d962.tar.gz
unfs3: Add a NFSv3 user mode server for use with runqemu
The user mode nfs server allows the use of runqemu without any root privileges and may even be accelerated with kvm. Example: runqemu-extract-sdk tmp-eglibc/deploy/images/qemux86-64/core-image-minimal-qemux86-64.tar.bz2 rootfs runqemu qemux86-64 `pwd`/rootfs nographic slirp kvm [YOCTO #5639] Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch')
-rw-r--r--meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
new file mode 100644
index 0000000000..37de8c3ca2
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
@@ -0,0 +1,64 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sat, 23 Feb 2013 08:49:08 -0600
+Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem
+
+The following test case fails with modern linunx kernels which cache
+the renamed inode.
+
+ % mkdir a;mkdir b;mv b a/;ls -l a
+ ls: a/b: Stale NFS file handle
+
+The issue is that nfserver was not updating the fh_cache with the new
+location of the inode, when it moves directories.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+---
+ fh_cache.c | 12 ++++++++++++
+ fh_cache.h | 1 +
+ nfs.c | 2 ++
+ 3 files changed, 15 insertions(+)
+
+--- a/fh_cache.c
++++ b/fh_cache.c
+@@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev,
+ }
+
+ /*
++ * update a fh inode cache for an operation like rename
++ */
++void fh_cache_update(nfs_fh3 fh, char *path)
++{
++ unfs3_fh_t *obj = (void *) fh.data.data_val;
++ backend_statstruct buf;
++
++ if (backend_lstat(path, &buf) != -1) {
++ fh_cache_add(obj->dev, buf.st_ino, path);
++ }
++}
++/*
+ * resolve a filename into a path
+ * cache-using wrapper for fh_decomp_raw
+ */
+--- a/fh_cache.h
++++ b/fh_cache.h
+@@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str
+ unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir);
+
+ char *fh_cache_add(uint32 dev, uint64 ino, const char *path);
++void fh_cache_update(nfs_fh3 fh, char *path);
+
+ #endif
+--- a/nfs.c
++++ b/nfs.c
+@@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME
+ res = backend_rename(from_obj, to_obj);
+ if (res == -1)
+ result.status = rename_err();
++ /* Update the fh_cache with moved inode value */
++ fh_cache_update(argp->to.dir, to_obj);
+ }
+ }
+