From: Patrick Donnelly Date: Tue, 16 Apr 2024 01:12:51 +0000 (-0400) Subject: mds: encode flags for all inode types X-Git-Tag: testing/wip-pdonnell-testing-20240417.020258-debug^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=52c8ec2508e0efcd29aff7cdc8ca88922d42f2cd;p=ceph-ci.git mds: encode flags for all inode types Inode flag F_QUIESCE_BLOCK would not be encoded for regular files. Unfortunately we're encoding the value twice for directories but it's a small overhead. Fixes: https://tracker.ceph.com/issues/65518 Fixes: fb05dd1806fc0edf2e4c0908aae114d57099a6d6 Fixes: e2529fc74808b102b1ca85a3ee6644160da32e60 Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 33cc0b9eb28..efce34e6caa 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -2144,7 +2144,7 @@ void CInode::decode_lock_iflock(bufferlist::const_iterator& p) void CInode::encode_lock_ipolicy(bufferlist& bl) { - ENCODE_START(2, 1, bl); + ENCODE_START(3, 1, bl); if (is_dir()) { encode(get_inode()->version, bl); encode(get_inode()->ctime, bl); @@ -2154,6 +2154,7 @@ void CInode::encode_lock_ipolicy(bufferlist& bl) encode(get_inode()->flags, bl); encode(get_inode()->export_ephemeral_random_pin, bl); } + encode(get_inode()->flags, bl); ENCODE_FINISH(bl); } @@ -2161,7 +2162,7 @@ void CInode::decode_lock_ipolicy(bufferlist::const_iterator& p) { ceph_assert(!is_auth()); auto _inode = allocate_inode(*get_inode()); - DECODE_START(1, p); + DECODE_START(3, p); if (is_dir()) { decode(_inode->version, p); utime_t tm; @@ -2176,6 +2177,9 @@ void CInode::decode_lock_ipolicy(bufferlist::const_iterator& p) decode(_inode->export_ephemeral_random_pin, p); } } + if (struct_v >= 3) { + decode(_inode->flags, p); + } DECODE_FINISH(p); bool pin_updated = (get_inode()->export_pin != _inode->export_pin) ||