diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 18 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.h | 1 | ||||
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 7 |
3 files changed, 24 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index b96d6017331..d4ca1d1f617 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -359,7 +359,15 @@ fuse_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "%"PRIu64": %s() %s => -1 (%s)", frame->root->unique, gf_fop_list[frame->root->op], state->loc.path, strerror (op_errno)); - send_fuse_err (this, state->finh, op_errno); + if (op_errno == ENOENT) { + feo.entry_valid = + calc_timeout_sec (priv->negative_timeout); + feo.entry_valid_nsec = + calc_timeout_nsec (priv->negative_timeout); + send_fuse_obj (this, finh, &feo); + } else { + send_fuse_err (this, state->finh, op_errno); + } } free_fuse_state (state); @@ -4547,6 +4555,11 @@ init (xlator_t *this_xl) if (ret != 0) priv->entry_timeout = 1.0; /* default */ + ret = dict_get_double (options, "negative-timeout", + &priv->negative_timeout); + if (ret != 0) + priv->negative_timeout = 0.0; /* default */ + ret = dict_get_int32 (options, "client-pid", &priv->client_pid); if (ret == 0) @@ -4777,6 +4790,9 @@ struct volume_options options[] = { { .key = {ZR_ENTRY_TIMEOUT_OPT}, .type = GF_OPTION_TYPE_DOUBLE }, + { .key = {ZR_NEGATIVE_TIMEOUT_OPT}, + .type = GF_OPTION_TYPE_DOUBLE + }, { .key = {ZR_STRICT_VOLFILE_CHECK}, .type = GF_OPTION_TYPE_BOOL }, diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 5ffb285a28b..cb5eb600147 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -86,6 +86,7 @@ struct fuse_private { size_t *msg0_len_p; double entry_timeout; + double negative_timeout; double attribute_timeout; pthread_cond_t sync_cond; diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index e585ba3b7fd..a0a31660ab3 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -125,13 +125,17 @@ start_glusterfs () fi if [ -n "$attribute_timeout" ]; then - cmd_line=$(echo "$cmd_line --attribute-time=$attribute_timeout"); + cmd_line=$(echo "$cmd_line --attribute-timeout=$attribute_timeout"); fi if [ -n "$entry_timeout" ]; then cmd_line=$(echo "$cmd_line --entry-timeout=$entry_timeout"); fi + if [ -n "$negative_timeout" ]; then + cmd_line=$(echo "$cmd_line --negative-timeout=$negative_timeout"); + fi + if [ -n "$gid_timeout" ]; then cmd_line=$(echo "$cmd_line --gid-timeout=$gid_timeout"); fi @@ -329,6 +333,7 @@ main () "attribute-timeout") attribute_timeout=$value ;; "entry-timeout") entry_timeout=$value ;; + "negative-timeout") negative_timeout=$value ;; "gid-timeout") gid_timeout=$value ;; *) echo "unknown option $key (ignored)" ;; esac |