nfs01_open_files: Fix pattern for deleted files
PATCH 1/1 nfs01_open_files: Fix pattern for deleted files
Fixes 0989fe65f3 ("Corrected the export lines in nfs01 ...")
Reported-by Neil Brown <[email protected]>
Signed-off-by Petr Vorel <[email protected]>
--- testcases/network/nfs/nfs_stress/nfs01_open_files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/network/nfs/nfs_stress/nfs01_open_files.c +3 -2
@@ -10,7 +10,8 @@#include <sys/stat.h> #include <unistd.h> -#define TEMPLATE "ltpXXXXXX" +#define TEMPLATE_PREFIX "ltp" +#define TEMPLATE TEMPLATE_PREFIX "XXXXXX"int write_something (int );void delete_files (void );
@@ -101,7 +102,7 @@ void delete_files(void) dirp =opendir ("." );for (entp =readdir (dirp); entp; entp =readdir (dirp)) -if (!strncmp (entp->d_name,"apt" ,3 )) { +if (!strncmp (entp->d_name,TEMPLATE_PREFIX ,3 )) {if (stat (entp->d_name, &stat_buffer))abortx ("stat() failed for \"%s\", errno = %d" , entp->d_name, errno);
Signature · 5 lines
2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 1 line
Fixes 0989fe65f3 ("Corrected the export lines in nfs01 ...")
commit 0989fe65f306 in 2001 changed the names of created files from apt to ltp, but didn't change the names of deleted files.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 21 lines
Reported-by Neil Brown <[email protected]>Signed-off-by Petr Vorel <[email protected]>--- testcases/network/nfs/nfs_stress/nfs01_open_files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)testcases/network/nfs/nfs_stress/nfs01_open_files.c +2
-1@@ -10,7 +10,8 @@#include <sys/stat.h> #include <unistd.h> -#define TEMPLATE "ltpXXXXXX" +#define TEMPLATE_PREFIX "ltp" +#define TEMPLATE TEMPLATE_PREFIX "XXXXXX"int write_something (int );void delete_files (void );
testcases/network/nfs/nfs_stress/nfs01_open_files.c void delete_files(void) · line 105
Quoted 5 lines
testcases/network/nfs/nfs_stress/nfs01_open_files.c +1
-1@@ -101,7 +102,7 @@ void delete_files(void) dirp =opendir ("." );for (entp =readdir (dirp); entp; entp =readdir (dirp)) -if (!strncmp (entp->d_name,"apt" ,3 )) { +if (!strncmp (entp->d_name,TEMPLATE_PREFIX ,3 )) {
Maybe we should also do:
#define TEMPLATE_PREFIX_LEN (sizeof(TEMPLATE_PREFIX) - 1)
And use TEMPLATE_PREFIX_LEN instead of the hardcoded 3
Otherwise it looks obviously correct:
Reviewed-by Cyril Hrubis <[email protected]>
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Cyril,
...
Quoted 5 lines
Maybe we should also do:
#define
TEMPLATE_PREFIX_LEN(sizeof(TEMPLATE_PREFIX)- 1)And use
TEMPLATE_PREFIX_LENinstead of the hardcoded 3
+1, thanks, merged with this change.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp