Skip to content

Use test_bit for RPC_PRIVATE in homa_rpc_get_info - #139

Open
randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/rpc-get-info-private-flag
Open

randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/rpc-get-info-private-flag

Conversation

@randomizedcoder

Copy link
Copy Markdown
Contributor

RPC_PRIVATE is a bit number (2), set with set_bit and read with test_bit everywhere else, but homa_rpc_get_info used it as a mask, i.e. tested bit 1 (APP_NEEDS_LOCK). HOMAIOCINFO never reported HOMA_RPC_PRIVATE for private RPCs, and reported it while the application was asking for the RPC lock.

  • Fix: test_bit(RPC_PRIVATE, &rpc->flags).
  • Test: the existing homa_rpc_get_info__HOMA_RPC_PRIVATE set the flag with |=, which hid the bug; it now uses set_bit. New homa_rpc_get_info__APP_NEEDS_LOCK_is_not_private.
  • Found by reading the code.

Verified: the new test fails before the fix and passes after; full unit suite 885/885 in both IPv6 and --ipv4 modes; homa.ko compiles warning-free on 7.3, normal and __STRIP__=1; checkpatch clean.

🤖 Generated with Claude Code

* RPC_PRIVATE is a bit number (2), set with set_bit, but
  homa_rpc_get_info tested it as a mask, which checks bit 1
  (APP_NEEDS_LOCK). HOMAIOCINFO therefore never reported
  HOMA_RPC_PRIVATE for private RPCs, and reported it for RPCs whose
  lock was being requested by the application.
* The existing test set the flag with |=, which hid the bug; use
  set_bit and add a test that APP_NEEDS_LOCK alone isn't reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant