Skip to contentSkip to conversation

fork13: Fix the doc

PATCH Superseded Ma Xinjian via ltp 2 participants 4 messages Feb 18, 2025 – Feb 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fork13: Fix the doc

Previously, the use of "-" would cause "Race Description" to be misinterpreted as a subsection. Add a blank line to avoid it and use :: to keep the description as origin text.

---
 testcases/kernel/syscalls/fork/fork13.c | 27 +++++++++++++------------
 1 file changed, 14 insertions(+), 13 deletions(-)
testcases/kernel/syscalls/fork/fork13.c +14 -13
index 3da698e33..9e07c9d4f 100644
@@ -15,21 +15,22 @@
  * implementation.  Furthermore, many shell scripts assume that pid
  * numbers will not be used for some length of time.
  *
- * [Race Description]
- * ---------------------------------------------------------------------
- * A                                B
+ * **Race Description** ::
  *
- * // pid == offset == n            // pid == offset == n + 1
- * test_and_set_bit(offset, map->page)
- *                                  test_and_set_bit(offset, map->page);
- *                                  pid_ns->last_pid = pid;
- * pid_ns->last_pid = pid;
- *                                  // pid == n + 1 is freed (wait())
+ *    ---------------------------------------------------------------------
+ *    A                                B
  *
- *                                  // Next fork()...
- *                                  last = pid_ns->last_pid; // == n
- *                                  pid = last + 1;
- * ---------------------------------------------------------------------
+ *    // pid == offset == n            // pid == offset == n + 1
+ *    test_and_set_bit(offset, map->page)
+ *                                     test_and_set_bit(offset, map->page);
+ *                                     pid_ns->last_pid = pid;
+ *    pid_ns->last_pid = pid;
+ *                                     // pid == n + 1 is freed (wait())
+ *
+ *                                     // Next fork()...
+ *                                     last = pid_ns->last_pid; // == n
+ *                                     pid = last + 1;
+ *    ---------------------------------------------------------------------
  */
 
 #include <sys/types.h>
Signature · 5 lines
2.47.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Ma Xinjian,

Quoted 1 line

Previously, the use of "-" would cause "Race Description" to be misinterpreted as a subsection.

This is meant to be a subsection, see patchset I yesterday forgot to sent, therefore send it now:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Quoted 12 lines

Add a blank line to avoid it and use :: to keep the description as origin text.

---
 testcases/kernel/syscalls/fork/fork13.c | 27 +++++++++++++------------
 1 file changed, 14 insertions(+), 13 deletions(-)
testcases/kernel/syscalls/fork/fork13.c +0 -0
index 3da698e33..9e07c9d4f 100644

testcases/kernel/syscalls/fork/fork13.c line 18

Quoted 4 lines
testcases/kernel/syscalls/fork/fork13.c +0 -1
@@ -15,21 +15,22 @@
  * implementation.  Furthermore, many shell scripts assume that pid
  * numbers will not be used for some length of time.
  *
- * [Race Description]

That's why "[Race Description]" should stay. The rest of code formatting looks good, could you please resent?

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

PATCH v2 1/1 fork13: Fix the doc

Use :: to keep the race description as original text when viewed in RST format.

---
 testcases/kernel/syscalls/fork/fork13.c | 27 +++++++++++++------------
 1 file changed, 14 insertions(+), 13 deletions(-)
testcases/kernel/syscalls/fork/fork13.c +14 -13
index 3da698e33..add8fc77e 100644
@@ -15,21 +15,22 @@
  * implementation.  Furthermore, many shell scripts assume that pid
  * numbers will not be used for some length of time.
  *
- * [Race Description]
- * ---------------------------------------------------------------------
- * A                                B
+ * [Race Description] ::
  *
- * // pid == offset == n            // pid == offset == n + 1
- * test_and_set_bit(offset, map->page)
- *                                  test_and_set_bit(offset, map->page);
- *                                  pid_ns->last_pid = pid;
- * pid_ns->last_pid = pid;
- *                                  // pid == n + 1 is freed (wait())
+ *    ---------------------------------------------------------------------
+ *    A                                B
  *
- *                                  // Next fork()...
- *                                  last = pid_ns->last_pid; // == n
- *                                  pid = last + 1;
- * ---------------------------------------------------------------------
+ *    // pid == offset == n            // pid == offset == n + 1
+ *    test_and_set_bit(offset, map->page)
+ *                                     test_and_set_bit(offset, map->page);
+ *                                     pid_ns->last_pid = pid;
+ *    pid_ns->last_pid = pid;
+ *                                     // pid == n + 1 is freed (wait())
+ *
+ *                                     // Next fork()...
+ *                                     last = pid_ns->last_pid; // == n
+ *                                     pid = last + 1;
+ *    ---------------------------------------------------------------------
  */
 
 #include <sys/types.h>
Signature · 5 lines
2.47.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Ma Xinjian,

...

Quoted 7 lines

+++ b/testcases/kernel/syscalls/fork/fork13.c

testcases/kernel/syscalls/fork/fork13.c +0 -2
@@ -15,21 +15,22 @@
  * implementation.  Furthermore, many shell scripts assume that pid
  * numbers will not be used for some length of time.
  *
- * [Race Description]
- * ---------------------------------------------------------------------

testcases/kernel/syscalls/fork/fork13.c line 20

Quoted 10 lines
testcases/kernel/syscalls/fork/fork13.c +2 -7
- * A                                B
+ * [Race Description] ::
  *
- * // pid == offset == n            // pid == offset == n + 1
- * test_and_set_bit(offset, map->page)
- *                                  test_and_set_bit(offset, map->page);
- *                                  pid_ns->last_pid = pid;
- * pid_ns->last_pid = pid;
- *                                  // pid == n + 1 is freed (wait())
+ *    ---------------------------------------------------------------------

I removed these --- lines (they were for asciidoc code formatting).

testcases/kernel/syscalls/fork/fork13.c line 24

Quoted 8 lines
testcases/kernel/syscalls/fork/fork13.c +3 -4
+ *    A                                B
  *
- *                                  // Next fork()...
- *                                  last = pid_ns->last_pid; // == n
- *                                  pid = last + 1;
- * ---------------------------------------------------------------------
+ *    // pid == offset == n            // pid == offset == n + 1
+ *    test_and_set_bit(offset, map->page)

And increase indent on the right side.

Thanks, merged!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp