Merge PR #45192 into main

* refs/pull/45192/head:
	mds: use the whole string as the snapshot long name

Reviewed-by: Jos Collin <jcollin@redhat.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Nikhilkumar Shelke <nshelke@redhat.com>
This commit is contained in:
Venky Shankar 2022-12-12 19:43:54 +05:30
commit aa403a9532
2 changed files with 4 additions and 3 deletions

View File

@ -153,3 +153,4 @@ kamoltat Kamoltat Sirivadhna <ksirivad@redhat.com>
anthonyeleven Anthony D Atri <anthony.datri@gmail.com>
petrutlucian94 Lucian Petrut <lpetrut@cloudbasesolutions.com>
dparmar18 Dhairya Parmar <dparmar@redhat.com>
nmshelke Nikhilkumar Shelke <nshelke@redhat.com>

View File

@ -84,9 +84,9 @@ std::string_view SnapInfo::get_long_name() const
if (long_name.empty() ||
long_name.compare(1, name.size(), name) ||
long_name.find_last_of("_") != name.size() + 1) {
char nm[80];
snprintf(nm, sizeof(nm), "_%s_%llu", name.c_str(), (unsigned long long)ino);
long_name = nm;
std::ostringstream oss;
oss << "_" << name << "_" << (unsigned long long)ino;
long_name = oss.str();
}
return long_name;
}