summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
commit54076fbd5935cff4ba501266954c1b424c8e756f (patch)
tree5d1958b8fb91fc1e5e7b73d759680daf4ae3d9e5
parent161c6c41d2ee6ae9529b36ad29e4f5123cd09fd1 (diff)
downloadillumos-fusefs-54076fbd5935cff4ba501266954c1b424c8e756f.tar.gz
Coped with an obscure closedir() related to "rm -rf"
-rw-r--r--kernel/fuse.h1
-rw-r--r--kernel/fuse_vnops.c14
2 files changed, 14 insertions, 1 deletions
diff --git a/kernel/fuse.h b/kernel/fuse.h
index 865b54d..c26d6b6 100644
--- a/kernel/fuse.h
+++ b/kernel/fuse.h
@@ -52,6 +52,7 @@ extern "C" {
*/
#define CACHE_LIST_NO_CHECK 0
#define CACHE_LIST_CHECK 1
+#define CACHE_CHECK_ONLY 2
#define FUSE_NULL_ID 0
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index f7982e6..e2c2aaf 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -662,6 +662,10 @@ get_filehandle(struct vnode *vp, int flag, struct cred *credp,
if (iterate_filehandle(vp, fuse_std_filecheck, &fh_param,
fufhpp))
goto out;
+ if (check_cache & CACHE_CHECK_ONLY) {
+ err = ENOENT;
+ goto out;
+ }
}
/*
* Allocate a new message node only if create_filehandle wasn't able
@@ -822,10 +826,18 @@ static int fuse_close(struct vnode *vp, int flags, int count,
return (ENODEV);
}
- if ((err = get_filehandle(vp, flags, credp, &fhp, CACHE_LIST_CHECK))) {
+ /*
+ * JPA Only check within the cache, if not referenced in the
+ * cache, there is nothing to do.
+ * This happens in obscure circumstances related to "rm -rf"
+ */
+ if ((err = get_filehandle(vp, flags, credp, &fhp,
+ CACHE_LIST_CHECK | CACHE_CHECK_ONLY))) {
DTRACE_PROBE2(fuse_close_err_filehandle,
char *, "get_filehandle failed",
struct vnode *, vp);
+ if (err == ENOENT)
+ err = 0;
goto cleanup;
}