public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] link03: Convert docs to docparse
@ 2023-10-11 10:55 Yang Xu
  2023-10-11 10:55 ` [LTP] [PATCH 2/3] link05: " Yang Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Yang Xu @ 2023-10-11 10:55 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
 1 file changed, 7 insertions(+), 34 deletions(-)

diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
index 1f45240ae..27f8a4efe 100644
--- a/testcases/kernel/syscalls/link/link03.c
+++ b/testcases/kernel/syscalls/link/link03.c
@@ -1,42 +1,15 @@
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *  AUTHOR		: Richard Logan
- *  CO-PILOT		: William Roske
+ * AUTHOR		: Richard Logan
+ * CO-PILOT		: William Roske
  * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
  */
 
- /*
-  * Tests that link(2) succeds with creating n links.
-  */
+/*\
+ * [Description]
+ *
+ * Tests that link(2) succeds with creating n links.
+ */
 
 #include <sys/types.h>
 #include <fcntl.h>
-- 
2.39.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH 2/3] link05: Convert docs to docparse
  2023-10-11 10:55 [LTP] [PATCH 1/3] link03: Convert docs to docparse Yang Xu
@ 2023-10-11 10:55 ` Yang Xu
  2023-10-12 10:08   ` Petr Vorel
  2023-10-11 10:55 ` [LTP] [PATCH 3/3] link08: " Yang Xu
  2023-10-12  9:55 ` [LTP] [PATCH 1/3] link03: " Petr Vorel
  2 siblings, 1 reply; 16+ messages in thread
From: Yang Xu @ 2023-10-11 10:55 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/link/link05.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/link/link05.c b/testcases/kernel/syscalls/link/link05.c
index 95787ec24..1e75cfc30 100644
--- a/testcases/kernel/syscalls/link/link05.c
+++ b/testcases/kernel/syscalls/link/link05.c
@@ -1,12 +1,14 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *  AUTHOR		: Richard Logan
- *  CO-PILOT		: William Roske
+ * AUTHOR		: Richard Logan
+ * CO-PILOT		: William Roske
  * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
  */
 
-/*
+/*\
+ * [Description]
+ *
  * Test if link(2) fails with EMLINK.
  */
 
-- 
2.39.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH 3/3] link08: Convert docs to docparse
  2023-10-11 10:55 [LTP] [PATCH 1/3] link03: Convert docs to docparse Yang Xu
  2023-10-11 10:55 ` [LTP] [PATCH 2/3] link05: " Yang Xu
@ 2023-10-11 10:55 ` Yang Xu
  2023-10-12  9:58   ` Petr Vorel
  2023-10-12 10:00   ` Petr Vorel
  2023-10-12  9:55 ` [LTP] [PATCH 1/3] link03: " Petr Vorel
  2 siblings, 2 replies; 16+ messages in thread
From: Yang Xu @ 2023-10-11 10:55 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/link/link08.c | 30 +++++++++++++------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/testcases/kernel/syscalls/link/link08.c b/testcases/kernel/syscalls/link/link08.c
index d3e33d077..b3bffb31e 100644
--- a/testcases/kernel/syscalls/link/link08.c
+++ b/testcases/kernel/syscalls/link/link08.c
@@ -3,21 +3,23 @@
  * Copyright (c) 2014 Fujitsu Ltd.
  * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
  */
-/*
- * Test Description:
- *  Verify that,
- *   1. link() fails with -1 return value and sets errno to EPERM
- *      if oldpath is a directory.
- *   2. link() fails with -1 return value and sets errno to EXDEV
- *      if oldpath and newpath are not on the same mounted file system( Linux
- *      permits a file system to be mounted at multiple points, but link()
- *      does not work across different mount points, even if the same
- *      file system is mounted on both. ).
- *   3. link() fails with -1 return value and sets errno to EROFS
- *      if the file is on a read-only file system.
- *   4. link() fails with -1 return value and sets errno to ELOOP
- *      if too many symbolic links were encountered in resolving path.
+
+/*\
+ * [Description]
+ *
+ * - link() fails with -1 return value and sets errno to EPERM
+ *   if oldpath is a directory.
+ * - link() fails with -1 return value and sets errno to EXDEV
+ *   if oldpath and newpath are not on the same mounted file system( Linux
+ *   permits a file system to be mounted at multiple points, but link()
+ *   does not work across different mount points, even if the same
+ *   file system is mounted on both. ).
+ * - link() fails with -1 return value and sets errno to EROFS
+ *   if the file is on a read-only file system.
+ * - link() fails with -1 return value and sets errno to ELOOP
+ *   if too many symbolic links were encountered in resolving path.
  */
+
 #include <errno.h>
 #include "tst_test.h"
 
-- 
2.39.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-11 10:55 [LTP] [PATCH 1/3] link03: Convert docs to docparse Yang Xu
  2023-10-11 10:55 ` [LTP] [PATCH 2/3] link05: " Yang Xu
  2023-10-11 10:55 ` [LTP] [PATCH 3/3] link08: " Yang Xu
@ 2023-10-12  9:55 ` Petr Vorel
  2023-10-13  5:43   ` Yang Xu (Fujitsu)
  2 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-12  9:55 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi Xu,

first, so far we did these changes during rewrite to the new C API.
Do we really put docparse on these old tests? I would postpone it.

> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
>  1 file changed, 7 insertions(+), 34 deletions(-)

> diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
> index 1f45240ae..27f8a4efe 100644
> --- a/testcases/kernel/syscalls/link/link03.c
> +++ b/testcases/kernel/syscalls/link/link03.c
> @@ -1,42 +1,15 @@
>  /*
>   * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
> - *  AUTHOR		: Richard Logan
> - *  CO-PILOT		: William Roske
> + * AUTHOR		: Richard Logan
> + * CO-PILOT		: William Roske
Although we probably should keep these names, we're not forced to have it in
original ugly form. How about put it as:
* Authors: Richard Logan, William Roske


>   * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
I would also put here:
* Copyright (c) Linux Test Project, 2001-2023

> - *
> - * This program is free software; you can redistribute it and/or modify it
> - * under the terms of version 2 of the GNU General Public License as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it would be useful, but
> - * WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> - *
> - * Further, this software is distributed without any warranty that it is
> - * free of the rightful claim of any third person regarding infringement
> - * or the like.  Any license provided herein, whether implied or
> - * otherwise, applies only to this software file.  Patent licenses, if
> - * any, provided herein do not apply to combinations of this program with
> - * other software, or any other product whatsoever.
> - *
> - * You should have received a copy of the GNU General Public License along
> - * with this program; if not, write the Free Software Foundation, Inc.,
> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> - *
> - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
> - * Mountain View, CA  94043, or:
> - *
> - * http://www.sgi.com
> - *
> - * For further information regarding this notice, see:
> - *
> - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
> - *
>   */

You removed GPL, but haven't added SPDX on a first line:
// SPDX-License-Identifier: GPL-2.0-only

> - /*
> -  * Tests that link(2) succeds with creating n links.
> -  */
> +/*\
> + * [Description]
> + *
> + * Tests that link(2) succeds with creating n links.
s/succeds/succeeds/g
> + */

Kind regards,
Petr

>  #include <sys/types.h>
>  #include <fcntl.h>

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 3/3] link08: Convert docs to docparse
  2023-10-11 10:55 ` [LTP] [PATCH 3/3] link08: " Yang Xu
@ 2023-10-12  9:58   ` Petr Vorel
  2023-10-13  5:49     ` Yang Xu (Fujitsu)
  2023-10-12 10:00   ` Petr Vorel
  1 sibling, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-12  9:58 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi Xu,

...
> +++ b/testcases/kernel/syscalls/link/link08.c
> @@ -3,21 +3,23 @@
>   * Copyright (c) 2014 Fujitsu Ltd.
While you're in it, maybe update the copyright?

* Copyright (c) Linux Test Project, 2014-2022

>   * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
>   */
> -/*
> - * Test Description:
> - *  Verify that,
> - *   1. link() fails with -1 return value and sets errno to EPERM
> - *      if oldpath is a directory.
> - *   2. link() fails with -1 return value and sets errno to EXDEV
> - *      if oldpath and newpath are not on the same mounted file system( Linux
> - *      permits a file system to be mounted at multiple points, but link()
> - *      does not work across different mount points, even if the same
> - *      file system is mounted on both. ).
> - *   3. link() fails with -1 return value and sets errno to EROFS
> - *      if the file is on a read-only file system.
> - *   4. link() fails with -1 return value and sets errno to ELOOP
> - *      if too many symbolic links were encountered in resolving path.
> +
> +/*\
> + * [Description]
I would keep the sentence:
"Verify that"" or "Test that:"

Beware, there must be a blank line before the list, otherwise list will not be
formatted as list, but inline.

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

Kind regards,
Petr

> + *
> + * - link() fails with -1 return value and sets errno to EPERM
> + *   if oldpath is a directory.
> + * - link() fails with -1 return value and sets errno to EXDEV
> + *   if oldpath and newpath are not on the same mounted file system( Linux
> + *   permits a file system to be mounted at multiple points, but link()
> + *   does not work across different mount points, even if the same
> + *   file system is mounted on both. ).
> + * - link() fails with -1 return value and sets errno to EROFS
> + *   if the file is on a read-only file system.
> + * - link() fails with -1 return value and sets errno to ELOOP
> + *   if too many symbolic links were encountered in resolving path.
>   */
> +

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 3/3] link08: Convert docs to docparse
  2023-10-11 10:55 ` [LTP] [PATCH 3/3] link08: " Yang Xu
  2023-10-12  9:58   ` Petr Vorel
@ 2023-10-12 10:00   ` Petr Vorel
  2023-10-13  5:45     ` Yang Xu (Fujitsu)
  1 sibling, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-12 10:00 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi Xu,

could you please fixes the formating errors and the grammar?
...
> + * - link() fails with -1 return value and sets errno to EXDEV
> + *   if oldpath and newpath are not on the same mounted file system( Linux
    *   if the old path and the new path are not on the same mounted file system (Linux

> + *   permits a file system to be mounted at multiple points, but link()
> + *   does not work across different mount points, even if the same
> + *   file system is mounted on both. ).
    *   file system is mounted on both).

Kind regards,
Petr

> + * - link() fails with -1 return value and sets errno to EROFS
> + *   if the file is on a read-only file system.
> + * - link() fails with -1 return value and sets errno to ELOOP
> + *   if too many symbolic links were encountered in resolving path.
>   */
> +
>  #include <errno.h>
>  #include "tst_test.h"

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 2/3] link05: Convert docs to docparse
  2023-10-11 10:55 ` [LTP] [PATCH 2/3] link05: " Yang Xu
@ 2023-10-12 10:08   ` Petr Vorel
  2023-10-17  6:11     ` Yang Xu (Fujitsu)
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-12 10:08 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi Xu,

> +++ b/testcases/kernel/syscalls/link/link05.c
> @@ -1,12 +1,14 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  /*
>   * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
> - *  AUTHOR		: Richard Logan
> - *  CO-PILOT		: William Roske
> + * AUTHOR		: Richard Logan
> + * CO-PILOT		: William Roske
* Authors: Richard Logan, William Roske

>   * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
* Copyright (c) Linux Test Project, 2001-2023

>   */

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

> -/*
> +/*\
> + * [Description]
> + *
>   * Test if link(2) fails with EMLINK.
>   */

I was thinking how to cleanup test a bit. I don't like the loop
(SAFE_STAT(fname, &fbuf)). It could be simplified with putting
the loop into .tcnt = 1000, if (1000) (and put 1000 to #define).

Also it mixes tabs and spaces (visible in make check-link05,
spaces should be converted to tabs).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-12  9:55 ` [LTP] [PATCH 1/3] link03: " Petr Vorel
@ 2023-10-13  5:43   ` Yang Xu (Fujitsu)
  2023-10-13  6:12     ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-13  5:43 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp@lists.linux.it


Hi Petr,
> Hi Xu,
>
> first, so far we did these changes during rewrite to the new C API.
> Do we really put docparse on these old tests? I would postpone it.

I agree with you, I overlooked that this is an old test.

You can postpone it, maybe in the future I will rewrite to the new C API.

>> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
>> ---
>>   testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
>>   1 file changed, 7 insertions(+), 34 deletions(-)
>> diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
>> index 1f45240ae..27f8a4efe 100644
>> --- a/testcases/kernel/syscalls/link/link03.c
>> +++ b/testcases/kernel/syscalls/link/link03.c
>> @@ -1,42 +1,15 @@
>>   /*
>>    * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
>> - *  AUTHOR		: Richard Logan
>> - *  CO-PILOT		: William Roske
>> + * AUTHOR		: Richard Logan
>> + * CO-PILOT		: William Roske
> Although we probably should keep these names, we're not forced to have it in
> original ugly form. How about put it as:
> * Authors: Richard Logan, William Roske
>
ok.
>>    * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
> I would also put here:
> * Copyright (c) Linux Test Project, 2001-2023
ok.
>> - *
>> - * This program is free software; you can redistribute it and/or modify it
>> - * under the terms of version 2 of the GNU General Public License as
>> - * published by the Free Software Foundation.
>> - *
>> - * This program is distributed in the hope that it would be useful, but
>> - * WITHOUT ANY WARRANTY; without even the implied warranty of
>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> - *
>> - * Further, this software is distributed without any warranty that it is
>> - * free of the rightful claim of any third person regarding infringement
>> - * or the like.  Any license provided herein, whether implied or
>> - * otherwise, applies only to this software file.  Patent licenses, if
>> - * any, provided herein do not apply to combinations of this program with
>> - * other software, or any other product whatsoever.
>> - *
>> - * You should have received a copy of the GNU General Public License along
>> - * with this program; if not, write the Free Software Foundation, Inc.,
>> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
>> - *
>> - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
>> - * Mountain View, CA  94043, or:
>> - *
>> - * http://www.sgi.com
>> - *
>> - * For further information regarding this notice, see:
>> - *
>> - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
>> - *
>>    */
> You removed GPL, but haven't added SPDX on a first line:
> // SPDX-License-Identifier: GPL-2.0-only
Sorry for ignoring this.
>> - /*
>> -  * Tests that link(2) succeds with creating n links.
>> -  */
>> +/*\
>> + * [Description]
>> + *
>> + * Tests that link(2) succeds with creating n links.
> s/succeds/succeeds/g
>> + */
> Kind regards,
> Petr
>
>>   #include <sys/types.h>
>>   #include <fcntl.h>

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 3/3] link08: Convert docs to docparse
  2023-10-12 10:00   ` Petr Vorel
@ 2023-10-13  5:45     ` Yang Xu (Fujitsu)
  0 siblings, 0 replies; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-13  5:45 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp@lists.linux.it


Hi Petr,

Hi Xu,

could you please fixes the formating errors and the grammar?
...

ok.




+ * - link() fails with -1 return value and sets errno to EXDEV
+ *   if oldpath and newpath are not on the same mounted file system( Linux


    *   if the old path and the new path are not on the same mounted file system (Linux



+ *   permits a file system to be mounted at multiple points, but link()
+ *   does not work across different mount points, even if the same
+ *   file system is mounted on both. ).


    *   file system is mounted on both).

Kind regards,
Petr



+ * - link() fails with -1 return value and sets errno to EROFS
+ *   if the file is on a read-only file system.
+ * - link() fails with -1 return value and sets errno to ELOOP
+ *   if too many symbolic links were encountered in resolving path.
  */
+
 #include <errno.h>
 #include "tst_test.h"

Best Regards

Yang Xu




-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 3/3] link08: Convert docs to docparse
  2023-10-12  9:58   ` Petr Vorel
@ 2023-10-13  5:49     ` Yang Xu (Fujitsu)
  0 siblings, 0 replies; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-13  5:49 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp@lists.linux.it


Hi Petr,

Hi Xu,

...


+++ b/testcases/kernel/syscalls/link/link08.c
@@ -3,21 +3,23 @@
  * Copyright (c) 2014 Fujitsu Ltd.


While you're in it, maybe update the copyright?

* Copyright (c) Linux Test Project, 2014-2022


ok.I will update it.




  * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com><mailto:zenglg.jy@cn.fujitsu.com>
  */
-/*
- * Test Description:
- *  Verify that,
- *   1. link() fails with -1 return value and sets errno to EPERM
- *      if oldpath is a directory.
- *   2. link() fails with -1 return value and sets errno to EXDEV
- *      if oldpath and newpath are not on the same mounted file system( Linux
- *      permits a file system to be mounted at multiple points, but link()
- *      does not work across different mount points, even if the same
- *      file system is mounted on both. ).
- *   3. link() fails with -1 return value and sets errno to EROFS
- *      if the file is on a read-only file system.
- *   4. link() fails with -1 return value and sets errno to ELOOP
- *      if too many symbolic links were encountered in resolving path.
+
+/*\
+ * [Description]


I would keep the sentence:
"Verify that"" or "Test that:"

Beware, there must be a blank line before the list, otherwise list will not be
formatted as list, but inline.

With this change:
Reviewed-by: Petr Vorel <pvorel@suse.cz><mailto:pvorel@suse.cz>

Kind regards,
Petr


ok. I will correct it.




+ *
+ * - link() fails with -1 return value and sets errno to EPERM
+ *   if oldpath is a directory.
+ * - link() fails with -1 return value and sets errno to EXDEV
+ *   if oldpath and newpath are not on the same mounted file system( Linux
+ *   permits a file system to be mounted at multiple points, but link()
+ *   does not work across different mount points, even if the same
+ *   file system is mounted on both. ).
+ * - link() fails with -1 return value and sets errno to EROFS
+ *   if the file is on a read-only file system.
+ * - link() fails with -1 return value and sets errno to ELOOP
+ *   if too many symbolic links were encountered in resolving path.
  */
+

Best Regards

Yang Xu


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-13  5:43   ` Yang Xu (Fujitsu)
@ 2023-10-13  6:12     ` Petr Vorel
  2023-10-25 23:51       ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-13  6:12 UTC (permalink / raw)
  To: Yang Xu (Fujitsu); +Cc: ltp@lists.linux.it

Hi Xu,

> Hi Petr,
> > Hi Xu,

> > first, so far we did these changes during rewrite to the new C API.
> > Do we really put docparse on these old tests? I would postpone it.

> I agree with you, I overlooked that this is an old test.

> You can postpone it, maybe in the future I will rewrite to the new C API.

Thank you!

...
> > You removed GPL, but haven't added SPDX on a first line:
> > // SPDX-License-Identifier: GPL-2.0-only
> Sorry for ignoring this.

No problem, it's easy to overlook it.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 2/3] link05: Convert docs to docparse
  2023-10-12 10:08   ` Petr Vorel
@ 2023-10-17  6:11     ` Yang Xu (Fujitsu)
  0 siblings, 0 replies; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-17  6:11 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp@lists.linux.it

Hi Petr
> Hi Xu,
>
>> +++ b/testcases/kernel/syscalls/link/link05.c
>> @@ -1,12 +1,14 @@
>>   // SPDX-License-Identifier: GPL-2.0-or-later
>>   /*
>>    * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
>> - *  AUTHOR		: Richard Logan
>> - *  CO-PILOT		: William Roske
>> + * AUTHOR		: Richard Logan
>> + * CO-PILOT		: William Roske
> * Authors: Richard Logan, William Roske
ok.
>>    * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
> * Copyright (c) Linux Test Project, 2001-2023
ok.
>>    */
> With this fixed:
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
ok.
>> -/*
>> +/*\
>> + * [Description]
>> + *
>>    * Test if link(2) fails with EMLINK.
>>    */
> I was thinking how to cleanup test a bit. I don't like the loop
> (SAFE_STAT(fname, &fbuf)). It could be simplified with putting
> the loop into .tcnt = 1000, if (1000) (and put 1000 to #define).
>
> Also it mixes tabs and spaces (visible in make check-link05,
> spaces should be converted to tabs).
>
> Kind regards,
> Petr

I'll try to modify it as you want.

#include <stdio.h>
#include <sys/stat.h>
#include "tst_test.h"

#define BASENAME        "lkfile"
#define NUM_LINKS       1000
static char fname[255];

static void verify_link(unsigned int cnt)
{
         char lname[1024];
         struct stat fbuf, lbuf;

         sprintf(lname, "%s_%d", fname, cnt);
         TST_EXP_PASS_SILENT(link(fname, lname), "link(%s, %s)", fname, 
lname);

         SAFE_STAT(fname, &fbuf);
         SAFE_STAT(lname, &lbuf);

         if (fbuf.st_nlink < 1 || lbuf.st_nlink < 1 ||
                 (fbuf.st_nlink != lbuf.st_nlink)) {
                         tst_res(TFAIL,
                                   "link(%s, %s[1-%d]) ret %ld for %d "
                                   "files, stat values do not match %d %d",
                                   fname, fname, NUM_LINKS,
                                   TST_RET, NUM_LINKS,
                                  (int)fbuf.st_nlink, (int)lbuf.st_nlink);

                 } else {
                         tst_res(TPASS,
                                     "link(%s, %s[1-%d]) ret %ld for %d 
files, "
                                     "stat linkcounts match %d %d",
                                     fname, fname, cnt, TST_RET,
                                     NUM_LINKS, (int)fbuf.st_nlink, 
(int)lbuf.st_nlink);
                 }
}

static void setup(void)
{
         sprintf(fname, "%s_%d", BASENAME, getpid());
         SAFE_TOUCH(fname, 0700, NULL);
}

static struct tst_test test = {
         .tcnt = NUM_LINKS,
         .test = verify_link,
         .setup = setup,
         .needs_tmpdir = 1,
};

There is a problem here that if .tcnt=1000 is needed, verify_link() 
needs to have an output in every loop,

this must output 1000 results, but I don't know how to simplify the output.

And I noticed that there was no connection between the description

and the test content, which was a point I overlooked.


Best regards,

Yang Xu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-13  6:12     ` Petr Vorel
@ 2023-10-25 23:51       ` Petr Vorel
  2023-10-26  7:37         ` [LTP] 回复: " Yang Xu (Fujitsu)
  0 siblings, 1 reply; 16+ messages in thread
From: Petr Vorel @ 2023-10-25 23:51 UTC (permalink / raw)
  To: Yang Xu (Fujitsu), ltp@lists.linux.it

Hi Xu,

Also, while you are at it, could you please fix these warnings?

$ make link03

link03.c: In function ‘main’:
link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  104 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:104:19: note: directive argument in the range [1, 2147483646]
  104 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  104 |    sprintf(lname, "%s%d", fname, i);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  123 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:123:19: note: directive argument in the range [1, 2147483646]
  123 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  123 |    sprintf(lname, "%s%d", fname, i);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  138 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:138:19: note: directive argument in the range [1, 2147483646]
  138 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  138 |    sprintf(lname, "%s%d", fname, i);

$ make check-link03
CHECK testcases/kernel/syscalls/link/link03.c
link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
link03.c:33: ERROR: do not initialise statics to 0
link03.c:55: ERROR: code indent should use tabs where possible
link03.c:90: ERROR: code indent should use tabs where possible
link03.c:100: ERROR: code indent should use tabs where possible

Thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] 回复:  [PATCH 1/3] link03: Convert docs to docparse
  2023-10-25 23:51       ` Petr Vorel
@ 2023-10-26  7:37         ` Yang Xu (Fujitsu)
  2023-10-31  7:22           ` [LTP] " Yang Xu (Fujitsu)
  0 siblings, 1 reply; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-26  7:37 UTC (permalink / raw)
  To: ltp@lists.linux.it, Petr Vorel

Hi Petr,

>Hi Xu,

>Also, while you are at it, could you please fix these warnings?

OK. I will pay attention to it.

>$ make link03

>link03.c: In function ‘main’:
>link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
> 104 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:104:19: note: directive argument in the range [1, 2147483646]
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |                   ^~~~~~
>link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  123 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:123:19: note: directive argument in the range [1, 2147483646]
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                      ^~
>link03.c:138:19: note: directive argument in the range [1, 2147483646]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  138 |    sprintf(lname, "%s%d", fname, i);

>$ make check-link03
>CHECK testcases/kernel/syscalls/link/link03.c
>link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>link03.c:33: ERROR: do not initialise statics to 0
>link03.c:55: ERROR: code indent should use tabs where possible
>link03.c:90: ERROR: code indent should use tabs where possible
>link03.c:100: ERROR: code indent should use tabs where possible

>Thanks!

>Kind regards,
>Petr

Best Regards
Yang Xu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-26  7:37         ` [LTP] 回复: " Yang Xu (Fujitsu)
@ 2023-10-31  7:22           ` Yang Xu (Fujitsu)
  2023-11-03  7:32             ` Petr Vorel
  0 siblings, 1 reply; 16+ messages in thread
From: Yang Xu (Fujitsu) @ 2023-10-31  7:22 UTC (permalink / raw)
  To: ltp@lists.linux.it, Petr Vorel

Hi Petr,

I've noticed that the test objectives of link03 and link05 are very similar, and the description of link05's test has no relevance to the test code.
Therefore, I think we can simply remove link03 and update the test description of link05 to replace link03.
As for your previous suggestions for modifying the link05 code, I don't have a good solution for this.

The specific information is as follows:
LINK: http://patchwork.ozlabs.org/project/ltp/patch/1697021709-22916-2-git-send-email-xuyang2018.jy@fujitsu.com/


Best Regards,
Yang Xu


>Hi Petr,

>>Hi Xu,

>>Also, while you are at it, could you please fix these warnings?

>OK. I will pay attention to it.

>>$ make link03

>>link03.c: In function ‘main’:
>>link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>> 104 |    sprintf(lname, "%s%d", fname, i);
>>     |                      ^~
>>link03.c:104:19: note: directive argument in the range [1, 2147483646]
>>  104 |    sprintf(lname, "%s%d", fname, i);
>>     |                   ^~~~~~
>>link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  104 |    sprintf(lname, "%s%d", fname, i);
>>     |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>     |                      ^~
>>link03.c:123:19: note: directive argument in the range [1, 2147483646]
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>      |                   ^~~~~~
>>link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>>  138 |    sprintf(lname, "%s%d", fname, i);
>>      |                      ^~
>>link03.c:138:19: note: directive argument in the range [1, 2147483646]
>>  138 |    sprintf(lname, "%s%d", fname, i);
>>      |                   ^~~~~~
>>link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  138 |    sprintf(lname, "%s%d", fname, i);

>>$ make check-link03
>>CHECK testcases/kernel/syscalls/link/link03.c
>>link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>>link03.c:33: ERROR: do not initialise statics to 0
>>link03.c:55: ERROR: code indent should use tabs where possible
>>link03.c:90: ERROR: code indent should use tabs where possible
>>link03.c:100: ERROR: code indent should use tabs where possible

>>Thanks!

>>Kind regards,
>>Petr

>Best Regards
>Yang Xu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/3] link03: Convert docs to docparse
  2023-10-31  7:22           ` [LTP] " Yang Xu (Fujitsu)
@ 2023-11-03  7:32             ` Petr Vorel
  0 siblings, 0 replies; 16+ messages in thread
From: Petr Vorel @ 2023-11-03  7:32 UTC (permalink / raw)
  To: Yang Xu (Fujitsu); +Cc: ltp@lists.linux.it

Hi Xu,
> Hi Petr,

> I've noticed that the test objectives of link03 and link05 are very similar, and the description of link05's test has no relevance to the test code.
> Therefore, I think we can simply remove link03 and update the test description of link05 to replace link03.
> As for your previous suggestions for modifying the link05 code, I don't have a good solution for this.

> The specific information is as follows:
> LINK: http://patchwork.ozlabs.org/project/ltp/patch/1697021709-22916-2-git-send-email-xuyang2018.jy@fujitsu.com/

Indeed, test would have to print ouput 1000x, because each test needs to report
result. Therefore let's keep it. I hope it makes sense to run test 1000x.

E.g. feel free to merge (ideally with fixes spaces to tags, but understand if
you do just docparse change).

Kind regards,
Petr

> Best Regards,
> Yang Xu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2023-11-03  7:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11 10:55 [LTP] [PATCH 1/3] link03: Convert docs to docparse Yang Xu
2023-10-11 10:55 ` [LTP] [PATCH 2/3] link05: " Yang Xu
2023-10-12 10:08   ` Petr Vorel
2023-10-17  6:11     ` Yang Xu (Fujitsu)
2023-10-11 10:55 ` [LTP] [PATCH 3/3] link08: " Yang Xu
2023-10-12  9:58   ` Petr Vorel
2023-10-13  5:49     ` Yang Xu (Fujitsu)
2023-10-12 10:00   ` Petr Vorel
2023-10-13  5:45     ` Yang Xu (Fujitsu)
2023-10-12  9:55 ` [LTP] [PATCH 1/3] link03: " Petr Vorel
2023-10-13  5:43   ` Yang Xu (Fujitsu)
2023-10-13  6:12     ` Petr Vorel
2023-10-25 23:51       ` Petr Vorel
2023-10-26  7:37         ` [LTP] 回复: " Yang Xu (Fujitsu)
2023-10-31  7:22           ` [LTP] " Yang Xu (Fujitsu)
2023-11-03  7:32             ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox