-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/linux: fix errors in dev_loop.txt #3121
Conversation
Codecov Report
|
Sorry that I try to have two merge requests because they are different things but Github directly adds the second commit. |
We can merge 2 unrelated in a single PR as well as long as both commits are good. |
Thanks a lot. I have fixed them. |
sys/linux/dev_loop.txt
Outdated
@@ -22,12 +23,19 @@ resource fd_loop_ctrl[fd] | |||
resource fd_loop_num[intptr]: 0, 1, 2, 10, 11, 12 | |||
openat$loop_ctrl(fd const[AT_FDCWD], file ptr[in, string["/dev/loop-control"]], flags flags[open_flags], mode const[0]) fd_loop_ctrl | |||
ioctl$LOOP_CTL_GET_FREE(fd fd_loop_ctrl, cmd const[LOOP_CTL_GET_FREE]) fd_loop_num | |||
ioctl$LOOP_CTL_ADD(fd fd_loop_ctrl, cmd const[LOOP_CTL_ADD], num fd_loop_num) | |||
ioctl$LOOP_CTL_ADD(fd fd_loop_ctrl, cmd const[LOOP_CTL_ADD], num fd_loop_num) fd_loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not seem to return a loop fd.
It returns i
:
https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/block/loop.c#L2073
which is assigned here:
https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/block/loop.c#L1997
which comes from idr_alloc for loop indices:
https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/block/loop.c#L1988
So it seems to be a loop index rather than a file descriptor.
If you agree, please revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. But I find another question.
I think the return value should be "fd_loop_num", which is the same as "ioctl$LOOP_CTL_GET_FREE()":
https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/block/loop.c#L2186
https://elixir.bootlin.com/linux/v5.18-rc5/source/drivers/block/loop.c#L2175
However, I do not find how the number are decided in "resource fd_loop_num[intptr]: 0, 1, 2, 10, 11, 12".
Not sure whether should we keep those numbers.
You are right. Looks good now.
I don't remember now as well. |
Thanks for the reasons. |
Oh, interesting. We wanted that for a long time (#590). Can you upload them as a PR, or as a commit in your fork? Then it will be easier to asses if/how they can be merged and how they can cohabit with existing descriptions. |
Thanks, and I learn a lot from (#590). I will upload them as a PR directly without any human modifications so that we can know what other automated steps are needed. |
No description provided.