]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: preserve mount options when mounting again
authorAdrian Hunter <ext-adrian.hunter@nokia.com>
Thu, 5 Jun 2008 11:11:29 +0000 (14:11 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 16 Jun 2008 15:02:31 +0000 (18:02 +0300)
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
tests/fs-tests/lib/tests.c

index aaf3907c91010f40f97d82d12fc073772d6286a9..97e5207c04eaf09880a848392e9355638cb5c6e2 100644 (file)
@@ -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);