* [LTP] [PATCH 2/5] syscalls/mkdir01, 03: Cleanup && Convert to new API @ 2018-04-19 2:15 Xu, Yang 2018-04-19 10:07 ` Cyril Hrubis 0 siblings, 1 reply; 4+ messages in thread From: Xu, Yang @ 2018-04-19 2:15 UTC (permalink / raw) To: ltp >Hi! >The mkdir03 was rewritten meanwhile by Sandeep Patil, sorry for not reviewing your patch sooner. I've pushed the part of > this patch that removes mkdir01 since the case is covered by the mkdir03 already, thanks. Hi I know mkdir03 has been written by Sandeep Patil, but this patch applies tst_get_bad_addr function to mkdir03 and simplifies the test. Thanks Yang Xu >-- >Cyril Hrubis >chrubis@suse.cz ^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH 2/5] syscalls/mkdir01, 03: Cleanup && Convert to new API 2018-04-19 2:15 [LTP] [PATCH 2/5] syscalls/mkdir01, 03: Cleanup && Convert to new API Xu, Yang @ 2018-04-19 10:07 ` Cyril Hrubis 2018-04-19 10:55 ` [LTP] [PATCH] syscalls/mkdir03: Use tst_get_bad_addr() yang xu 0 siblings, 1 reply; 4+ messages in thread From: Cyril Hrubis @ 2018-04-19 10:07 UTC (permalink / raw) To: ltp Hi! > I know mkdir03 has been written by Sandeep Patil, but this patch > applies tst_get_bad_addr function to mkdir03 and simplifies the test. Feel free to send a patch to fixes that for the mkdir03. I was simply trying to explain that the original patch does not apply because we got conflicting patch accepted meanwhile, sorry for the trouble... -- Cyril Hrubis chrubis@suse.cz ^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] syscalls/mkdir03: Use tst_get_bad_addr() 2018-04-19 10:07 ` Cyril Hrubis @ 2018-04-19 10:55 ` yang xu 2018-04-19 12:23 ` Cyril Hrubis 0 siblings, 1 reply; 4+ messages in thread From: yang xu @ 2018-04-19 10:55 UTC (permalink / raw) To: ltp 1) Remove useless struct member Signed-off-by: yang xu <xuyang.jy@cn.fujitsu.com> --- testcases/kernel/syscalls/mkdir/mkdir03.c | 32 ++++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/testcases/kernel/syscalls/mkdir/mkdir03.c b/testcases/kernel/syscalls/mkdir/mkdir03.c index 5d7f1e1..9441afe 100644 --- a/testcases/kernel/syscalls/mkdir/mkdir03.c +++ b/testcases/kernel/syscalls/mkdir/mkdir03.c @@ -46,20 +46,18 @@ static char long_dir[PATH_MAX + 2] = {[0 ... PATH_MAX + 1] = 'a'}; static char loop_dir[PATH_MAX] = "."; struct tcase; -static void prot_none_pathname(struct tcase *tc); static struct tcase { char *pathname; int exp_errno; - void (*setupfunc)(struct tcase *tc); } TC[] = { - {NULL, EFAULT, prot_none_pathname}, - {long_dir, ENAMETOOLONG, NULL}, - {TST_EEXIST, EEXIST, NULL}, - {TST_ENOENT, ENOENT, NULL}, - {TST_ENOTDIR_DIR, ENOTDIR, NULL}, - {loop_dir, ELOOP, NULL}, - {TST_EROFS, EROFS, NULL}, + {NULL, EFAULT}, + {long_dir, ENAMETOOLONG}, + {TST_EEXIST, EEXIST}, + {TST_ENOENT, ENOENT}, + {TST_ENOTDIR_DIR, ENOTDIR}, + {loop_dir, ELOOP}, + {TST_EROFS, EROFS}, }; static void verify_mkdir(unsigned int n) @@ -82,12 +80,6 @@ static void verify_mkdir(unsigned int n) } } -static void prot_none_pathname(struct tcase *tc) -{ - tc->pathname = SAFE_MMAP(0, 1, PROT_NONE, - MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); -} - static void setup(void) { unsigned int i; @@ -95,15 +87,15 @@ static void setup(void) SAFE_TOUCH(TST_EEXIST, MODE, NULL); SAFE_TOUCH(TST_ENOTDIR_FILE, MODE, NULL); + for (i = 0; i < ARRAY_SIZE(TC); i++) { + if (TC[i].exp_errno == EFAULT) + TC[i].pathname = tst_get_bad_addr(NULL); + } + SAFE_MKDIR("test_eloop", DIR_MODE); SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop"); for (i = 0; i < 43; i++) strcat(loop_dir, "/test_eloop"); - - for (i = 0; i < ARRAY_SIZE(TC); i++) { - if (TC[i].setupfunc) - TC[i].setupfunc(&TC[i]); - } } static struct tst_test test = { -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] syscalls/mkdir03: Use tst_get_bad_addr() 2018-04-19 10:55 ` [LTP] [PATCH] syscalls/mkdir03: Use tst_get_bad_addr() yang xu @ 2018-04-19 12:23 ` Cyril Hrubis 0 siblings, 0 replies; 4+ messages in thread From: Cyril Hrubis @ 2018-04-19 12:23 UTC (permalink / raw) To: ltp Hi! Applied, thanks. -- Cyril Hrubis chrubis@suse.cz ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-19 12:23 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-04-19 2:15 [LTP] [PATCH 2/5] syscalls/mkdir01, 03: Cleanup && Convert to new API Xu, Yang 2018-04-19 10:07 ` Cyril Hrubis 2018-04-19 10:55 ` [LTP] [PATCH] syscalls/mkdir03: Use tst_get_bad_addr() yang xu 2018-04-19 12:23 ` Cyril Hrubis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox