There are places where we want values to be within a reasonable min..max range, but also want to allow 0 to turn off the option. There are new CONF_ITEM_UI32_ZERO, CONF_ITEM_UI64_ZERO, and CONF_ITEM_I64_ZERO tags that can be used.

 

CONF_ITEM_I64_ZERO exists for time_t values that are only positive values.

 

The patch to allow these: https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/519460

 

The impetus for this patch is https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/518384

 

Candidates for conversion are:

 

./support/nfs_read_conf.c:200:  CONF_ITEM_I64("Blocked_Lock_Poller_Interval", 0, 180, 10,

./support/nfs_read_conf.c:248:  CONF_ITEM_I64("Manage_Gids_Expiration", 0, 7*24*60*60, 30*60,

./log/log_functions.c:2542:          CONF_ITEM_UI32("RPC_Debug_Flags", 0, UINT32_MAX,

./support/nfs_read_conf.c:166:  CONF_ITEM_UI32("DRC_TCP_Recycle_Expire_S", 0, 60*60, 600,

./support/nfs_read_conf.c:182:  CONF_ITEM_UI32("RPC_Idle_Timeout_S", 0, 60*60, 300,

./support/nfs_read_conf.c:224:  CONF_ITEM_UI32("TCP_KEEPCNT", 0, 255, 0,

./support/nfs_read_conf.c:226:  CONF_ITEM_UI32("TCP_KEEPIDLE", 0, 65535, 0,

./support/nfs_read_conf.c:228:  CONF_ITEM_UI32("TCP_KEEPINTVL", 0, 65535, 0,

./support/nfs_read_conf.c:252:  CONF_ITEM_UI32("heartbeat_freq", 0, 5000, 1000,

./support/nfs_read_conf.c:262:  CONF_ITEM_UI32("Max_Uid_To_Group_Reqs", 0, INT32_MAX, 0,

./support/nfs_read_conf.c:334:  CONF_ITEM_UI32("Lease_Lifetime", 0, 120, LEASE_LIFETIME_DEFAULT,

./support/nfs_read_conf.c:336:  CONF_ITEM_UI32("Grace_Period", 0, 180, GRACE_PERIOD_DEFAULT,

./support/nfs_read_conf.c:350:  CONF_ITEM_UI32("Deleg_Recall_Retry_Delay", 0, 10,

./support/nfs_read_conf.c:372:  CONF_ITEM_UI32("Max_Client_Ids", 0, UINT32_MAX, 0,

./FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c:62:               CONF_ITEM_UI32("Dir_Chunk", 0, UINT32_MAX, 128,

./FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c:68:               CONF_ITEM_UI32("Entries_Release_Size", 0, UINT32_MAX, 100,

./FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c:74:               CONF_ITEM_UI32("FD_Limit_Percent", 0, 100, 99,

./FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c:76:               CONF_ITEM_UI32("FD_HWMark_Percent", 0, 100, 90,

./FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c:78:               CONF_ITEM_UI32("FD_LWMark_Percent", 0, 100, 50,

./FSAL/FSAL_PROXY_V4/export.c:48:        CONF_ITEM_UI32("Retry_SleepTime", 0, 60, 10,

./FSAL/FSAL_PROXY_V4/export.c:73:        CONF_ITEM_UI32("Credential_LifeTime", 0, 86400*2, 86400,

./FSAL/FSAL_MEM/mem_main.c:84:         CONF_ITEM_UI32("Inode_Size", 0, 0x200000, 0,

./FSAL/FSAL_MEM/mem_main.c:86:         CONF_ITEM_UI32("Up_Test_Interval", 0, UINT32_MAX, 0,

./FSAL/FSAL_MEM/mem_main.c:88:         CONF_ITEM_UI32("Async_Threads", 0, 100, 0,

./FSAL/FSAL_MEM/mem_export.c:213:    CONF_ITEM_UI32("Async_Delay", 0, 1000, 0,

./FSAL/FSAL_MEM/mem_export.c:217:    CONF_ITEM_UI32("Async_Stall_Delay", 0, 1000, 0,

 

Actually another question on these is if 0 is actually meaningful for all of these…

 

There certainly are lots of timeouts which perhaps should have a sane minimum value.

 

Any thoughts?

 

Frank