- if (strncmp(fsname, dirent->lld_name, len) == 0) {
- CDEBUG(D_MGS, "Removing log %s\n", dirent->lld_name);
- mgs_erase_log(obd, dirent->lld_name);
+ suffix = strrchr(dirent->lld_name, '-');
+ if (suffix != NULL) {
+ if ((len == suffix - dirent->lld_name) &&
+ (strncmp(fsname, dirent->lld_name, len) == 0)) {
+ CDEBUG(D_MGS, "Removing log %s\n",
+ dirent->lld_name);
+ mgs_erase_log(obd, dirent->lld_name);
+ }