summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c39
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c4
2 files changed, 40 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index ac8295b96de..798b87b0525 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -240,6 +240,13 @@ fuse_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
void
fuse_lookup_resume (fuse_state_t *state)
{
+ if (!state->loc.parent && !state->loc.inode) {
+ gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
+ state->loc.path);
+ send_fuse_err (state->this, state->finh, ENOENT);
+ free_fuse_state (state);
+ return;
+ }
if (!state->loc.inode)
state->loc.inode = inode_new (state->loc.parent->table);
@@ -1004,6 +1011,14 @@ fuse_readlink (xlator_t *this, fuse_in_header_t *finh, void *msg)
void
fuse_mknod_resume (fuse_state_t *state)
{
+ if (!state->loc.parent) {
+ gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
+ state->loc.path);
+ send_fuse_err (state->this, state->finh, ENOENT);
+ free_fuse_state (state);
+ return;
+ }
+
if (!state->loc.inode)
state->loc.inode = inode_new (state->loc.parent->table);
else
@@ -1056,6 +1071,14 @@ fuse_mknod (xlator_t *this, fuse_in_header_t *finh, void *msg)
void
fuse_mkdir_resume (fuse_state_t *state)
{
+ if (!state->loc.parent) {
+ gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
+ state->loc.path);
+ send_fuse_err (state->this, state->finh, ENOENT);
+ free_fuse_state (state);
+ return;
+ }
+
if (!state->loc.inode)
state->loc.inode = inode_new (state->loc.parent->table);
else
@@ -1182,6 +1205,14 @@ fuse_rmdir (xlator_t *this, fuse_in_header_t *finh, void *msg)
void
fuse_symlink_resume (fuse_state_t *state)
{
+ if (!state->loc.parent) {
+ gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
+ state->loc.path);
+ send_fuse_err (state->this, state->finh, ENOENT);
+ free_fuse_state (state);
+ return;
+ }
+
if (!state->loc.inode)
state->loc.inode = inode_new (state->loc.parent->table);
else
@@ -1486,6 +1517,14 @@ fuse_create_resume (fuse_state_t *state)
{
fd_t *fd = NULL;
+ if (!state->loc.parent) {
+ gf_log ("fuse", GF_LOG_ERROR, "failed to resolve path %s",
+ state->loc.path);
+ send_fuse_err (state->this, state->finh, ENOENT);
+ free_fuse_state (state);
+ return;
+ }
+
if (!state->loc.inode)
state->loc.inode = inode_new (state->loc.parent->table);
else
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index b90ef3d5f8d..77a55cd701f 100644
--- a/xlators/mount/fuse/src/fuse-resolve.c
+++ b/xlators/mount/fuse/src/fuse-resolve.c
@@ -661,8 +661,6 @@ gf_resolve_done (fuse_state_t *state)
static int
gf_resolve_all (fuse_state_t *state)
{
- xlator_t *this = NULL;
-
if (state->resolve_now == NULL) {
state->resolve_now = &state->resolve;
@@ -682,7 +680,7 @@ gf_resolve_all (fuse_state_t *state)
gf_resolve_done (state);
} else {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_log ("fuse-resolve", GF_LOG_ERROR,
"Invalid pointer for state->resolve_now");
}