Hello,
The expire_time_attr is set by mdcache_new_entry() and is copied from either
FSAL attrs or op_ctx->export_perms->expire_time_attr. For root of the export, I
see this as zero. I think it is because the root handle is created through
lookup_path() and op_ctx is initialized through init_root_op_context which
doesn't set export_perms.expire_time_attr.
The zero expire_time_attr causes every getattr to go to FSAL. Since getattr is
called from several places, this ends up increasing the path length of the call (for
ex: READDIR under export root).
What is the right fix for this? Initializing in init_root_op_context() OR let FSAL to
return a non-zero value?
I think the goal would be to set it correctly as if the mdcache node had been created any
other way.
So for one thing, init_root_export should set the export_perms with the bits and bobs for
expire_time_attr, so something like
/* set the EXPORT_OPTION_EXPIRE_SET bit from the export into the op_ctx */
op_ctx->export_perms.options = op_ctx->ctx_export->export_perms.set &
EXPORT_OPTION_EXPIRE_SET;
/* set expire_time_attr if appropriate */
if ((op_ctx->export_perms->set & EXPORT_OPTION_EXPIRE_SET) == 0
&&
(op_ctx->ctx_export->export_perms.set &
EXPORT_OPTION_EXPIRE_SET) != 0)
op_ctx->export_perms->expire_time_attr =
op_ctx->ctx_export->export_perms.expire_time_attr;
I think with that, the mdcache_new_entry will then fill in the entrie's
expire_time_attr correctly.
Frank
#0 mdcache_new_entry (export=export@entry=0x555555766ea0,
sub_handle=0x555555764c50,
attrs_in=attrs_in@entry=0x7fffffffdda0, attrs_out=attrs_out@entry=0x0,
new_directory=new_directory@entry=false,
entry=entry@entry=0x7fffffffdd98, state=0x0,
reason=MDC_REASON_DEFAULT)
at /usr/src/debug/nfs-ganesha-3.2-
1.el8.x86_64/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c:66
4
#1 0x00007ffff7b1ac76 in mdcache_lookup_path (exp_hdl=0x555555766ea0,
path=0x555555767470 "/nfsroot",
handle=0x7fffffffdee8, attrs_out=0x0)
at /usr/src/debug/nfs-ganesha-3.2-
1.el8.x86_64/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c:15
66
#2 0x00007ffff7aab25c in init_export_root
(export=export@entry=0x555555766368)
at /usr/src/debug/nfs-ganesha-3.2-1.el8.x86_64/src/support/exports.c:2321
#3 0x00007ffff7aacce5 in init_export_cb (exp=0x555555766368,
state=0x7fffffffe0b0)
at /usr/src/debug/nfs-ganesha-3.2-1.el8.x86_64/src/support/exports.c:2185
#4 0x00007ffff7ac0b44 in foreach_gsh_export (cb=cb@entry=0x7ffff7aaccd0
<init_export_cb>, wrlock=wrlock@entry=true,
state=state@entry=0x7fffffffe0b0) at /usr/src/debug/nfs-ganesha-3.2-
1.el8.x86_64/src/support/export_mgr.c:784
#5 0x00007ffff7aaaf3a in exports_pkginit () at /usr/src/debug/nfs-ganesha-3.2-
1.el8.x86_64/src/support/exports.c:2204
#6 0x00007ffff7a382f5 in nfs_Init (p_start_info=<optimized out>)
at /usr/src/debug/nfs-ganesha-3.2-1.el8.x86_64/src/MainNFSD/nfs_init.c:644
#7 0x00007ffff7a39c1b in nfs_start (p_start_info=<optimized out>)
at /usr/src/debug/nfs-ganesha-3.2-1.el8.x86_64/src/MainNFSD/nfs_init.c:925
#8 0x00005555555565a9 in main (argc=<optimized out>, argv=<optimized out>)
at /usr/src/debug/nfs-ganesha-3.2-
1.el8.x86_64/src/MainNFSD/nfs_main.c:519
(gdb) p *op_ctx
$1 = {creds = 0x7fffffffdfe8, original_creds = {caller_uid = 0, caller_gid = 0,
caller_glen = 0, caller_garray = 0x0},
caller_gdata = 0x0, caller_garray_copy = 0x0, managed_garray_copy = 0x0,
cred_flags = 0, caller_addr = 0x0,
clientid = 0x0, nfs_vers = 0, nfs_minorvers = 0, req_type = 0, client = 0x0,
ctx_export = 0x555555766368,
fsal_export = 0x555555766ea0, export_perms = 0x7fffffffe000, start_time = 0,
fsal_private = 0x0,
fsal_module = 0x7ffff7dc0100 <MDCACHE>, fsal_pnfs_ds = 0x0}
(gdb) p *op_ctx->export_perms
$2 = {anonymous_uid = 0, anonymous_gid = 0, expire_time_attr = 0, options =
124908000, set = 124908031}
_______________________________________________
Devel mailing list -- devel(a)lists.nfs-ganesha.org To unsubscribe send an email to
devel-leave(a)lists.nfs-ganesha.org