All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/5] Small docparser fixes
@ 2020-12-16 10:10 Cyril Hrubis
  2020-12-16 10:10 ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Cyril Hrubis
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp


Cyril Hrubis (5):
  docparse/docparse: Warn on truncated docstring
  doc_parse/data_storage: Bump the array max size
  docparse/docparse: Eat only first whitespace for comment block
  syscalls/abort: Remove second space before description text
  syscalls/move_pages12: Add one more kernel git hash

 docparse/data_storage.h                       |  2 +-
 docparse/docparse.c                           |  9 ++--
 testcases/kernel/syscalls/abort/abort01.c     |  3 +-
 .../kernel/syscalls/move_pages/move_pages12.c | 52 ++++++++++++-------
 4 files changed, 40 insertions(+), 26 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring
  2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
@ 2020-12-16 10:10 ` Cyril Hrubis
  2020-12-17 15:34   ` Petr Vorel
  2020-12-16 10:10 ` [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size Cyril Hrubis
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 docparse/docparse.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/docparse/docparse.c b/docparse/docparse.c
index 22c5c6f2c..702820757 100644
--- a/docparse/docparse.c
+++ b/docparse/docparse.c
@@ -12,6 +12,8 @@
 
 #include "data_storage.h"
 
+#define WARN(str) fprintf(stderr, "WARNING: " str "\n")
+
 static void oneline_comment(FILE *f)
 {
 	int c;
@@ -52,7 +54,8 @@ static void multiline_comment(FILE *f, struct data_node *doc)
 				struct data_node *line;
 				buf[bufp] = 0;
 				line = data_node_string(eat_asterisk_space(buf));
-				data_node_array_add(doc, line);
+				if (data_node_array_add(doc, line))
+					WARN("doc string comment truncated");
 				bufp = 0;
 				continue;
 			}
@@ -194,8 +197,6 @@ exit:
 	return buf;
 }
 
-#define WARN(str) fprintf(stderr, str "\n")
-
 static int parse_array(FILE *f, struct data_node *node)
 {
 	const char *token;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size
  2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
  2020-12-16 10:10 ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Cyril Hrubis
@ 2020-12-16 10:10 ` Cyril Hrubis
  2020-12-17 15:35   ` Petr Vorel
  2020-12-16 10:10 ` [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block Cyril Hrubis
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp

Bump the array size to 100 from 20 for now. I will rewrite the code to
reallocate the array if needed later on.

At least now we won't have longer description comments cut in half.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 docparse/data_storage.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docparse/data_storage.h b/docparse/data_storage.h
index 1a9265f92..ef420c08f 100644
--- a/docparse/data_storage.h
+++ b/docparse/data_storage.h
@@ -64,7 +64,7 @@ static inline struct data_node *data_node_string(const char *string)
 	return node;
 }
 
-#define MAX_ELEMS 20
+#define MAX_ELEMS 100
 
 static inline struct data_node *data_node_hash(void)
 {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block
  2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
  2020-12-16 10:10 ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Cyril Hrubis
  2020-12-16 10:10 ` [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size Cyril Hrubis
@ 2020-12-16 10:10 ` Cyril Hrubis
  2020-12-17 15:39   ` Petr Vorel
  2020-12-16 10:10 ` [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text Cyril Hrubis
  2020-12-16 10:10 ` [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash Cyril Hrubis
  4 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp

Since we decided that the comment block is formatted in asciidoc we need
the whitespaces since they are part of the format, e.g. literal blocks.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 docparse/docparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docparse/docparse.c b/docparse/docparse.c
index 702820757..9f617c8bb 100644
--- a/docparse/docparse.c
+++ b/docparse/docparse.c
@@ -31,7 +31,7 @@ static const char *eat_asterisk_space(const char *c)
 		i++;
 
 	if (c[i] == '*') {
-		while (isspace(c[i+1]))
+		if (isspace(c[i+1]))
 			i++;
 		return &c[i+1];
 	}
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text
  2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
                   ` (2 preceding siblings ...)
  2020-12-16 10:10 ` [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block Cyril Hrubis
@ 2020-12-16 10:10 ` Cyril Hrubis
  2020-12-17 15:40   ` Petr Vorel
  2020-12-16 10:10 ` [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash Cyril Hrubis
  4 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp

This seems to be the only case where the change to remove only first
whitespace cause the test description to produce literal block
unexpectedly.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/abort/abort01.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/abort/abort01.c b/testcases/kernel/syscalls/abort/abort01.c
index b93324b34..ba89cc524 100644
--- a/testcases/kernel/syscalls/abort/abort01.c
+++ b/testcases/kernel/syscalls/abort/abort01.c
@@ -9,7 +9,8 @@
 
 /*\
  * [DESCRIPTION]
- *  Checks that process which called abort() gets killed by SIGIOT and dumps core.
+ *
+ * Checks that process which called abort() gets killed by SIGIOT and dumps core.
  *
  * [ALGORITHM]
  *  - Fork child.
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash
  2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
                   ` (3 preceding siblings ...)
  2020-12-16 10:10 ` [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text Cyril Hrubis
@ 2020-12-16 10:10 ` Cyril Hrubis
  2020-12-17 15:42   ` Petr Vorel
  4 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2020-12-16 10:10 UTC (permalink / raw)
  To: ltp

+ Reformat the comment to asciidoc

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 .../kernel/syscalls/move_pages/move_pages12.c | 52 ++++++++++++-------
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/testcases/kernel/syscalls/move_pages/move_pages12.c b/testcases/kernel/syscalls/move_pages/move_pages12.c
index c906acbe3..d209426c7 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages12.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages12.c
@@ -7,16 +7,17 @@
  *  Ported: Yang Xu <xuyang2018.jy@cn.jujitsu.com>
  */
 
-/*
- * Description:
+/*\
+ * [DESCRIPTION]
+ *
+ * *Test 1*
  *
- * Test #1:
- *  This is a regression test for the race condition between move_pages()
- *  and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
- *  for hugepages internally and tries to get its refcount without
- *  preventing concurrent freeing.
+ * This is a regression test for the race condition between move_pages()
+ * and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
+ * for hugepages internally and tries to get its refcount without
+ * preventing concurrent freeing.
  *
- *  This test can crash the buggy kernel, and the bug was fixed in:
+ * This test can crash the buggy kernel, and the bug was fixed in:
  *
  *   commit e66f17ff71772b209eed39de35aaa99ba819c93d
  *   Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
@@ -24,25 +25,25 @@
  *
  *   mm/hugetlb: take page table lock in follow_huge_pmd()
  *
- *  Test #2:
- *   #2.1:
- *   This is a regression test for the race condition, where move_pages()
- *   and soft offline are called on a single hugetlb page concurrently.
+ * *Test 2.1*
  *
- *   This bug can crash the buggy kernel, and was fixed by:
+ * This is a regression test for the race condition, where move_pages()
+ * and soft offline are called on a single hugetlb page concurrently.
+ *
+ * This test can crash the buggy kernel, and was fixed by:
  *
  *   commit c9d398fa237882ea07167e23bcfc5e6847066518
  *   Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
  *   Date:   Fri Mar 31 15:11:55 2017 -0700
  *
- *   mm, hugetlb: use pte_present() instead of pmd_present() in
- *   follow_huge_pmd()
+ *   mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
+ *
+ * *Test 2.2*
  *
- *   #2.2:
- *   This is also a regression test for an race condition causing SIGBUS
- *   in hugepage migration/fault.
+ * This is also a regression test for an race condition causing SIGBUS
+ * in hugepage migration/fault.
  *
- *   This bug was fixed by:
+ * This bug was fixed by:
  *
  *   commit 4643d67e8cb0b3536ef0ab5cddd1cedc73fa14ad
  *   Author: Mike Kravetz <mike.kravetz@oracle.com>
@@ -50,7 +51,17 @@
  *
  *   hugetlbfs: fix hugetlb page migration/fault race causing SIGBUS
  *
- */
+ * *Test 2.3*
+ *
+ * The madvise() in the do_soft_online() was also triggering cases where soft
+ * online returned EIO when page migration failed, which was fixed in:
+ *
+ *    commit 3f4b815a439adfb8f238335612c4b28bc10084d8
+ *    Author: Oscar Salvador <osalvador@suse.de>
+ *    Date:   Mon Dec 14 19:11:51 2020 -0800
+ *
+ *    mm,hwpoison: return -EBUSY when migration fails
+\*/
 
 #include <errno.h>
 #include <unistd.h>
@@ -334,6 +345,7 @@ static struct tst_test test = {
 		{"linux-git", "e66f17ff7177"},
 		{"linux-git", "c9d398fa2378"},
 		{"linux-git", "4643d67e8cb0"},
+		{"linux-git", "3f4b815a439a"},
 		{}
 	}
 };
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring
  2020-12-16 10:10 ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Cyril Hrubis
@ 2020-12-17 15:34   ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-12-17 15:34 UTC (permalink / raw)
  To: ltp

Reviewed-by: Petr Vorel <pvorel@suse.cz>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size
  2020-12-16 10:10 ` [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size Cyril Hrubis
@ 2020-12-17 15:35   ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-12-17 15:35 UTC (permalink / raw)
  To: ltp

> Bump the array size to 100 from 20 for now. I will rewrite the code to
> reallocate the array if needed later on.

> At least now we won't have longer description comments cut in half.
+1

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block
  2020-12-16 10:10 ` [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block Cyril Hrubis
@ 2020-12-17 15:39   ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-12-17 15:39 UTC (permalink / raw)
  To: ltp

> Since we decided that the comment block is formatted in asciidoc we need
> the whitespaces since they are part of the format, e.g. literal blocks.
Makes sense.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text
  2020-12-16 10:10 ` [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text Cyril Hrubis
@ 2020-12-17 15:40   ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2020-12-17 15:40 UTC (permalink / raw)
  To: ltp

> This seems to be the only case where the change to remove only first
> whitespace cause the test description to produce literal block
> unexpectedly.
Hopefully :).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash
  2020-12-16 10:10 ` [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash Cyril Hrubis
@ 2020-12-17 15:42   ` Petr Vorel
  2021-01-05 13:08     ` Cyril Hrubis
  0 siblings, 1 reply; 13+ messages in thread
From: Petr Vorel @ 2020-12-17 15:42 UTC (permalink / raw)
  To: ltp

> + Reformat the comment to asciidoc
Thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> -/*
> - * Description:
> +/*\
> + * [DESCRIPTION]
> + *
> + * *Test 1*
>   *
> - * Test #1:
> - *  This is a regression test for the race condition between move_pages()
> - *  and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> - *  for hugepages internally and tries to get its refcount without
> - *  preventing concurrent freeing.
> + * This is a regression test for the race condition between move_pages()
> + * and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> + * for hugepages internally and tries to get its refcount without
> + * preventing concurrent freeing.
>   *
> - *  This test can crash the buggy kernel, and the bug was fixed in:
> + * This test can crash the buggy kernel, and the bug was fixed in:
>   *
>   *   commit e66f17ff71772b209eed39de35aaa99ba819c93d
>   *   Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

I wonder if we should format "commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" as
link to Linus' tree (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX).


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash
  2020-12-17 15:42   ` Petr Vorel
@ 2021-01-05 13:08     ` Cyril Hrubis
  2021-01-05 18:16       ` Petr Vorel
  0 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2021-01-05 13:08 UTC (permalink / raw)
  To: ltp

Hi!
> Reviewed-by: Petr Vorel <pvorel@suse.cz>

Patchset pushed, thanks for the review.

> ...
> > -/*
> > - * Description:
> > +/*\
> > + * [DESCRIPTION]
> > + *
> > + * *Test 1*
> >   *
> > - * Test #1:
> > - *  This is a regression test for the race condition between move_pages()
> > - *  and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> > - *  for hugepages internally and tries to get its refcount without
> > - *  preventing concurrent freeing.
> > + * This is a regression test for the race condition between move_pages()
> > + * and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> > + * for hugepages internally and tries to get its refcount without
> > + * preventing concurrent freeing.
> >   *
> > - *  This test can crash the buggy kernel, and the bug was fixed in:
> > + * This test can crash the buggy kernel, and the bug was fixed in:
> >   *
> >   *   commit e66f17ff71772b209eed39de35aaa99ba819c93d
> >   *   Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> 
> I wonder if we should format "commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" as
> link to Linus' tree (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX).

Well we do have links in the tags anyways so I think that it's a bit
more readable as it is.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash
  2021-01-05 13:08     ` Cyril Hrubis
@ 2021-01-05 18:16       ` Petr Vorel
  0 siblings, 0 replies; 13+ messages in thread
From: Petr Vorel @ 2021-01-05 18:16 UTC (permalink / raw)
  To: ltp

Hi Cyril,

> Hi!
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Patchset pushed, thanks for the review.
Great, thanks!

> > ...
> > > -/*
> > > - * Description:
> > > +/*\
> > > + * [DESCRIPTION]
> > > + *
> > > + * *Test 1*
> > >   *
> > > - * Test #1:
> > > - *  This is a regression test for the race condition between move_pages()
> > > - *  and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> > > - *  for hugepages internally and tries to get its refcount without
> > > - *  preventing concurrent freeing.
> > > + * This is a regression test for the race condition between move_pages()
> > > + * and freeing hugepages, where move_pages() calls follow_page(FOLL_GET)
> > > + * for hugepages internally and tries to get its refcount without
> > > + * preventing concurrent freeing.
> > >   *
> > > - *  This test can crash the buggy kernel, and the bug was fixed in:
> > > + * This test can crash the buggy kernel, and the bug was fixed in:
> > >   *
> > >   *   commit e66f17ff71772b209eed39de35aaa99ba819c93d
> > >   *   Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

> > I wonder if we should format "commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" as
> > link to Linus' tree (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX).

> Well we do have links in the tags anyways so I think that it's a bit
> more readable as it is.

I meant in the output (pdf, html) the text would be the same but become link to
Linus' tree (instead of being a plain text).

But that's really minor.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-05 18:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
2020-12-16 10:10 ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Cyril Hrubis
2020-12-17 15:34   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size Cyril Hrubis
2020-12-17 15:35   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block Cyril Hrubis
2020-12-17 15:39   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text Cyril Hrubis
2020-12-17 15:40   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash Cyril Hrubis
2020-12-17 15:42   ` Petr Vorel
2021-01-05 13:08     ` Cyril Hrubis
2021-01-05 18:16       ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.