Fix test instance generation for InodeStoreBare and InodeStore to
properly set the mode field to S_IFLNK for symlink inodes.
Previously, generated test instances with symlink inodes had unset
mode fields, creating inconsistent data. This issue was masked because
ceph-dencoder reused existing instances during encode/decode consistency
tests, leaving stale values intact.
The problem would surface when check-generated.sh and readable.sh
allocate fresh instances for decoding tests, as the missing mode field
would cause decode/encode inconsistencies.
This change fixes generate_test_instances() to set the mode field to
S_IFLNK for symlink inodes, creating valid InodeStore and InodeStoreBare
instances with consistent field values for proper encode/decode testing.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
{
InodeStore *populated = new InodeStore;
populated->get_inode()->ino = 0xdeadbeef;
+ populated->get_inode()->mode = S_IFLNK | 0777;
populated->symlink = "rhubarb";
ls.push_back(populated);
}
{
InodeStoreBare *populated = new InodeStoreBare;
populated->get_inode()->ino = 0xdeadbeef;
+ populated->get_inode()->mode = S_IFLNK | 0777;
populated->symlink = "rhubarb";
ls.push_back(populated);
}