All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems
@ 2017-11-09  0:34 Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

Hello,

We have been running LTP on Android systems and found there are a bunch of
tests that don't work. Most common reasons are (but not limited to):
 - Lack of tools that LTP tests sometimes expects (e.g. mkfs.extN)
 - Different directory structure or location for device nodes
   (e.g. /dev/block/loopX instead of /dev/loopX)
 - Tests depend on Sys V IPC that Android doesn't use / support.

This series fixes some of those tests to make sure they start working on
Android systems. I've also clubbed the v2 of a couple of patches in this
series that they are clearly annotated as such.


Sandeep Patil (6):
  syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly
  mm: mallocstress: use safe macros wherever possible
  mm: mallocstress: use futexes instead of SysV semaphores
  direct_io: diotest4: use getpagesize() for mmap if shm header is
    absent
  syscalls/mkdir03: convert to new API and use .needsrofs for EROFS
    check
  lib: mkfs: use 'mke2fs' on android systems for formatting filesystems

 configure.ac                                       |   1 +
 include/lapi/mmap.h                                |   8 ++
 lib/tst_mkfs.c                                     |  16 +++
 testcases/kernel/io/direct_io/diotest4.c           |   4 +-
 testcases/kernel/mem/mtest07/mallocstress.c        | 101 +++++---------
 testcases/kernel/syscalls/cma/process_vm.h         |  38 ------
 testcases/kernel/syscalls/cma/process_vm_readv02.c |  10 +-
 testcases/kernel/syscalls/cma/process_vm_readv03.c |  10 +-
 .../kernel/syscalls/cma/process_vm_writev02.c      |  10 +-
 testcases/kernel/syscalls/mkdir/mkdir03.c          | 147 ++++++---------------
 10 files changed, 115 insertions(+), 230 deletions(-)

-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-10  9:14   ` Jan Stancek
  2017-11-09  0:34 ` [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible Sandeep Patil
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

All testcases under testcases/kernel/syscalls/cma depend on SysV
semaphore to do event notification from parent<->child processes.
Since bionic / android doesn't have SysV IPC, the tests can't be built
against bionic.

Fix this by using the ltp TST_SAFE_CHECKPOINT APIs taht are based on
futexes. The change enables following tests for Android devices.

   process_vm01, process_vm_readv0[23], process_vm_writev02

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
v1->v2
------
- Use TST_CHECKPOINT APIs instead of eventfd as suggested by Jan

 testcases/kernel/syscalls/cma/process_vm.h         | 38 ----------------------
 testcases/kernel/syscalls/cma/process_vm_readv02.c | 10 +++---
 testcases/kernel/syscalls/cma/process_vm_readv03.c | 10 +++---
 .../kernel/syscalls/cma/process_vm_writev02.c      | 10 +++---
 4 files changed, 15 insertions(+), 53 deletions(-)

diff --git a/testcases/kernel/syscalls/cma/process_vm.h b/testcases/kernel/syscalls/cma/process_vm.h
index 7df9aacd0..1ecf325bb 100644
--- a/testcases/kernel/syscalls/cma/process_vm.h
+++ b/testcases/kernel/syscalls/cma/process_vm.h
@@ -59,42 +59,4 @@ static inline ssize_t test_process_vm_writev(pid_t pid,
 #endif
 }
 
-void safe_semop(int id, unsigned short num, short op)
-{
-	int ret;
-	struct sembuf sem_op;
-	sem_op.sem_num = num,
-	sem_op.sem_op = op,
-	sem_op.sem_flg = 0;
-
-	do {
-		ret = semop(id, &sem_op, 1);
-	} while (ret == -1 && errno == EINTR);
-	if (ret == -1)
-		tst_brkm(TBROK|TERRNO, NULL, "semop(%d, (%d, %d)) failed",
-			id, num, op);
-}
-
-int init_sem(int num)
-{
-	int id, i;
-	union semun u;
-	if ((id = semget(IPC_PRIVATE, num, IPC_CREAT|S_IRWXU)) == -1)
-		tst_brkm(TBROK|TERRNO, NULL, "Couldn't allocate semaphore");
-
-	for (i = 0; i < num; i++) {
-		u.val = 0;
-		if (semctl(id, 0, SETVAL, u) == -1)
-			tst_brkm(TBROK|TERRNO, NULL,
-				"Couldn't initialize sem %d value", i);
-	}
-	return id;
-}
-
-void clean_sem(int id)
-{
-	if (semctl(id, 0, IPC_RMID) == -1)
-		tst_brkm(TBROK|TERRNO, NULL, "Couldn't remove sem");
-}
-
 #endif /* _PROCESS_VM_H_ */
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv02.c b/testcases/kernel/syscalls/cma/process_vm_readv02.c
index f84f79ef7..aa81f17f7 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv02.c
@@ -38,7 +38,6 @@ static char *tst_string = "THIS IS A TEST";
 static int len;
 static int pipe_fd[2];
 static pid_t pids[2];
-static int semid;
 
 static void child_alloc(void);
 static void child_invoke(void);
@@ -84,7 +83,7 @@ int main(int argc, char **argv)
 			tst_resm(TFAIL, "child 1 returns %d", status);
 
 		/* child_alloc is free to exit now */
-		safe_semop(semid, 0, 1);
+		TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
 
 		SAFE_WAITPID(cleanup, pids[0], &status, 0);
 		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
@@ -112,7 +111,7 @@ static void child_alloc(void)
 	SAFE_CLOSE(tst_exit, pipe_fd[1]);
 
 	/* wait until child_invoke is done reading from our VM */
-	safe_semop(semid, 0, -1);
+	TST_SAFE_CHECKPOINT_WAIT(cleanup, 0);
 }
 
 static void child_invoke(void)
@@ -153,12 +152,13 @@ static void setup(void)
 	tst_brkm(TCONF, NULL, "process_vm_readv does not exist "
 		 "on your system");
 #endif
-	semid = init_sem(1);
+	tst_tmpdir();
+	TST_CHECKPOINT_INIT(cleanup);
 
 	TEST_PAUSE;
 }
 
 static void cleanup(void)
 {
-	clean_sem(semid);
+	tst_rmdir();
 }
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv03.c b/testcases/kernel/syscalls/cma/process_vm_readv03.c
index 2e69f855f..d1ca87a14 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv03.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv03.c
@@ -51,7 +51,6 @@ static int nr_iovecs;
 static long bufsz;
 static int pipe_fd[2];
 static pid_t pids[2];
-static int semid;
 
 static void gen_random_arr(int *arr, int arr_sz);
 static void child_alloc(int *bufsz_arr);
@@ -103,7 +102,7 @@ int main(int argc, char **argv)
 			tst_resm(TFAIL, "child 1 returns %d", status);
 
 		/* child_alloc is free to exit now */
-		safe_semop(semid, 0, 1);
+		TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
 
 		SAFE_WAITPID(cleanup, pids[0], &status, 0);
 		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
@@ -157,7 +156,7 @@ static void child_alloc(int *bufsz_arr)
 	SAFE_CLOSE(tst_exit, pipe_fd[1]);
 
 	/* wait until child_invoke is done reading from our VM */
-	safe_semop(semid, 0, -1);
+	TST_SAFE_CHECKPOINT_WAIT(cleanup, 0);
 }
 
 static long *fetch_remote_addrs(void)
@@ -255,7 +254,8 @@ static void setup(void)
 	tst_brkm(TCONF, NULL, "process_vm_readv does not exist "
 		 "on your system");
 #endif
-	semid = init_sem(1);
+	tst_tmpdir();
+	TST_CHECKPOINT_INIT(cleanup);
 	srand(time(NULL));
 
 	TEST_PAUSE;
@@ -263,7 +263,7 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	clean_sem(semid);
+	tst_rmdir();
 }
 
 static void help(void)
diff --git a/testcases/kernel/syscalls/cma/process_vm_writev02.c b/testcases/kernel/syscalls/cma/process_vm_writev02.c
index 952081811..544bda8d5 100644
--- a/testcases/kernel/syscalls/cma/process_vm_writev02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_writev02.c
@@ -48,7 +48,6 @@ static option_t options[] = {
 static long bufsz;
 static int pipe_fd[2];
 static pid_t pids[2];
-static int semid;
 
 static void child_init_and_verify(void);
 static void child_write(void);
@@ -97,7 +96,7 @@ int main(int argc, char **argv)
 			tst_resm(TFAIL, "child 1 returns %d", status);
 
 		/* signal child_init_and_verify to verify its VM now */
-		safe_semop(semid, 0, 1);
+		TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
 
 		SAFE_WAITPID(cleanup, pids[0], &status, 0);
 		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
@@ -126,7 +125,7 @@ static void child_init_and_verify(void)
 	SAFE_CLOSE(tst_exit, pipe_fd[1]);
 
 	/* wait until child_write() is done writing to our VM */
-	safe_semop(semid, 0, -1);
+	TST_SAFE_CHECKPOINT_WAIT(cleanup, 0);
 
 	nr_err = 0;
 	for (i = 0; i < bufsz; i++) {
@@ -189,14 +188,15 @@ static void setup(void)
 	tst_brkm(TCONF, NULL, "process_vm_writev does not exist "
 		 "on your system");
 #endif
-	semid = init_sem(1);
+	tst_tmpdir();
+	TST_CHECKPOINT_INIT(cleanup);
 
 	TEST_PAUSE;
 }
 
 static void cleanup(void)
 {
-	clean_sem(semid);
+	tst_rmdir();
 }
 
 static void help(void)
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-10  9:41   ` Jan Stancek
  2017-11-09  0:34 ` [LTP] [PATCH 3/6] mm: mallocstress: use futexes instead of SysV semaphores Sandeep Patil
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

The test is currently doesn't use the test library at all and instead
is a standlone program. While the conversion is being done, there is no
reason why the program can't use SAFE_ macros. Make necessary changes
to the program for the same, reducing the error check paths a lot.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/mem/mtest07/mallocstress.c | 75 ++++++++++++++---------------
 1 file changed, 35 insertions(+), 40 deletions(-)

diff --git a/testcases/kernel/mem/mtest07/mallocstress.c b/testcases/kernel/mem/mtest07/mallocstress.c
index 9588fb495..78d8ace8a 100644
--- a/testcases/kernel/mem/mtest07/mallocstress.c
+++ b/testcases/kernel/mem/mtest07/mallocstress.c
@@ -73,6 +73,10 @@
 #include <sys/ipc.h>
 #include <sys/sem.h>
 
+#include "test.h"
+#include "safe_macros.h"
+#include "tst_safe_pthread.h"
+
 #define MAXL    100		/* default number of loops to do malloc and free      */
 #define MAXT     60		/* default number of threads to create.               */
 
@@ -90,6 +94,8 @@
 
 int num_loop = MAXL;		/* number of loops to perform                     */
 int semid;
+pthread_t *thrdid;		/* the threads */
+int ret;			/* program return value, used by main thread */
 
 /* Define SPEW_SIGNALS to tickle thread_create bug (it fails if interrupted). */
 #define SPEW_SIGNALS
@@ -272,6 +278,22 @@ void *alloc_mem(void *threadnum)
 	return (void *)(uintptr_t) (err ? -1 : 0);
 }
 
+/* only ever called from main thread */
+static void cleanup(void)
+{
+	if (semid > 0) {
+		if (semctl(semid, 0, IPC_RMID) == -1) {
+			perror("semctl\n");
+			ret = -1;
+		}
+	}
+
+	if (thrdid) {
+		free(thrdid);
+		thrdid = NULL;
+	}
+}
+
 /******************************************************************************/
 /*								 	      */
 /* Function:	main							      */
@@ -294,10 +316,8 @@ int main(int argc,		/* number of input parameters                 */
 	int c;			/* command line options                       */
 	int num_thrd = MAXT;	/* number of threads to create                */
 	int thrd_ndx;		/* index into the array of thread ids         */
-	pthread_t *thrdid;	/* the threads                                */
 	extern int optopt;	/* options to the program                     */
 	struct sembuf sop[1];
-	int ret = 0;
 
 	while ((c = getopt(argc, argv, "hl:t:")) != -1) {
 		switch (c) {
@@ -330,15 +350,13 @@ int main(int argc,		/* number of input parameters                 */
 
 	dprt(("number of times to loop in the thread = %d\n", num_loop));
 
-	thrdid = malloc(sizeof(pthread_t) * num_thrd);
-	if (thrdid == NULL) {
-		perror("main(): allocating space for thrdid[] malloc()");
-		return 1;
-	}
+	thrdid = SAFE_MALLOC(cleanup, sizeof(pthread_t) * num_thrd);
 
 	semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0666);
 	if (semid < 0) {
 		perror("Semaphore creation failed  Reason:");
+		ret = -1;
+		goto out;
 	}
 
 	sop[0].sem_num = 0;
@@ -351,19 +369,8 @@ int main(int argc,		/* number of input parameters                 */
 	}
 
 	for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) {
-		if (pthread_create(&thrdid[thrd_ndx], NULL, alloc_mem,
-				   (void *)(uintptr_t) thrd_ndx)) {
-			int err = errno;
-			if (err == EINTR) {
-				fprintf(stderr,
-					"main(): pthread_create failed with EINTR!\n");
-				ret = -1;
-				goto out;
-			}
-			perror("main(): pthread_create()");
-			ret = -11;
-			goto out;
-		}
+		SAFE_PTHREAD_CREATE(&thrdid[thrd_ndx], NULL, alloc_mem,
+				    (void *)(uintptr_t)thrd_ndx);
 	}
 	my_yield();
 
@@ -376,32 +383,20 @@ int main(int argc,		/* number of input parameters                 */
 
 	for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) {
 		void *th_status;	/* exit status of LWP */
-		if (pthread_join(thrdid[thrd_ndx], &th_status) != 0) {
-			perror("main(): pthread_join()");
+		SAFE_PTHREAD_JOIN(thrdid[thrd_ndx], &th_status);
+		if ((intptr_t)th_status != 0) {
+			fprintf(stderr,
+				"%s: thread [%d] - exited with errors\n",
+				__func__, thrd_ndx);
 			ret = -1;
 			goto out;
-		} else {
-			if ((intptr_t) th_status != 0) {
-				fprintf(stderr,
-					"main(): thread [%d] - exited with errors\n",
-					thrd_ndx);
-				ret = -1;
-				goto out;
-			}
-			dprt(("main(): thread [%d]: exited without errors\n",
-			      thrd_ndx));
 		}
+		dprt(("%s: thread [%d]: exited without errors\n",
+		      __func__, thrd_ndx));
 		my_yield();
 	}
 	printf("main(): test passed.\n");
 out:
-	if (semctl(semid, 0, IPC_RMID) == -1) {
-		perror("semctl\n");
-		ret = -1;
-	}
-	if (thrdid) {
-		free(thrdid);
-		thrdid = NULL;
-	}
+	cleanup();
 	exit(ret);
 }
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH 3/6] mm: mallocstress: use futexes instead of SysV semaphores
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent Sandeep Patil
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

Start using TST_SAFE_CHECKPOINT_WAIT/WAKE macros that are based
on futexes instead of SysV semaphore. This allows the test to build
and run on an Android system.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/mem/mtest07/mallocstress.c | 44 ++++-------------------------
 1 file changed, 5 insertions(+), 39 deletions(-)

diff --git a/testcases/kernel/mem/mtest07/mallocstress.c b/testcases/kernel/mem/mtest07/mallocstress.c
index 78d8ace8a..7e283af87 100644
--- a/testcases/kernel/mem/mtest07/mallocstress.c
+++ b/testcases/kernel/mem/mtest07/mallocstress.c
@@ -93,7 +93,6 @@
                                    } while (0)
 
 int num_loop = MAXL;		/* number of loops to perform                     */
-int semid;
 pthread_t *thrdid;		/* the threads */
 int ret;			/* program return value, used by main thread */
 
@@ -258,16 +257,8 @@ int allocate_free(int repeat,	/* number of times to repeat allocate/free    */
 /******************************************************************************/
 void *alloc_mem(void *threadnum)
 {
-	struct sembuf sop[1];
-	sop[0].sem_num = 0;
-	sop[0].sem_op = 0;
-	sop[0].sem_flg = 0;
 	/* waiting for other threads starting */
-	if (semop(semid, sop, 1) == -1) {
-		if (errno != EIDRM)
-			perror("semop");
-		return (void *)-1;
-	}
+	TST_SAFE_CHECKPOINT_WAIT(NULL, 0);
 
 	/* thread N will use growth scheme N mod 4 */
 	int err = allocate_free(num_loop, ((uintptr_t) threadnum) % 4);
@@ -281,13 +272,6 @@ void *alloc_mem(void *threadnum)
 /* only ever called from main thread */
 static void cleanup(void)
 {
-	if (semid > 0) {
-		if (semctl(semid, 0, IPC_RMID) == -1) {
-			perror("semctl\n");
-			ret = -1;
-		}
-	}
-
 	if (thrdid) {
 		free(thrdid);
 		thrdid = NULL;
@@ -351,22 +335,8 @@ int main(int argc,		/* number of input parameters                 */
 	dprt(("number of times to loop in the thread = %d\n", num_loop));
 
 	thrdid = SAFE_MALLOC(cleanup, sizeof(pthread_t) * num_thrd);
-
-	semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0666);
-	if (semid < 0) {
-		perror("Semaphore creation failed  Reason:");
-		ret = -1;
-		goto out;
-	}
-
-	sop[0].sem_num = 0;
-	sop[0].sem_op = 1;
-	sop[0].sem_flg = 0;
-	if (semop(semid, sop, 1) == -1) {
-		perror("semop");
-		ret = -1;
-		goto out;
-	}
+	tst_tmpdir();
+	TST_CHECKPOINT_INIT(cleanup);
 
 	for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) {
 		SAFE_PTHREAD_CREATE(&thrdid[thrd_ndx], NULL, alloc_mem,
@@ -374,12 +344,8 @@ int main(int argc,		/* number of input parameters                 */
 	}
 	my_yield();
 
-	sop[0].sem_op = -1;
-	if (semop(semid, sop, 1) == -1) {
-		perror("semop");
-		ret = -1;
-		goto out;
-	}
+	/* Wake up all threads */
+	TST_SAFE_CHECKPOINT_WAKE2(cleanup, 0, num_thrd);
 
 	for (thrd_ndx = 0; thrd_ndx < num_thrd; thrd_ndx++) {
 		void *th_status;	/* exit status of LWP */
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
                   ` (2 preceding siblings ...)
  2017-11-09  0:34 ` [LTP] [PATCH 3/6] mm: mallocstress: use futexes instead of SysV semaphores Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-10  9:54   ` Jan Stancek
  2017-11-09  0:34 ` [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check Sandeep Patil
  2017-11-09  0:34 ` [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems Sandeep Patil
  5 siblings, 1 reply; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

For some architectures, mmap(MAP_FIXED) has to be aligned to SHMLBA
(instead of getpagesize()) --

   https://sourceforge.net/p/ltp/mailman/ltp-list/?viewmonth=200804

This dependency on SHMLBA causes the test to fail building for Android
due to absence of sys/shm.h. Make the header dependency configurable and
use getpagesize() as mmap granularity if the header is absent allowing
the test to work on Android while not breaking the architectures that
depend on the shm headers.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
v1->v2
------
- Instead of relying on __BIONIC__, fix by doing a header check for <sys/shm> and
  if the header doesn't exist, use getpagesize() as mmap granularity, otherwise
  use SHMBA (as before)

 configure.ac                             | 1 +
 include/lapi/mmap.h                      | 8 ++++++++
 testcases/kernel/io/direct_io/diotest4.c | 4 ++--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index ffcbf57c5..16c8e4692 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ AC_CHECK_HEADERS([ \
     sys/fanotify.h \
     sys/inotify.h \
     sys/prctl.h \
+    sys/shm.h \
     sys/ustat.h \
     sys/xattr.h \
 ])
diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
index 10065a4df..7a5580079 100644
--- a/include/lapi/mmap.h
+++ b/include/lapi/mmap.h
@@ -71,4 +71,12 @@
 # define MADV_FREE	8
 #endif
 
+#ifdef HAVE_SYS_SHM_H
+# include <sys/shm.h>
+# define MMAP_GRANULARITY SHMLBA
+#else
+# include <unistd.h>
+# define MMAP_GRANULARITY getpagesize()
+#endif /* HAVE_SYS_SHM_H */
+
 #endif /* LAPI_MMAP_H__ */
diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
index dbcacf1ae..e4616e400 100644
--- a/testcases/kernel/io/direct_io/diotest4.c
+++ b/testcases/kernel/io/direct_io/diotest4.c
@@ -65,12 +65,12 @@
 #include <sys/mman.h>
 #include <sys/syscall.h>
 #include <errno.h>
-#include <sys/shm.h>
 
 #include "diotest_routines.h"
 
 #include "test.h"
 #include "safe_macros.h"
+#include "lapi/mmap.h"
 
 char *TCID = "diotest4";	/* Test program identifier.    */
 int TST_TOTAL = 17;		/* Total number of test conditions */
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
 	int fd, newfd;
 	int i, l_fail = 0, fail_count = 0, total = 0;
 	int failed = 0;
-	int shmsz = SHMLBA;
+	int shmsz = MMAP_GRANULARITY;
 	int pagemask = ~(sysconf(_SC_PAGE_SIZE) - 1);
 	char *buf0, *buf1, *buf2;
 	caddr_t shm_base;
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
                   ` (3 preceding siblings ...)
  2017-11-09  0:34 ` [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-10 11:21   ` Jan Stancek
  2017-11-09  0:34 ` [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems Sandeep Patil
  5 siblings, 1 reply; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

The mkdir03 test is converted to the new API along with removing the
need to manually acquire and mount a loopback devices for EROFS checks.
This now makes it possible for the test to run on Android systems as
well.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/syscalls/mkdir/mkdir03.c | 147 +++++++++---------------------
 1 file changed, 42 insertions(+), 105 deletions(-)

diff --git a/testcases/kernel/syscalls/mkdir/mkdir03.c b/testcases/kernel/syscalls/mkdir/mkdir03.c
index 823ee9dd1..97932c18c 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir03.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir03.c
@@ -29,19 +29,12 @@
 #include <fcntl.h>
 #include <sys/mount.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
-static void setup(void);
-struct test_case_t;
-static void mkdir_verify(struct test_case_t *tc);
-static void bad_addr_setup(struct test_case_t *tc);
-static void cleanup(void);
-static int mount_flag;
+#include "tst_test.h"
 
 #define TST_EEXIST	"tst_eexist"
 #define TST_ENOENT	"tst_enoent/tst"
-#define TST_ENOTDIR	"tst_enotdir/tst"
+#define TST_ENOTDIR_FILE "tst_enotdir"
+#define TST_ENOTDIR_DIR	"tst_enotdir/tst"
 #define MODE		0777
 
 #define MNT_POINT	"mntpoint"
@@ -49,122 +42,66 @@ static int mount_flag;
 			 S_IXGRP|S_IROTH|S_IXOTH)
 #define TST_EROFS      "mntpoint/tst_erofs"
 
-char *TCID = "mkdir03";
-
-static char long_dir[PATH_MAX+2];
+static char long_dir[PATH_MAX + 2] = {[0 ... PATH_MAX + 1] = 'a'};
 static char loop_dir[PATH_MAX] = ".";
-static const char *device;
 
-static struct test_case_t {
+static struct tcase {
 	char *pathname;
-	int mode;
 	int exp_errno;
-	void (*setupfunc) (struct test_case_t *tc);
 } TC[] = {
 #if !defined(UCLINUX)
-	{NULL, MODE, EFAULT, bad_addr_setup},
+	{NULL, EFAULT},
 #endif
-	{long_dir, MODE, ENAMETOOLONG, NULL},
-	{TST_EEXIST, MODE, EEXIST, NULL},
-	{TST_ENOENT, MODE, ENOENT, NULL},
-	{TST_ENOTDIR, MODE, ENOTDIR, NULL},
-	{loop_dir, MODE, ELOOP, NULL},
-	{TST_EROFS, MODE, EROFS, NULL},
+	{long_dir, ENAMETOOLONG},
+	{TST_EEXIST, EEXIST},
+	{TST_ENOENT, ENOENT},
+	{TST_ENOTDIR_DIR, ENOTDIR},
+	{loop_dir, ELOOP},
+	{TST_EROFS, EROFS},
 };
 
-int TST_TOTAL = ARRAY_SIZE(TC);
-
-int main(int ac, char **av)
-{
-	int i, lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		for (i = 0; i < TST_TOTAL; i++)
-			mkdir_verify(&TC[i]);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void setup(void)
-{
-	int i;
-	const char *fs_type;
-
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to acquire device");
-
-	memset(long_dir, 'a', PATH_MAX+1);
-
-	SAFE_TOUCH(cleanup, TST_EEXIST, MODE, NULL);
-
-	SAFE_TOUCH(cleanup, "tst_enotdir", MODE, NULL);
-
-	SAFE_MKDIR(cleanup, "test_eloop", DIR_MODE);
-	SAFE_SYMLINK(cleanup, "../test_eloop", "test_eloop/test_eloop");
-	for (i = 0; i < 43; i++)
-		strcat(loop_dir, "/test_eloop");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-	SAFE_MKDIR(cleanup, MNT_POINT, DIR_MODE);
-	SAFE_MOUNT(cleanup, device, MNT_POINT, fs_type, MS_RDONLY, NULL);
-	mount_flag = 1;
-}
-
-#if !defined(UCLINUX)
-static void bad_addr_setup(struct test_case_t *tc)
-{
-	tc->pathname = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-				 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-}
-#endif
-
-static void mkdir_verify(struct test_case_t *tc)
+static void verify_mkdir(unsigned int n)
 {
-	if (tc->setupfunc != NULL)
-		tc->setupfunc(tc);
-
-	TEST(mkdir(tc->pathname, tc->mode));
+	struct tcase *tc = TC + n;
 
+	TEST(mkdir(tc->pathname, MODE));
 	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "mkdir() returned %ld, expected -1, errno=%d",
-			 TEST_RETURN, tc->exp_errno);
+		tst_res(TFAIL, "mkdir() returned %ld, expected -1, errno=%d",
+			TEST_RETURN, tc->exp_errno);
 		return;
 	}
 
 	if (TEST_ERRNO == tc->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "mkdir() failed as expected");
+		tst_res(TPASS | TTERRNO, "mkdir() failed as expected");
 	} else {
-		tst_resm(TFAIL | TTERRNO,
-			 "mkdir() failed unexpectedly; expected: %d - %s",
+		tst_res(TFAIL | TTERRNO,
+			"mkdir() failed unexpectedly; expected: %d - %s",
 			 tc->exp_errno, strerror(tc->exp_errno));
 	}
 }
 
-static void cleanup(void)
+static void setup(void)
 {
-	if (mount_flag && tst_umount(MNT_POINT) < 0)
-		tst_resm(TWARN | TERRNO, "umount device:%s failed", device);
-
-	if (device)
-		tst_release_device(device);
+	int i;
+#if !defined(UCLINUX)
+	TC[0].pathname = SAFE_MMAP(0, 1, PROT_NONE,
+				   MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+#endif
+	SAFE_TOUCH(TST_EEXIST, MODE, NULL);
+	SAFE_TOUCH(TST_ENOTDIR_FILE, MODE, NULL);
 
-	tst_rmdir();
+	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");
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(TC),
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+	.setup = setup,
+	.test = verify_mkdir,
+};
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems
  2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
                   ` (4 preceding siblings ...)
  2017-11-09  0:34 ` [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check Sandeep Patil
@ 2017-11-09  0:34 ` Sandeep Patil
  2017-11-10 14:48   ` Jan Stancek
  5 siblings, 1 reply; 13+ messages in thread
From: Sandeep Patil @ 2017-11-09  0:34 UTC (permalink / raw)
  To: ltp

Android does not have mkfs.extN symlinks and only extN filesystems
images can be created on the device. So, make sure we use 'mke2fs -t
<fs_type>' when being built for Android and filter out any non-ext
filesystem type requests from tst_mkfs_() when built for Android.

syscalls/mmap16, syscalls/rename11 are the tests the tests currently
known to start working after this change on Android systems

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 lib/tst_mkfs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index 7385a939f..c46d07044 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -43,7 +43,23 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 		return;
 	}
 
+#ifdef __ANDROID__
+	if (strncmp(fs_type, "ext", 3)) {
+		tst_brkm(TBROK, cleanup_fn,
+			 "%s:%d: \'%s\' fs_type not supported", file, lineno, fs_type);
+		return;
+	}
+	strcpy(mkfs, "mke2fs");
+
+	/* insert '-t <fs_type> in arguments here */
+	argv[pos++] = "-t";
+	strcat(fs_opts_str, "-t ");
+	argv[pos++] = fs_type;
+	strcat(fs_opts_str, fs_type);
+	strcat(fs_opts_str, " ");
+#else
 	snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
+#endif
 
 	if (fs_opts) {
 		for (i = 0; fs_opts[i]; i++) {
-- 
2.15.0.448.gf294e3d99a-goog


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

* [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly
  2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
@ 2017-11-10  9:14   ` Jan Stancek
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Stancek @ 2017-11-10  9:14 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> All testcases under testcases/kernel/syscalls/cma depend on SysV
> semaphore to do event notification from parent<->child processes.
> Since bionic / android doesn't have SysV IPC, the tests can't be built
> against bionic.
> 
> Fix this by using the ltp TST_SAFE_CHECKPOINT APIs taht are based on
> futexes. The change enables following tests for Android devices.
> 
>    process_vm01, process_vm_readv0[23], process_vm_writev02
> 
> Signed-off-by: Sandeep Patil <sspatil@google.com>
> ---
> v1->v2
> ------
> - Use TST_CHECKPOINT APIs instead of eventfd as suggested by Jan
> 

Pushed.

Thanks,
Jan

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

* [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible
  2017-11-09  0:34 ` [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible Sandeep Patil
@ 2017-11-10  9:41   ` Jan Stancek
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Stancek @ 2017-11-10  9:41 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> The test is currently doesn't use the test library at all and instead
> is a standlone program. While the conversion is being done, there is no
> reason why the program can't use SAFE_ macros. Make necessary changes
> to the program for the same, reducing the error check paths a lot.
> 
> Signed-off-by: Sandeep Patil <sspatil@google.com>
> ---
>  testcases/kernel/mem/mtest07/mallocstress.c | 75
>  ++++++++++++++---------------
>  1 file changed, 35 insertions(+), 40 deletions(-)
> 
> diff --git a/testcases/kernel/mem/mtest07/mallocstress.c
> b/testcases/kernel/mem/mtest07/mallocstress.c
> index 9588fb495..78d8ace8a 100644
> --- a/testcases/kernel/mem/mtest07/mallocstress.c
> +++ b/testcases/kernel/mem/mtest07/mallocstress.c
> @@ -73,6 +73,10 @@
>  #include <sys/ipc.h>
>  #include <sys/sem.h>
>  
> +#include "test.h"
> +#include "safe_macros.h"
> +#include "tst_safe_pthread.h"

This doesn't look entirely OK, because it's mixing oldlib and newlib.
Some SAFE macros won't end up calling cleanup().

Would you care to create patch that converts it all to newlib?
Using checkpoints is of course OK and preferred.

Regards,
Jan

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

* [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent
  2017-11-09  0:34 ` [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent Sandeep Patil
@ 2017-11-10  9:54   ` Jan Stancek
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Stancek @ 2017-11-10  9:54 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> For some architectures, mmap(MAP_FIXED) has to be aligned to SHMLBA
> (instead of getpagesize()) --
> 
>    https://sourceforge.net/p/ltp/mailman/ltp-list/?viewmonth=200804
> 
> This dependency on SHMLBA causes the test to fail building for Android
> due to absence of sys/shm.h. Make the header dependency configurable and
> use getpagesize() as mmap granularity if the header is absent allowing
> the test to work on Android while not breaking the architectures that
> depend on the shm headers.
> 
> Signed-off-by: Sandeep Patil <sspatil@google.com>
> ---
> v1->v2
> ------
> - Instead of relying on __BIONIC__, fix by doing a header check for <sys/shm>
> and
>   if the header doesn't exist, use getpagesize() as mmap granularity,
>   otherwise
>   use SHMBA (as before)

Pushed.

Thanks,
Jan

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

* [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check
  2017-11-09  0:34 ` [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check Sandeep Patil
@ 2017-11-10 11:21   ` Jan Stancek
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Stancek @ 2017-11-10 11:21 UTC (permalink / raw)
  To: ltp




----- Original Message -----
> The mkdir03 test is converted to the new API along with removing the
> need to manually acquire and mount a loopback devices for EROFS checks.
> This now makes it possible for the test to run on Android systems as
> well.
> 
> Signed-off-by: Sandeep Patil <sspatil@google.com>

Pushed with 2 small changes:
- drop UCLINUX support
- keep the setupfunc, so that we don't hardcode indexes into tcase array

Thanks,
Jan

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

* [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems
  2017-11-09  0:34 ` [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems Sandeep Patil
@ 2017-11-10 14:48   ` Jan Stancek
  2017-11-10 19:23     ` Sandeep Patil
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Stancek @ 2017-11-10 14:48 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Android does not have mkfs.extN symlinks and only extN filesystems
> images can be created on the device. So, make sure we use 'mke2fs -t
> <fs_type>' when being built for Android and filter out any non-ext
> filesystem type requests from tst_mkfs_() when built for Android.

Hi,

So we probably need something similar for:
  d1f9382ba7c8 "lib: Add interface to list supported filesystems"
that introduced ".all_filesystems" as it also checks for mkfs.XXX.

> 
> syscalls/mmap16, syscalls/rename11 are the tests the tests currently
> known to start working after this change on Android systems
> 
> Signed-off-by: Sandeep Patil <sspatil@google.com>
> ---
>  lib/tst_mkfs.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
> index 7385a939f..c46d07044 100644
> --- a/lib/tst_mkfs.c
> +++ b/lib/tst_mkfs.c
> @@ -43,7 +43,23 @@ void tst_mkfs_(const char *file, const int lineno, void
> (cleanup_fn)(void),
>  		return;
>  	}
>  
> +#ifdef __ANDROID__
> +	if (strncmp(fs_type, "ext", 3)) {
> +		tst_brkm(TBROK, cleanup_fn,
> +			 "%s:%d: \'%s\' fs_type not supported", file, lineno, fs_type);

This looks like it should TCONF instead. TBROK suggests there's something broken
about the test, but this is more property of the environment where it runs.

We TCONF already if mkfs.XXX can't be found couple lines below.
Maybe we could use it for android too, what do you think?

#ifdef __ANDROID__
if (!strncmp(fs_type, "ext", 3)) {
  // use mke2fs
}
#endif

if (pos == 1)
  // use mkfs.XXX

Regards,
Jan

> +		return;
> +	}
> +	strcpy(mkfs, "mke2fs");
> +
> +	/* insert '-t <fs_type> in arguments here */
> +	argv[pos++] = "-t";
> +	strcat(fs_opts_str, "-t ");
> +	argv[pos++] = fs_type;
> +	strcat(fs_opts_str, fs_type);
> +	strcat(fs_opts_str, " ");
> +#else
>  	snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
> +#endif
>  
>  	if (fs_opts) {
>  		for (i = 0; fs_opts[i]; i++) {
> --
> 2.15.0.448.gf294e3d99a-goog
> 
> 

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

* [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems
  2017-11-10 14:48   ` Jan Stancek
@ 2017-11-10 19:23     ` Sandeep Patil
  0 siblings, 0 replies; 13+ messages in thread
From: Sandeep Patil @ 2017-11-10 19:23 UTC (permalink / raw)
  To: ltp

On Fri, Nov 10, 2017 at 09:48:18AM -0500, Jan Stancek wrote:
> 
> 
> ----- Original Message -----
> > Android does not have mkfs.extN symlinks and only extN filesystems
> > images can be created on the device. So, make sure we use 'mke2fs -t
> > <fs_type>' when being built for Android and filter out any non-ext
> > filesystem type requests from tst_mkfs_() when built for Android.
> 
> Hi,
> 
> So we probably need something similar for:
>   d1f9382ba7c8 "lib: Add interface to list supported filesystems"
> that introduced ".all_filesystems" as it also checks for mkfs.XXX.

Yes, I saw those changes after. I'll pull and add changes there too.

> 
> > 
> > syscalls/mmap16, syscalls/rename11 are the tests the tests currently
> > known to start working after this change on Android systems
> > 
> > Signed-off-by: Sandeep Patil <sspatil@google.com>
> > ---
> >  lib/tst_mkfs.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
> > index 7385a939f..c46d07044 100644
> > --- a/lib/tst_mkfs.c
> > +++ b/lib/tst_mkfs.c
> > @@ -43,7 +43,23 @@ void tst_mkfs_(const char *file, const int lineno, void
> > (cleanup_fn)(void),
> >  		return;
> >  	}
> >  
> > +#ifdef __ANDROID__
> > +	if (strncmp(fs_type, "ext", 3)) {
> > +		tst_brkm(TBROK, cleanup_fn,
> > +			 "%s:%d: \'%s\' fs_type not supported", file, lineno, fs_type);
> 
> This looks like it should TCONF instead. TBROK suggests there's something broken
> about the test, but this is more property of the environment where it runs.
> 
> We TCONF already if mkfs.XXX can't be found couple lines below.
> Maybe we could use it for android too, what do you think?
> 
> #ifdef __ANDROID__
> if (!strncmp(fs_type, "ext", 3)) {
>   // use mke2fs
> }
> #endif
> 
> if (pos == 1)
>   // use mkfs.XXX

agree, will respin.

- ssp

> 
> Regards,
> Jan
> 
> > +		return;
> > +	}
> > +	strcpy(mkfs, "mke2fs");
> > +
> > +	/* insert '-t <fs_type> in arguments here */
> > +	argv[pos++] = "-t";
> > +	strcat(fs_opts_str, "-t ");
> > +	argv[pos++] = fs_type;
> > +	strcat(fs_opts_str, fs_type);
> > +	strcat(fs_opts_str, " ");
> > +#else
> >  	snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
> > +#endif
> >  
> >  	if (fs_opts) {
> >  		for (i = 0; fs_opts[i]; i++) {
> > --
> > 2.15.0.448.gf294e3d99a-goog
> > 
> > 

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

end of thread, other threads:[~2017-11-10 19:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
2017-11-10  9:14   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible Sandeep Patil
2017-11-10  9:41   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 3/6] mm: mallocstress: use futexes instead of SysV semaphores Sandeep Patil
2017-11-09  0:34 ` [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent Sandeep Patil
2017-11-10  9:54   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check Sandeep Patil
2017-11-10 11:21   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems Sandeep Patil
2017-11-10 14:48   ` Jan Stancek
2017-11-10 19:23     ` Sandeep Patil

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.