Previously if all but two characters in file name suffix are digit,
it's not treated as temp file, as is too strict if suffix length is
short, e.g. 6. Change it to allow one character, and this non-digit
character should not be the starting character.
Test-Parameters: trivial testlist=sanity env=ONLY=33h,ONLY_REPEAT=500
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ie36e6e15c1e593f47f4d3fab7f8c567d1d587f28
Reviewed-on: https://review.whamcloud.com/38539
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
* About 0.07% of randomly-generated names will slip through,
* but this avoids 99.93% of cross-MDT renames for those files.
*/
- if (digit >= suffixlen - 2 || upper == suffixlen || lower == suffixlen)
+ if ((digit >= suffixlen - 1 && !isdigit(name[namelen - suffixlen])) ||
+ upper == suffixlen || lower == suffixlen)
return false;
return true;