Commit
Similar to ibm2.5, have a config parameter Cache_FDs such that: If "Cache_FDs" is set to false, the reaper thread aggressively closes FDs , significantly reducing the number of open FDs. This will help to maintain a minimal number of open FDs. If "Cache_FDs" is set to true (default), FDs are cached, and the LRU reaper thread closes FDs only when the current open FD count reaches or exceeds the "fds_lowat" threshold. Change-Id: Ica3a5e7ea1a0b81665b8d9ad701dccb7090209a8 Signed-off-by: Madhu Thorat <madhu.punjabi@in.ibm.com> (cherry picked from commit 9bf5651) Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
- Loading branch information
There are no files selected for viewing
4 comments
on commit 7180f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell this change introduced a read of uninitialized value:
fsal_status_t
mdcache_lru_pkginit(void)
{
...
struct fd_lru_parameter fd_lru_parameter;
.......... // sets many fields in fd_lru_parameter but does NOT set field Cache_FDs
status = fd_lru_pkginit(&fd_lru_parameter);
return status;
}
bool Cache_FDs; <==== This is a global variable
fsal_status_t fd_lru_pkginit(struct fd_lru_parameter *params)
{
.....
Cache_FDs = params->Cache_FDs; <=== This is reading uninitialized memory to set the global variable.
....
}
I found this problem with ubsan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I annotated the flow of this parameter from the MDCACHE config through the FSAL parameters to the FSAL global variable. It looks like it's all there.
Can you annotate where you think something is missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK, I see it now, it's needed at about line 1652 in FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c. Could you open a github issue, and if you're willing to make the patch, please do so and submit to gerrithub, otherwise I'll probably get to it next week.
Thanks
Frank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #1008 and sent a fix: https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1170151
The actual 'params' passed to fd_lru_pkginit by mdcache_lru_pkginit never had a value assigned to Cache_FDs, so here we end up reading an uninitialized value. Look in mdcache_lru_pkginit, in mdcache_lru.c.