Skip to content

os/bluestore: fix unused function warnings in bluefs_types#55428

Closed
jamiepryde wants to merge 1 commit intoceph:mainfrom
jamiepryde:62850-unused-functions
Closed

os/bluestore: fix unused function warnings in bluefs_types#55428
jamiepryde wants to merge 1 commit intoceph:mainfrom
jamiepryde:62850-unused-functions

Conversation

@jamiepryde
Copy link
Contributor

Fixes: https://tracker.ceph.com/issues/62850

I have run ninja osd to confirm that osd builds, and that the compiler warnings are no longer present.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@jamiepryde jamiepryde requested a review from a team as a code owner February 2, 2024 15:51
op_bl.claim_append(from.op_bl);
}

DENC_HELPERS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the compiler warning is a signal that we are not using the DENC macro for defining the dencoders of bluefs_transaction_t. in fact, bluefs_transaction_t defines its own dencoders manually without relying on DENC. what DENC_HELPERS provides to this class is but

   static void _denc_start(size_t& p,                                    \
                           __u8 *struct_v,                               \
                           __u8 *struct_compat,                          \
                           char **, uint32_t *) {                        \
     p += 2 + 4;                                                         \
   }                                                                     \

for calculating the size of the header of the serialized bluefs_transaction_t. and DENC_FINISH() here is a noop.

so i'd suggest apply following patch

diff --git a/src/os/bluestore/bluefs_types.cc b/src/os/bluestore/bluefs_types.cc
index ff9c96ab660..a17c3bc8a3c 100644
--- a/src/os/bluestore/bluefs_types.cc
+++ b/src/os/bluestore/bluefs_types.cc
@@ -228,10 +228,10 @@ std::ostream& operator<<(std::ostream& out, const bluefs_fnode_delta_t& delta)

 // bluefs_transaction_t

-DENC_HELPERS
 void bluefs_transaction_t::bound_encode(size_t &s) const {
   uint32_t crc = op_bl.crc32c(-1);
-  DENC_START(1, 1, s);
+  // struct_v, struct_compat, and len
+  s += 2 + 4;
   denc(uuid, s);
   denc_varint(seq, s);
   // not using bufferlist encode method, as it merely copies the bufferptr and not
@@ -242,7 +242,6 @@ void bluefs_transaction_t::bound_encode(size_t &s) const {
     s += it.length();
   }
   denc(crc, s);
-  DENC_FINISH(s);
 }

 void bluefs_transaction_t::encode(bufferlist& bl) const

instead of using DENC_HELPERS for a single line code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley hi Casey, i am adding you as a reviewer. as you also tried to address this issue in #54816

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the macro should qualify the helper functions with [[maybe_unused]]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both for reviewing, I have applied your suggested patch @tchaikov .

@tchaikov tchaikov requested a review from cbodley February 4, 2024 04:09
@jamiepryde jamiepryde force-pushed the 62850-unused-functions branch from 124a37f to 9fc47f8 Compare February 5, 2024 21:49
@jamiepryde jamiepryde changed the title os/bluestore: move macro to header file to avoid compiler warnings os/bluestore: fix unused function warnings in bluefs_types Feb 5, 2024
@jamiepryde jamiepryde requested a review from tchaikov February 5, 2024 21:52
@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2024

249/290 Test #236: unittest_rbd_mirror .......................***Exception: SegFault188.74 sec

i cannot find it on tracker. after searching with "unittest_rbd_mirror".

@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2024

jenkins test make check

@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2024

 > git fetch --tags --force --progress --depth=1 -- https://github.com/ceph/ceph.git +refs/pull/55428/*:refs/remotes/origin/pr/55428/* # timeout=20
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --depth=1 -- https://github.com/ceph/ceph.git +refs/pull/55428/*:refs/remotes/origin/pr/55428/*" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://github.com/ceph/ceph.git/': Could not resolve host: github.com

infra issues.

@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2024

jenkins test make check

@tchaikov
Copy link
Contributor

tchaikov commented Feb 9, 2024

flaky test, see https://tracker.ceph.com/issues/62934

@tchaikov
Copy link
Contributor

tchaikov commented Feb 9, 2024

jenkins test make check

@tchaikov
Copy link
Contributor

yet another flaky test:

WARNING: debug mode. Not for benchmarking or production
WARN  2024-02-09 03:15:49,957 seastar - Seastar compiled with default allocator, --memory option won't take effect
INFO  2024-02-09 03:15:49,958 seastar - Reactor backend: linux-aio
INFO  2024-02-09 03:15:49,959 seastar - Perf-based stall detector creation failed (EACCESS), try setting /proc/sys/kernel/perf_event_paranoid to 1 or less to enable kernel backtraces: falling back to posix timer.
Reactor stalled for 68 ms on shard 0. Backtrace: 0x262632a 0x3802bb4 0x380208c 0x35f1843 0x35ebe3f 0x35eb8e7 0x35ec2c8 0x35f2e0a 0x4251f 0x2d54a50 0x2d540d7 0x2d7cae3 0x2d89c7d 0x2d899c2 0x2d03238 0x2cb18b2 0x2caf9f2 0x3056001 0x288c422 0x288c008 0x288bd27 0x288ba4b 0x288b8ea 0x288b6ff 0x288b3df 0x288b183 0x288abc7 0x288a919 0x288a14f 0x2889941 0x28894e8 0x2889049 0x2888d92 0x2888b17 0x2887877 0x3ada801 0x3ada496 0x3ada367 0x3ad9cca 0x3ad96c2 0x3adaa05 0x3ad98af 0x3ad9324 0x3ad905f 0x288206e 0x2860656 0x26aaed3 0x285e272 0x285e15f 0x285dfdf 0x285dbdf 0x33d1104 0x33d0eb3 0x33d0abf 0x33876a7 0x33872fc 0x33871ac 0x3386bcc 0x33dd161 0x33dcf1f 0x33dceaf 0x33dcdfd 0x33dcc1b 0x28d754b 0x28d73cf 0x28d731f 0x28d720f 0x28d7003 0x28d6f4c 0x28d6cdc 0x28d6ad6 0x28d65ea 0x36167ed 0x362419e 0x362a27b 0x3627e0d 0x3383e12 0x3381286 0x26ad625 0x29d8f 0x29e3f 0x25ea7f4
INFO  2024-02-09 03:15:50,122 [shard 0:main] test - test_refused()...
INFO  2024-02-09 03:15:50,122 [shard 0:main] test - test_refused() ok

INFO  2024-02-09 03:15:50,123 [shard 0:main] test - test_bind_same()...
INFO  2024-02-09 03:15:50,126 [shard 0:main] test - test_bind_same() ok

INFO  2024-02-09 03:15:50,128 [shard 0:main] test - test_accept()
INFO  2024-02-09 03:15:50,130 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,130 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,131 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,184 [shard 0:main] test - test_accept() ok

INFO  2024-02-09 03:15:50,233 [shard 0:main] test - test_read_write()...
INFO  2024-02-09 03:15:50,235 [shard 1:main] test - dispatch_sockets(): accepted at shard 1
INFO  2024-02-09 03:15:50,370 [shard 0:main] test - test_read_write() ok

INFO  2024-02-09 03:15:50,370 [shard 0:main] test - test_unexpected_down()...
INFO  2024-02-09 03:15:50,379 [shard 1:main] test - dispatch_sockets(): accepted at shard 1
ERROR 2024-02-09 03:15:50,527 [shard 0:main] none - /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/crimson/test_socket.cc:453 : In function 'auto (anonymous namespace)::test_unexpected_down(bool)::(anonymous class)::operator()(crimson::net::Socket *)::(anonymous class)::operator()(const std::system_error &) const', ceph_assert(%s)
e.code() == error::read_eof
Aborting on shard 0.
Backtrace:
  0x262632a
  0x3802294
  0x3801eb3
  0x35f17d9
  0x362bd85
  0x374e949
  0x374eb7e
  0x374e9ca
  /lib/x86_64-linux-gnu/libc.so.6+0x4251f
  /lib/x86_64-linux-gnu/libc.so.6+0x96a7b
  /lib/x86_64-linux-gnu/libc.so.6+0x42475
  /lib/x86_64-linux-gnu/libc.so.6+0x287f2
  0x303b047
  0x303aadd
  0x278b032
  0x278ab95
  0x278aac0
  0x278a9ac
  0x278a6b9
  0x278a5e1
  0x278a50e
  0x289d133
  0x289cc0b
  0x289c61c
  0x289c3a7
  0x289bbfa
  0x36167ed
  0x362419e
  0x362a27b
  0x3627e0d
  0x3383e12
  0x3381286
  0x26ad625
  /lib/x86_64-linux-gnu/libc.so.6+0x29d8f
  /lib/x86_64-linux-gnu/libc.so.6+0x29e3f
  0x25ea7f4
Standard Output

WARNING: debug mode. Not for benchmarking or production
WARN  2024-02-09 03:15:49,957 seastar - Seastar compiled with default allocator, --memory option won't take effect
INFO  2024-02-09 03:15:49,958 seastar - Reactor backend: linux-aio
INFO  2024-02-09 03:15:49,959 seastar - Perf-based stall detector creation failed (EACCESS), try setting /proc/sys/kernel/perf_event_paranoid to 1 or less to enable kernel backtraces: falling back to posix timer.
Reactor stalled for 68 ms on shard 0. Backtrace: 0x262632a 0x3802bb4 0x380208c 0x35f1843 0x35ebe3f 0x35eb8e7 0x35ec2c8 0x35f2e0a 0x4251f 0x2d54a50 0x2d540d7 0x2d7cae3 0x2d89c7d 0x2d899c2 0x2d03238 0x2cb18b2 0x2caf9f2 0x3056001 0x288c422 0x288c008 0x288bd27 0x288ba4b 0x288b8ea 0x288b6ff 0x288b3df 0x288b183 0x288abc7 0x288a919 0x288a14f 0x2889941 0x28894e8 0x2889049 0x2888d92 0x2888b17 0x2887877 0x3ada801 0x3ada496 0x3ada367 0x3ad9cca 0x3ad96c2 0x3adaa05 0x3ad98af 0x3ad9324 0x3ad905f 0x288206e 0x2860656 0x26aaed3 0x285e272 0x285e15f 0x285dfdf 0x285dbdf 0x33d1104 0x33d0eb3 0x33d0abf 0x33876a7 0x33872fc 0x33871ac 0x3386bcc 0x33dd161 0x33dcf1f 0x33dceaf 0x33dcdfd 0x33dcc1b 0x28d754b 0x28d73cf 0x28d731f 0x28d720f 0x28d7003 0x28d6f4c 0x28d6cdc 0x28d6ad6 0x28d65ea 0x36167ed 0x362419e 0x362a27b 0x3627e0d 0x3383e12 0x3381286 0x26ad625 0x29d8f 0x29e3f 0x25ea7f4
INFO  2024-02-09 03:15:50,122 [shard 0:main] test - test_refused()...
INFO  2024-02-09 03:15:50,122 [shard 0:main] test - test_refused() ok

INFO  2024-02-09 03:15:50,123 [shard 0:main] test - test_bind_same()...
INFO  2024-02-09 03:15:50,126 [shard 0:main] test - test_bind_same() ok

INFO  2024-02-09 03:15:50,128 [shard 0:main] test - test_accept()
INFO  2024-02-09 03:15:50,130 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,130 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,131 [shard 0:main] test - test_accept(): accepted at shard 0
INFO  2024-02-09 03:15:50,184 [shard 0:main] test - test_accept() ok

INFO  2024-02-09 03:15:50,233 [shard 0:main] test - test_read_write()...
INFO  2024-02-09 03:15:50,235 [shard 1:main] test - dispatch_sockets(): accepted at shard 1
INFO  2024-02-09 03:15:50,370 [shard 0:main] test - test_read_write() ok

INFO  2024-02-09 03:15:50,370 [shard 0:main] test - test_unexpected_down()...
INFO  2024-02-09 03:15:50,379 [shard 1:main] test - dispatch_sockets(): accepted at shard 1
ERROR 2024-02-09 03:15:50,527 [shard 0:main] none - /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/crimson/test_socket.cc:453 : In function 'auto (anonymous namespace)::test_unexpected_down(bool)::(anonymous class)::operator()(crimson::net::Socket *)::(anonymous class)::operator()(const std::system_error &) const', ceph_assert(%s)
e.code() == error::read_eof
Aborting on shard 0.
Backtrace:
  0x262632a
  0x3802294
  0x3801eb3
  0x35f17d9
  0x362bd85
  0x374e949
  0x374eb7e
  0x374e9ca
  /lib/x86_64-linux-gnu/libc.so.6+0x4251f
  /lib/x86_64-linux-gnu/libc.so.6+0x96a7b
  /lib/x86_64-linux-gnu/libc.so.6+0x42475
  /lib/x86_64-linux-gnu/libc.so.6+0x287f2
  0x303b047
  0x303aadd
  0x278b032
  0x278ab95
  0x278aac0
  0x278a9ac
  0x278a6b9
  0x278a5e1
  0x278a50e
  0x289d133
  0x289cc0b
  0x289c61c
  0x289c3a7
  0x289bbfa
  0x36167ed
  0x362419e
  0x362a27b
  0x3627e0d
  0x3383e12
  0x3381286
  0x26ad625
  /lib/x86_64-linux-gnu/libc.so.6+0x29d8f
  /lib/x86_64-linux-gnu/libc.so.6+0x29e3f
  0x25ea7f4

@tchaikov
Copy link
Contributor

jenkins test make check

@tchaikov
Copy link
Contributor

jenkins test api

@jamiepryde
Copy link
Contributor Author

jenkins test windows

@aclamk aclamk self-requested a review February 20, 2024 14:49
@jamiepryde
Copy link
Contributor Author

@tchaikov Hi, can we merge this change now? Thanks

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tchaikov
Copy link
Contributor

@tchaikov Hi, can we merge this change now? Thanks

better off running it against the teuthology tests

uint32_t crc = op_bl.crc32c(-1);
DENC_START(1, 1, s);
// struct_v, struct_compat, and len
s += 2 + 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 1 + 1 + 4 ?

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@NitzanMordhai
Copy link
Contributor

@yuriw
Copy link
Contributor

yuriw commented Mar 20, 2024

@jamiepryde pls rebase and merge
ref: https://trello.com/c/D8hvbaRe

@jamiepryde
Copy link
Contributor Author

@yuriw I think we can abandon this PR. Adam merged an improved version of the change in #55872. Thanks.

@jamiepryde jamiepryde closed this Mar 21, 2024
@jamiepryde jamiepryde deleted the 62850-unused-functions branch July 10, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants