From: Adrian Hunter Date: Thu, 5 Jun 2008 11:11:29 +0000 (+0300) Subject: fs-tests: preserve mount options when mounting again X-Git-Tag: v1.2.0~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3ab9b9e7af305169e3c60496b02902c79c2881c4;p=mtd-utils.git fs-tests: preserve mount options when mounting again Signed-off-by: Adrian Hunter --- diff --git a/tests/fs-tests/lib/tests.c b/tests/fs-tests/lib/tests.c index aaf3907..97e5207 100644 --- a/tests/fs-tests/lib/tests.c +++ b/tests/fs-tests/lib/tests.c @@ -995,7 +995,13 @@ void tests_remount(void) target = tests_file_system_mount_dir; filesystemtype = tests_file_system_type; mountflags = 0; - data = NULL; + data = mount_info.mnt_opts; + if (data) { + if (strcmp(data, "rw") == 0) + data = NULL; + else if (strncmp(data, "rw,", 3) == 0) + data += 3; + } CHECK(mount(source, target, filesystemtype, mountflags, data) != -1);