Skip to content

Commit 7b631e7

Browse files
committed
mds: generate symlink inode with correct mode
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 <[email protected]>
1 parent d28e5fe commit 7b631e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mds/CInode.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,6 +4768,7 @@ void InodeStore::generate_test_instances(std::list<InodeStore*> &ls)
47684768
{
47694769
InodeStore *populated = new InodeStore;
47704770
populated->get_inode()->ino = 0xdeadbeef;
4771+
populated->get_inode()->mode = S_IFLNK | 0777;
47714772
populated->symlink = "rhubarb";
47724773
ls.push_back(populated);
47734774
}
@@ -4776,6 +4777,7 @@ void InodeStoreBare::generate_test_instances(std::list<InodeStoreBare*> &ls)
47764777
{
47774778
InodeStoreBare *populated = new InodeStoreBare;
47784779
populated->get_inode()->ino = 0xdeadbeef;
4780+
populated->get_inode()->mode = S_IFLNK | 0777;
47794781
populated->symlink = "rhubarb";
47804782
ls.push_back(populated);
47814783
}

0 commit comments

Comments
 (0)