From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Hrubis Date: Tue, 21 Nov 2017 10:44:45 +0100 Subject: [LTP] [PATCH] fs_fill: switch the SAFE MACROs back to ordinary syscall In-Reply-To: References: <20171110111519.27872-1-liwang@redhat.com> <1515676468.42550872.1511176722601.JavaMail.zimbra@redhat.com> <20171120131952.GA22113@rei.lan> Message-ID: <20171121094445.GA9443@rei.lan> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it Hi! > > But I can always change that in a follow up patch... > > How about this following change: > > --- a/testcases/kernel/fs/fs_fill/fs_fill.c > +++ b/testcases/kernel/fs/fs_fill/fs_fill.c > @@ -41,21 +41,11 @@ struct worker { > > static void *worker(void *p) > { > - int ret; > struct worker *w = p; > DIR *d; > struct dirent *ent; > char file[PATH_MAX]; > > - ret = mkdir(w->dir, 0700); > - if (ret == -1) { > - if (errno != ENOSPC) > - tst_brk(TBROK | TERRNO, "mkdir()"); > - > - tst_res(TINFO | TERRNO, "mkdir()"); > - return NULL; > - } > - > while (run) { > tst_fill_fs(w->dir, 0); > > @@ -92,6 +82,10 @@ static void testrun(void) > for (i = 0; i < nthreads; i++) { > snprintf(workers[i].dir, sizeof(workers[i].dir), > MNTPOINT "/thread%i", i + 1); > + SAFE_MKDIR(workers[i].dir, 0700); > + } > + > + for (i = 0; i < nthreads; i++) { > SAFE_PTHREAD_CREATE(&threads[i], NULL, worker, &workers[i]); > } This one looks cleaner to me. -- Cyril Hrubis chrubis@suse.cz