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:52:35 +0000
commit162dd389301ce238b5003d6b4f6031256532508b (patch)
tree8100bf96362321edec26f099334102d3962c5bdd /meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
parentb3bb9c770b17be4f7e1e424e0d0ec00ebe5bfb62 (diff)
downloadpoky-162dd389301ce238b5003d6b4f6031256532508b.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] (From OE-Core rev: 24183f5ec9c71db936e75060387941463d30d962) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 @@
1From: Jason Wessel <jason.wessel@windriver.com>
2Date: Sat, 23 Feb 2013 08:49:08 -0600
3Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem
4
5The following test case fails with modern linunx kernels which cache
6the renamed inode.
7
8 % mkdir a;mkdir b;mv b a/;ls -l a
9 ls: a/b: Stale NFS file handle
10
11The issue is that nfserver was not updating the fh_cache with the new
12location of the inode, when it moves directories.
13
14Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
15
16Upstream-Status: Pending
17
18---
19 fh_cache.c | 12 ++++++++++++
20 fh_cache.h | 1 +
21 nfs.c | 2 ++
22 3 files changed, 15 insertions(+)
23
24--- a/fh_cache.c
25+++ b/fh_cache.c
26@@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev,
27 }
28
29 /*
30+ * update a fh inode cache for an operation like rename
31+ */
32+void fh_cache_update(nfs_fh3 fh, char *path)
33+{
34+ unfs3_fh_t *obj = (void *) fh.data.data_val;
35+ backend_statstruct buf;
36+
37+ if (backend_lstat(path, &buf) != -1) {
38+ fh_cache_add(obj->dev, buf.st_ino, path);
39+ }
40+}
41+/*
42 * resolve a filename into a path
43 * cache-using wrapper for fh_decomp_raw
44 */
45--- a/fh_cache.h
46+++ b/fh_cache.h
47@@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str
48 unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir);
49
50 char *fh_cache_add(uint32 dev, uint64 ino, const char *path);
51+void fh_cache_update(nfs_fh3 fh, char *path);
52
53 #endif
54--- a/nfs.c
55+++ b/nfs.c
56@@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME
57 res = backend_rename(from_obj, to_obj);
58 if (res == -1)
59 result.status = rename_err();
60+ /* Update the fh_cache with moved inode value */
61+ fh_cache_update(argp->to.dir, to_obj);
62 }
63 }
64