Skip to content

Conversation

@Donny9
Copy link
Contributor

@Donny9 Donny9 commented Dec 30, 2025

Summary

The 'created' flag values were incorrectly inverted in file_mq_vopen():

  1. When opening an existing message queue (inode_find succeeds):

    • Before: incorrectly set *created = 1 (indicating new creation)
    • After: correctly set *created = 0 (indicating existing queue)
  2. When creating a new message queue (inode_find fails):

    • Before: incorrectly set *created = 0 (indicating existing queue)
    • After: correctly set *created = 1 (indicating new creation)

This bug could lead to incorrect resource management and cleanup behavior in the calling function nxmq_vopen() when file_allocate() returns an error, as it relies on the 'created' flag to determine whether the message queue was newly created and needs to be cleaned up.

Impact

  • Resource leak when opening existing queues that should not be released
  • Missing cleanup when creating new queues that should be released on error
    Update this section with information on why change is necessary,
    what it exactly does and how, if new feature shows up, provide
    references (dependencies, similar problems and solutions), etc.

Testing

  ltp_interfaces_mq_open_11_1
  ltp_interfaces_mq_open_1_1
  ltp_interfaces_mq_open_12_1
  ltp_interfaces_mq_open_13_1
  ltp_interfaces_mq_open_15_1
  ltp_interfaces_mq_open_16_1
  ltp_interfaces_mq_open_18_1
  ltp_interfaces_mq_open_19_1
  ltp_interfaces_mq_open_20_1
  ltp_interfaces_mq_open_21_1
  ltp_interfaces_mq_open_2_1
  ltp_interfaces_mq_open_23_1
  ltp_interfaces_mq_open_25_2
  ltp_interfaces_mq_open_27_1
  ltp_interfaces_mq_open_27_2
  ltp_interfaces_mq_open_29_1
  ltp_interfaces_mq_open_3_1
  ltp_interfaces_mq_open_7_1
  ltp_interfaces_mq_open_7_2
  ltp_interfaces_mq_open_7_3
  ltp_interfaces_mq_open_8_1
  ltp_interfaces_mq_open_8_2
  ltp_interfaces_mq_open_9_1

The 'created' flag values were incorrectly inverted in file_mq_vopen():

1. When opening an existing message queue (inode_find succeeds):
   - Before: incorrectly set *created = 1 (indicating new creation)
   - After: correctly set *created = 0 (indicating existing queue)

2. When creating a new message queue (inode_find fails):
   - Before: incorrectly set *created = 0 (indicating existing queue)
   - After: correctly set *created = 1 (indicating new creation)

This bug could lead to incorrect resource management and cleanup behavior
in the calling function nxmq_vopen() when file_allocate() returns an error,
as it relies on the 'created' flag to determine whether the message queue
was newly created and needs to be cleaned up.

Impact:
- Resource leak when opening existing queues that should not be released
- Missing cleanup when creating new queues that should be released on error

Signed-off-by: dongjiuzhu1 <[email protected]>
@github-actions github-actions bot added Area: File System File System issues Size: XS The size of the change in this PR is very small labels Dec 30, 2025
@Donny9
Copy link
Contributor Author

Donny9 commented Dec 30, 2025

image Please retrigger ci,What kind of error is this? Have you ever seen it? @acassis

@acassis
Copy link
Contributor

acassis commented Dec 30, 2025

@Donny9 I just restart the Failed Jobs, since you are a Committer I think you also have access to restart it:

image

@Donny9
Copy link
Contributor Author

Donny9 commented Dec 30, 2025

@Donny9 I just restart the Failed Jobs, since you are a Committer I think you also have access to restart it:

image

Thanks you @acassis

@xiaoxiang781216 xiaoxiang781216 merged commit 1b6733c into apache:master Dec 30, 2025
50 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: File System File System issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants