diff --git a/Android.mk b/Android.mk
index 99e644d..29d3dd3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -3,22 +3,30 @@
 common_src_files := \
 	VolumeManager.cpp \
 	CommandListener.cpp \
+	CryptCommandListener.cpp \
 	VoldCommand.cpp \
 	NetlinkManager.cpp \
 	NetlinkHandler.cpp \
-	Volume.cpp \
-	DirectVolume.cpp \
 	Process.cpp \
-	Ext4.cpp \
-	Fat.cpp \
+	fs/Ext4.cpp \
+	fs/F2fs.cpp \
+	fs/Vfat.cpp \
 	Loop.cpp \
 	Devmapper.cpp \
 	ResponseCode.cpp \
 	CheckBattery.cpp \
 	Ext4Crypt.cpp \
 	VoldUtil.c \
-	fstrim.c \
-	cryptfs.c
+	cryptfs.c \
+	Disk.cpp \
+	VolumeBase.cpp \
+	PublicVolume.cpp \
+	PrivateVolume.cpp \
+	EmulatedVolume.cpp \
+	Utils.cpp \
+	MoveTask.cpp \
+	Benchmark.cpp \
+	TrimTask.cpp \
 
 common_c_includes := \
 	system/extras/ext4_utils \
@@ -54,7 +62,7 @@
 	libbatteryservice
 
 vold_conlyflags := -std=c11
-vold_cflags := -Werror -Wall -Wno-missing-field-initializers
+vold_cflags := -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter
 
 include $(CLEAR_VARS)
 
@@ -109,3 +117,15 @@
 LOCAL_INIT_RC := vdc.rc
 
 include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CLANG := true
+LOCAL_SRC_FILES:= secdiscard.cpp
+LOCAL_MODULE:= secdiscard
+LOCAL_SHARED_LIBRARIES := libcutils
+LOCAL_CFLAGS := $(vold_cflags)
+LOCAL_CONLYFLAGS := $(vold_conlyflags)
+
+include $(BUILD_EXECUTABLE)
diff --git a/Benchmark.cpp b/Benchmark.cpp
new file mode 100644
index 0000000..810adf4
--- /dev/null
+++ b/Benchmark.cpp
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Benchmark.h"
+#include "BenchmarkGen.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/file.h>
+#include <base/logging.h>
+#include <cutils/iosched_policy.h>
+#include <private/android_filesystem_config.h>
+
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+#define ENABLE_DROP_CACHES 1
+
+using android::base::ReadFileToString;
+using android::base::WriteStringToFile;
+
+namespace android {
+namespace vold {
+
+static void notifyResult(const std::string& path, int64_t create_d,
+        int64_t drop_d, int64_t run_d, int64_t destroy_d) {
+    std::string res(path +
+            + " " + BenchmarkIdent()
+            + " " + std::to_string(create_d)
+            + " " + std::to_string(drop_d)
+            + " " + std::to_string(run_d)
+            + " " + std::to_string(destroy_d));
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(
+            ResponseCode::BenchmarkResult, res.c_str(), false);
+}
+
+static nsecs_t benchmark(const std::string& path) {
+    errno = 0;
+    int orig_prio = getpriority(PRIO_PROCESS, 0);
+    if (errno != 0) {
+        PLOG(ERROR) << "Failed to getpriority";
+        return -1;
+    }
+    if (setpriority(PRIO_PROCESS, 0, -10) != 0) {
+        PLOG(ERROR) << "Failed to setpriority";
+        return -1;
+    }
+
+    IoSchedClass orig_clazz = IoSchedClass_NONE;
+    int orig_ioprio = 0;
+    if (android_get_ioprio(0, &orig_clazz, &orig_ioprio)) {
+        PLOG(ERROR) << "Failed to android_get_ioprio";
+        return -1;
+    }
+    if (android_set_ioprio(0, IoSchedClass_RT, 0)) {
+        PLOG(ERROR) << "Failed to android_set_ioprio";
+        return -1;
+    }
+
+    char orig_cwd[PATH_MAX];
+    if (getcwd(orig_cwd, PATH_MAX) == NULL) {
+        PLOG(ERROR) << "Failed getcwd";
+        return -1;
+    }
+    if (chdir(path.c_str()) != 0) {
+        PLOG(ERROR) << "Failed chdir";
+        return -1;
+    }
+
+    sync();
+
+    LOG(INFO) << "Benchmarking " << path;
+    nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME);
+
+    BenchmarkCreate();
+    sync();
+    nsecs_t create = systemTime(SYSTEM_TIME_BOOTTIME);
+
+#if ENABLE_DROP_CACHES
+    LOG(VERBOSE) << "Before drop_caches";
+    if (!WriteStringToFile("3", "/proc/sys/vm/drop_caches")) {
+        PLOG(ERROR) << "Failed to drop_caches";
+    }
+    LOG(VERBOSE) << "After drop_caches";
+#endif
+    nsecs_t drop = systemTime(SYSTEM_TIME_BOOTTIME);
+
+    BenchmarkRun();
+    sync();
+    nsecs_t run = systemTime(SYSTEM_TIME_BOOTTIME);
+
+    BenchmarkDestroy();
+    sync();
+    nsecs_t destroy = systemTime(SYSTEM_TIME_BOOTTIME);
+
+    if (chdir(orig_cwd) != 0) {
+        PLOG(ERROR) << "Failed to chdir";
+    }
+    if (android_set_ioprio(0, orig_clazz, orig_ioprio)) {
+        PLOG(ERROR) << "Failed to android_set_ioprio";
+    }
+    if (setpriority(PRIO_PROCESS, 0, orig_prio) != 0) {
+        PLOG(ERROR) << "Failed to setpriority";
+    }
+
+    nsecs_t create_d = create - start;
+    nsecs_t drop_d = drop - create;
+    nsecs_t run_d = run - drop;
+    nsecs_t destroy_d = destroy - run;
+
+    LOG(INFO) << "create took " << nanoseconds_to_milliseconds(create_d) << "ms";
+    LOG(INFO) << "drop took " << nanoseconds_to_milliseconds(drop_d) << "ms";
+    LOG(INFO) << "run took " << nanoseconds_to_milliseconds(run_d) << "ms";
+    LOG(INFO) << "destroy took " << nanoseconds_to_milliseconds(destroy_d) << "ms";
+
+    notifyResult(path, create_d, drop_d, run_d, destroy_d);
+
+    return run_d;
+}
+
+nsecs_t BenchmarkPrivate(const std::string& path) {
+    std::string benchPath(path);
+    benchPath += "/misc";
+    if (android::vold::PrepareDir(benchPath, 01771, AID_SYSTEM, AID_MISC)) {
+        return -1;
+    }
+    benchPath += "/vold";
+    if (android::vold::PrepareDir(benchPath, 0700, AID_ROOT, AID_ROOT)) {
+        return -1;
+    }
+    benchPath += "/bench";
+    if (android::vold::PrepareDir(benchPath, 0700, AID_ROOT, AID_ROOT)) {
+        return -1;
+    }
+    return benchmark(benchPath);
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/Benchmark.h b/Benchmark.h
new file mode 100644
index 0000000..13f9009
--- /dev/null
+++ b/Benchmark.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_BENCHMARK_H
+#define ANDROID_VOLD_BENCHMARK_H
+
+#include <utils/Errors.h>
+#include <utils/Timers.h>
+
+#include <string>
+
+namespace android {
+namespace vold {
+
+/* Benchmark a private volume mounted at the given path */
+nsecs_t BenchmarkPrivate(const std::string& path);
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/BenchmarkGen.h b/BenchmarkGen.h
new file mode 100644
index 0000000..6813b08
--- /dev/null
+++ b/BenchmarkGen.h
@@ -0,0 +1,4438 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/******************************************************************
+ * THIS CODE WAS GENERATED BY benchgen.py, DO NOT MODIFY DIRECTLY *
+ ******************************************************************/
+
+
+#include <base/logging.h>
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sendfile.h>
+#include <fcntl.h>
+
+#include <algorithm>
+#include <string>
+
+#include <Utils.h>
+
+namespace android {
+namespace vold {
+
+static status_t BenchmarkRun() {
+
+char* buf = (char*) malloc(1048576);
+int  t3433f17 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(lseek(t3433f17, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f17, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f17, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 278721));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 19, 278751));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 25119, 278528)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 37276895));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 14, 37276925));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 914520, 37273600)); // mmap2
+int  t3433f18 = TEMP_FAILURE_RETRY(open("file1", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 466944, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 466944)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 471040, 0)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 5965501));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 11, 5965531));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file2", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 1048576, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 57012224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 1048576, 0)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 6473855));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 6473885));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 8916226));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 8916256));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 11368292));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 11368322));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 13996125));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 13996155));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 16595549));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 16595579));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 19217798));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 19217828));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 22047170));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 22047200));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3433f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3433f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 30, 24961213));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 12, 24961243));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file3", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file4", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file5", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 38736, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4304, 36864)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file6", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 2348, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4636, 0)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file7", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 778948, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 16736, 778240)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file8", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 18099, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4264, 16384)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file9", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 22960, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4108, 20480)); // mmap2
+close(t3433f18);
+t3433f18 = TEMP_FAILURE_RETRY(open("file10", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 13748, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4196, 12288)); // mmap2
+close(t3433f18);
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 278721));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 19, 278751));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 25119, 278528)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 35727447));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 33, 35727477));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 2805, 35725312)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 29869066));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 33, 29869096));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 1891, 29868032)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 34413225));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 49, 34413255));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 3143, 34410496)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 32521955));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 45, 32521985));
+TEMP_FAILURE_RETRY(pread(t3433f17, buf, 6350, 32518144)); // mmap2
+int  t3450f18 = TEMP_FAILURE_RETRY(open("file11", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+int  t3450f22 = TEMP_FAILURE_RETRY(open("file12", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3450f22, buf, 1));
+close(t3450f22);
+t3450f22 = TEMP_FAILURE_RETRY(open("file13", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3450f22);
+t3450f22 = TEMP_FAILURE_RETRY(open("file14", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3450f22);
+t3450f22 = TEMP_FAILURE_RETRY(open("file15", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3450f22, buf, 1));
+TEMP_FAILURE_RETRY(fsync(t3450f22));
+close(t3450f22);
+close(t3450f18);
+int  t3454f26 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(lseek(t3454f26, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3454f26, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3454f26, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3454f26, buf, 769726, 38187008)); // mmap2
+close(t3454f26);
+t3454f26 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(lseek(t3454f26, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3454f26, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3454f26, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3454f26, buf, 769726, 38187008)); // mmap2
+close(t3454f26);
+int  t3455f17 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(lseek(t3455f17, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f17, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f17, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 278721));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 19, 278751));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 25119, 278528)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 37276895));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 14, 37276925));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 914520, 37273600)); // mmap2
+int  t3454f29 = TEMP_FAILURE_RETRY(open("file16", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3454f29, buf, 14048, 0)); // mmap2
+close(t3454f29);
+int  t3455f18 = TEMP_FAILURE_RETRY(open("file1", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 466944, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 466944)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 471040, 0)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 5965501));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 11, 5965531));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file2", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 1048576, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 57012224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 1048576, 0)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 6473855));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 6473885));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 8916226));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 8916256));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 11368292));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 11368322));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 13996125));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 13996155));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 16595549));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 16595579));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 19217798));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 19217828));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 22047170));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 22047200));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 4));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_SET));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3455f18, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3455f18, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 769726, 38187008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 30, 24961213));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 12, 24961243));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file3", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file4", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file5", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 38736, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4304, 36864)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file6", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 2348, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4636, 0)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file7", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 778948, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 16736, 778240)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file8", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 18099, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4264, 16384)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file9", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 22960, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4108, 20480)); // mmap2
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file11", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 3513185));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 3513215));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3262, 3510272)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 3513185));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 3513215));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3262, 3510272)); // mmap2
+int  t3455f19 = TEMP_FAILURE_RETRY(open("file12", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f19, buf, 1));
+close(t3455f19);
+t3455f19 = TEMP_FAILURE_RETRY(open("file13", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3455f19);
+t3455f19 = TEMP_FAILURE_RETRY(open("file14", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3455f19);
+t3455f19 = TEMP_FAILURE_RETRY(open("file15", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3455f19, buf, 1));
+TEMP_FAILURE_RETRY(fsync(t3455f19));
+close(t3455f19);
+close(t3455f18);
+t3455f18 = TEMP_FAILURE_RETRY(open("file10", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 13748, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f18, buf, 4196, 12288)); // mmap2
+close(t3455f18);
+int  t3483f20 = TEMP_FAILURE_RETRY(open("file17", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 100, 0));
+int  t3483f21 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f21, buf, 1, 0));
+close(t3483f21);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 0));
+t3483f21 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f21, buf, 1, 0));
+close(t3483f21);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 16, 24));
+t3483f21 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f21, buf, 1, 0));
+close(t3483f21);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 8192));
+t3483f21 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f21, buf, 1, 0));
+close(t3483f21);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 16, 24));
+t3483f21 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f21, buf, 1, 0));
+close(t3483f21);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 12288));
+int  t3483f22 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f22, buf, 1, 0));
+close(t3483f22);
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 28672));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 32768));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 36864));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 81920));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 98304));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 163840));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 57344));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 147456));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 151552));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 155648));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 143360));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 65536));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 122880));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 73728));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 126976));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 90112));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 135168));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 106496));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 110592));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 49152));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 139264));
+TEMP_FAILURE_RETRY(pread(t3483f20, buf, 4096, 172032));
+int  t3483f25 = TEMP_FAILURE_RETRY(open("file19", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 100, 0));
+int  t3483f26 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f26, buf, 1, 0));
+close(t3483f26);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 0));
+t3483f26 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f26, buf, 1, 0));
+close(t3483f26);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+t3483f26 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f26, buf, 1, 0));
+close(t3483f26);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 8192));
+t3483f26 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f26, buf, 1, 0));
+close(t3483f26);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+t3483f26 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f26, buf, 1, 0));
+close(t3483f26);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 12288));
+int  t3483f27 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f27, buf, 1, 0));
+close(t3483f27);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 40960));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 110592));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 172032));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 151552));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 77824));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 155648));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 180224));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 106496));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 167936));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 94208));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 163840));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 49152));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 159744));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 176128));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 36864));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 98304));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 61440));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 86016));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 147456));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 143360));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 45056));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 73728));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 32768));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 122880));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 126976));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 28672));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 53248));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 118784));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 57344));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 135168));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 65536));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 184320));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 69632));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 81920));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 90112));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 102400));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 114688));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 131072));
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 4096, 139264));
+t3483f27 = TEMP_FAILURE_RETRY(open("file20", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3483f27, buf, 1, 0));
+close(t3483f27);
+TEMP_FAILURE_RETRY(pread(t3483f25, buf, 16, 24));
+int  t3498f30 = TEMP_FAILURE_RETRY(open("file21", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3498f30, buf, 16384));
+close(t3498f30);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 278721));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 19, 278751));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 25119, 278528)); // mmap2
+int  t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 1, 0));
+close(t3499f30);
+int  t3499f31 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f31, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+t3499f30 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+close(t3499f30);
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+close(t3499f31);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 1, 0));
+close(t3499f30);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+t3499f31 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+close(t3499f31);
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+close(t3499f30);
+int  t3500f30 = TEMP_FAILURE_RETRY(open("file23", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 27898, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4124, 24576)); // mmap2
+close(t3500f30);
+t3500f30 = TEMP_FAILURE_RETRY(open("file24", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 91256, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4108, 90112)); // mmap2
+close(t3500f30);
+t3500f30 = TEMP_FAILURE_RETRY(open("file25", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 30332, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4200, 28672)); // mmap2
+close(t3500f30);
+t3500f30 = TEMP_FAILURE_RETRY(open("file26", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 26408, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4100, 24576)); // mmap2
+close(t3500f30);
+t3500f30 = TEMP_FAILURE_RETRY(open("file27", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 50044, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4128, 49152)); // mmap2
+close(t3500f30);
+t3500f30 = TEMP_FAILURE_RETRY(open("file28", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 1048576, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3500f30, buf, 122564, 3059712)); // mmap2
+close(t3500f30);
+int  t3502f30 = TEMP_FAILURE_RETRY(open("file29", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 4));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 44));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 29));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 36));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 21));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 17));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 47));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 23));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 28));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 24));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 45));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 21));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 37));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 22));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 17));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 36));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 37));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 22));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 22));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 46));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 29));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 31));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 32));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 31));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 37));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 1));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 2));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 21));
+TEMP_FAILURE_RETRY(read(t3502f30, buf, 8));
+close(t3502f30);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35167565));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 35167595));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4148, 35164160)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34342181));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34342211));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1656, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32761881));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 32761911));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3104, 32759808)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34343387));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 32, 34343417));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2828, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34343692));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 34343722));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3201, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34344392));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 34344422));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3897, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34344065));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 34344095));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3528, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34344761));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 34344791));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4269, 34340864)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34345456));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 34345486));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 865, 34344960)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34345133));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 34345163));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 496, 34344960)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36096678));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 36096708));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3292, 36093952)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34698049));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 34698079));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1211, 34697216)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32760711));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 31, 32760741));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2073, 32759808)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32273035));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 32273065));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1692, 32272384)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34612102));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 34612132));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1313, 34611200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34765885));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 34765915));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3387, 34762752)); // mmap2
+t3499f31 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f31, buf, 1, 0));
+close(t3499f31);
+t3499f31 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f31, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+int  t3499f32 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f32));
+close(t3499f32);
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+close(t3499f31);
+t3499f31 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f31, buf, 1, 0));
+close(t3499f31);
+t3499f31 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f31, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+t3499f32 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f32));
+close(t3499f32);
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+TEMP_FAILURE_RETRY(pwrite(t3499f31, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f31));
+close(t3499f31);
+int  t3492f31 = TEMP_FAILURE_RETRY(open("file30", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 100, 0));
+int  t3492f32 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f32, buf, 1, 0));
+close(t3492f32);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 0));
+t3492f32 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f32, buf, 1, 0));
+close(t3492f32);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+t3492f32 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f32, buf, 1, 0));
+close(t3492f32);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 8192));
+t3492f32 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f32, buf, 1, 0));
+close(t3492f32);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+t3492f32 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f32, buf, 1, 0));
+close(t3492f32);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35635385));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 35635415));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1005, 35635200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 12288));
+int  t3492f33 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 1, 0));
+close(t3492f33);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 77824));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 73728));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 69632));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 81920));
+t3492f33 = TEMP_FAILURE_RETRY(open("file32", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 23336, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36386416));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 32, 36386446));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2082, 36384768)); // mmap2
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 1, 0));
+close(t3499f30);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+int  t3499f34 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f34));
+close(t3499f34);
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+close(t3499f30);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 1, 0));
+close(t3499f30);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+t3499f34 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f34));
+close(t3499f34);
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+close(t3499f30);
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 1, 0));
+close(t3499f30);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36389306));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 23, 36389336));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1664, 36388864)); // mmap2
+t3499f30 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f30, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+t3499f34 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f34));
+close(t3499f34);
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+TEMP_FAILURE_RETRY(pwrite(t3499f30, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f30));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34762881));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 54, 34762911));
+close(t3499f30);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 463, 34762752)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28270957));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 28270987));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 667, 28270592)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34750025));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 34750055));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4004, 34746368)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 1468611));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 1468641));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58877, 1466368)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31697557));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 31697587));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3884, 31694848)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34293434));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 34293464));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2090, 34291712)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32918186));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 32918216));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3139, 32915456)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32915891));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 32915921));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2060, 32915456)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32917516));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 32917546));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2476, 32915456)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32918595));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 32918625));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4994, 32915456)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32917932));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 35, 32917962));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2730, 32915456)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35461407));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 31, 35461437));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2723, 35459072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35474138));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 35474168));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3682, 35471360)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34394223));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 34394253));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 481, 34394112)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32648704));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 32648734));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4644, 32645120)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32654567));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58, 32654597));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1606, 32653312)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32649764));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 52, 32649794));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1553, 32649216)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32654918));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 62, 32654948));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1979, 32653312)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31696162));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 56, 31696192));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2367, 31694848)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 9032, 20480)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 24216, 28672)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 25168, 49152)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 10560, 73728)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 13256, 81920)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 6664, 94208)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 22688, 98304)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 57408, 118784)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f33, buf, 3064, 176128)); // mmap2
+close(t3492f33);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36097244));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 36097274));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3608, 36093952)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36096678));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 36096708));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3292, 36093952)); // mmap2
+int  t3509f41 = TEMP_FAILURE_RETRY(open("file33", O_RDONLY|O_LARGEFILE));
+int  t3492f42 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f42, buf, 1, 0));
+close(t3492f42);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 53248));
+int  t3499f42 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f42, buf, 1, 0));
+close(t3499f42);
+TEMP_FAILURE_RETRY(read(t3509f41, buf, 8192));
+TEMP_FAILURE_RETRY(read(t3509f41, buf, 8091));
+close(t3509f41);
+int  t3499f41 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f41, buf, 1, 0));
+close(t3499f41);
+t3499f41 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f41, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+t3499f42 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f42));
+close(t3499f42);
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+close(t3499f41);
+t3499f41 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f41, buf, 1, 0));
+close(t3499f41);
+t3499f41 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f41, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+t3499f42 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f42));
+close(t3499f42);
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+TEMP_FAILURE_RETRY(pwrite(t3499f41, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+close(t3499f41);
+t3499f41 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f41, buf, 1, 0));
+close(t3499f41);
+int  t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+int  t3492f40 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f40, buf, 1, 0));
+close(t3492f40);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 36864));
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+t3499f42 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f42));
+close(t3499f42);
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+t3499f42 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f42));
+close(t3499f42);
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+t3499f42 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f42));
+close(t3499f42);
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+int  t3492f41 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f41, buf, 1, 0));
+close(t3492f41);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 45056));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 90112));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 94208));
+t3492f41 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f41, buf, 1, 0));
+close(t3492f41);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 61440));
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35636928));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 60, 35636958));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2062, 35635200)); // mmap2
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+t3499f41 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f41));
+close(t3499f41);
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 1, 0));
+close(t3499f40);
+t3499f40 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f40, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+int  t3508f42 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(lseek(t3508f42, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3508f42, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3508f42, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3508f42, buf, 769726, 38187008)); // mmap2
+close(t3508f42);
+t3508f42 = TEMP_FAILURE_RETRY(open("file0", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(lseek(t3508f42, 0, SEEK_END));
+TEMP_FAILURE_RETRY(lseek(t3508f42, 38891199, SEEK_SET));
+TEMP_FAILURE_RETRY(read(t3508f42, buf, 65557));
+TEMP_FAILURE_RETRY(pread(t3508f42, buf, 769726, 38187008)); // mmap2
+close(t3508f42);
+int  t3499f43 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f43));
+close(t3499f43);
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+TEMP_FAILURE_RETRY(pwrite(t3499f40, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f40));
+close(t3499f40);
+int  t3508f40 = TEMP_FAILURE_RETRY(open("file16", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3508f40, buf, 14048, 0)); // mmap2
+close(t3508f40);
+int  t3499f33 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f33, buf, 1, 0));
+close(t3499f33);
+t3499f33 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f33, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+int  t3499f39 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f39));
+close(t3499f39);
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+close(t3499f33);
+t3499f33 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f33, buf, 1, 0));
+close(t3499f33);
+t3499f33 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f33, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+t3499f39 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f39));
+close(t3499f39);
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+TEMP_FAILURE_RETRY(pwrite(t3499f33, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f33));
+close(t3499f33);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35635115));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 35635145));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4281, 35631104)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35448800));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 31, 35448830));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2408, 35446784)); // mmap2
+int  t3519f33 = TEMP_FAILURE_RETRY(open("file34", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f33, buf, 1422));
+TEMP_FAILURE_RETRY(read(t3519f33, buf, 1));
+close(t3519f33);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35378185));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35378215));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1535, 35377152)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35378687));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35378717));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2578, 35377152)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35194783));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 27, 35194813));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2574, 35192832)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34408303));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 34408333));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2280, 34406400)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32465635));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 32465665));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4145, 32464896)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35284839));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 35284869));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2433, 35282944)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34435656));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 34435686));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 905, 34435072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32557274));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 64, 32557304));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 8345, 32555008)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32547670));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 63, 32547700));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 10458, 32546816)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32547259));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 32547289));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 854, 32546816)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35562037));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 35562067));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1486, 35561472)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34535858));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34535888));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2793, 34533376)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34103026));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 34103056));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4170, 34099200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35453961));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 35453991));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3619, 35450880)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29898896));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 29898926));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2817, 29896704)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28212186));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 28212216));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3308, 28209152)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28212460));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 28212490));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3585, 28209152)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34435977));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 34436007));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1227, 34435072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29899521));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 53, 29899551));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3195, 29896704)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29898513));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 29898543));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2192, 29896704)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35344567));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35344597));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 529, 35344384)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35344913));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35344943));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1043, 35344384)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32576839));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 32576869));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 5361, 32575488)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35254403));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 35254433));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 650, 35254272)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35722278));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 35722308));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1541, 35721216)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35894101));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 51, 35894131));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1698, 35893248)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34723655));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 34723685));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2180, 34721792)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35610903));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35610933));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 726, 35610624)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35722757));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 35722787));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1939, 35721216)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35283991));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 35284021));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1461, 35282944)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35276797));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35276827));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2365, 35274752)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29897692));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 29897722));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1809, 29896704)); // mmap2
+int  t3523f49 = TEMP_FAILURE_RETRY(open("file33", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3523f49, buf, 8192));
+TEMP_FAILURE_RETRY(read(t3523f49, buf, 8091));
+close(t3523f49);
+int  t3455f50 = TEMP_FAILURE_RETRY(open("file7", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+close(t3455f50);
+t3455f50 = TEMP_FAILURE_RETRY(open("file35", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 117507, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4100, 114688)); // mmap2
+close(t3455f50);
+t3455f50 = TEMP_FAILURE_RETRY(open("file36", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 187587, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4128, 188416)); // mmap2
+close(t3455f50);
+t3455f50 = TEMP_FAILURE_RETRY(open("file24", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+close(t3455f50);
+t3455f50 = TEMP_FAILURE_RETRY(open("file37", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 155576, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4104, 155648)); // mmap2
+close(t3455f50);
+t3455f50 = TEMP_FAILURE_RETRY(open("file38", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 61218, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f50, buf, 4280, 61440)); // mmap2
+close(t3455f50);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29922405));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 29922435));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1962, 29921280)); // mmap2
+int  t3499f50 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f50, buf, 1, 0));
+close(t3499f50);
+t3499f50 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f50, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+int  t3499f52 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f52));
+close(t3499f52);
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+close(t3499f50);
+t3499f50 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f50, buf, 1, 0));
+close(t3499f50);
+t3499f50 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f50, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+t3499f52 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f52));
+close(t3499f52);
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+TEMP_FAILURE_RETRY(pwrite(t3499f50, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f50));
+close(t3499f50);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34609966));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 26, 34609996));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3291, 34607104)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31439600));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 31439630));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3729, 31436800)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 33255456));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 33255486));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 795, 33255424)); // mmap2
+int  t3492f52 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f52, buf, 1, 0));
+close(t3492f52);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 4096, 28672));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35345427));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 31, 35345457));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1460, 35344384)); // mmap2
+t3492f52 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f52, buf, 1, 0));
+close(t3492f52);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35946630));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 27, 35946660));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 376, 35946496)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35282311));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 35, 35282341));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4412, 35278848)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28266007));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 28266037));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3898, 28262400)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28271259));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 28271289));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 960, 28270592)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29218555));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 29218585));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2281, 29216768)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28771544));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 28771574));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2470, 28770304)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31103055));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 31103085));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3471, 31100928)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34430076));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34430106));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3543, 34426880)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32574817));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 32574847));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4265, 32571392)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511105));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35511135));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3217, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511441));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35511471));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3780, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29943458));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 29943488));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2309, 29941760)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513993));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35514023));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2120, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34446657));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 53, 34446687));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3721, 34443264)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
+int  t3526f50 = TEMP_FAILURE_RETRY(open("file39", O_RDONLY|O_LARGEFILE));
+int  t3526f52 = TEMP_FAILURE_RETRY(open("file40", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3526f52, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3526f52, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3526f52, buf, 1584, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3526f52, buf, 4172, 0)); // mmap2
+close(t3526f52);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34434708));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34434738));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4060, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32576277));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 32576307));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1351, 32575488)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31155301));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 31155331));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1721, 31154176)); // mmap2
+TEMP_FAILURE_RETRY(read(t3526f50, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f50, buf, 16384));
+close(t3526f50);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34433783));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 34433813));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3113, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32575657));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 32575687));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 451, 32575488)); // mmap2
+int  t3519f50 = TEMP_FAILURE_RETRY(open("file41", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+close(t3519f50);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36042811));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 36042841));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2688, 36040704)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31522913));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 31522943));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2245, 31522816)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29920348));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 29920378));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 5221, 29917184)); // mmap2
+int  t3527f50 = TEMP_FAILURE_RETRY(open("file42", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3527f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3527f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32567874));
+TEMP_FAILURE_RETRY(pread(t3527f50, buf, 26358, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 53, 32567904));
+TEMP_FAILURE_RETRY(pread(t3527f50, buf, 4160, 24576)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 6297, 32567296)); // mmap2
+close(t3527f50);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32566237));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 32566267));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4674, 32563200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32564659));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 32564689));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3037, 32563200)); // mmap2
+t3519f50 = TEMP_FAILURE_RETRY(open("file43", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+close(t3519f50);
+int  t3492f50 = TEMP_FAILURE_RETRY(open("file44", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f50, buf, 52, 0));
+TEMP_FAILURE_RETRY(pread(t3492f50, buf, 4096, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f50, buf, 10313, 0)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3492f50, buf, 4136, 8192)); // mmap2
+close(t3492f50);
+t3519f50 = TEMP_FAILURE_RETRY(open("file45", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f50, buf, 16384));
+t3526f52 = TEMP_FAILURE_RETRY(open("file46", O_RDONLY|O_LARGEFILE));
+close(t3519f50);
+TEMP_FAILURE_RETRY(read(t3526f52, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f52, buf, 16384));
+close(t3526f52);
+int  t3532f53 = TEMP_FAILURE_RETRY(open("file47", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f53, buf, 16384));
+int  t3533f47 = TEMP_FAILURE_RETRY(open("file48", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f53, buf, 16384));
+close(t3532f53);
+TEMP_FAILURE_RETRY(read(t3533f47, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f47, buf, 16384));
+close(t3533f47);
+int  t3519f43 = TEMP_FAILURE_RETRY(open("file49", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f43, buf, 16384));
+close(t3519f43);
+int  t3532f43 = TEMP_FAILURE_RETRY(open("file50", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f43, buf, 16384));
+close(t3532f43);
+int  t3533f43 = TEMP_FAILURE_RETRY(open("file51", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f43, buf, 16384));
+close(t3533f43);
+t3519f43 = TEMP_FAILURE_RETRY(open("file52", O_RDONLY|O_LARGEFILE));
+t3532f53 = TEMP_FAILURE_RETRY(open("file53", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f43, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f53, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f53, buf, 16384));
+close(t3519f43);
+close(t3532f53);
+int  t3492f57 = TEMP_FAILURE_RETRY(open("file54", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3492f57, buf, 39938));
+close(t3492f57);
+int  t3492f61 = TEMP_FAILURE_RETRY(open("file55", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3492f61, buf, 8192));
+TEMP_FAILURE_RETRY(read(t3492f61, buf, 8192));
+close(t3492f61);
+t3492f61 = TEMP_FAILURE_RETRY(open("file56", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3492f61, buf, 8192));
+TEMP_FAILURE_RETRY(read(t3492f61, buf, 8192));
+close(t3492f61);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34957756));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 34957786));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3273, 34955264)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34267550));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34267580));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 722, 34267136)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34439777));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 34439807));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 920, 34439168)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35154576));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 35154606));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3467, 35151872)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34418681));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 34418711));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 339, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31439600));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 31439630));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3729, 31436800)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34420375));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 34420405));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2143, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31439101));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 31439131));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2800, 31436800)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34420831));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34420861));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2549, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31442196));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 31442226));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2300, 31440896)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34421573));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 34421603));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3344, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34429110));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 51, 34429140));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2566, 34426880)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32573593));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 32573623));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2814, 32571392)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36353719));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 36353749));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2179, 36352000)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34434392));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34434422));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3732, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34442017));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 34442047));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3276, 34439168)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34957756));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 34957786));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3273, 34955264)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35154576));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 35154606));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3467, 35151872)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34433472));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34433502));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2807, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34438470));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 63, 34438500));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3681, 34435072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35281553));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35281583));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3463, 35278848)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34419413));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 51, 34419443));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1188, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511105));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35511135));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3217, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511441));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35511471));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3780, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513993));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35514023));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2120, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28977951));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 28977981));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3292, 28975104)); // mmap2
+int  t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 1, 0));
+close(t3499f55);
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+int  t3499f56 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f56));
+close(t3499f56);
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+close(t3499f55);
+int  t3505f55 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f55, buf, 1, 0));
+close(t3505f55);
+int  t3519f55 = TEMP_FAILURE_RETRY(open("file57", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f55, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f55, buf, 16384));
+close(t3519f55);
+int  t3532f55 = TEMP_FAILURE_RETRY(open("file58", O_RDONLY|O_LARGEFILE));
+t3499f56 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f56, buf, 1, 0));
+close(t3499f56);
+TEMP_FAILURE_RETRY(read(t3532f55, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f55, buf, 16384));
+close(t3532f55);
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+int  t3505f56 = TEMP_FAILURE_RETRY(open("file59", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+int  t3499f59 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f59));
+close(t3499f59);
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+close(t3499f55);
+int  t3533f55 = TEMP_FAILURE_RETRY(open("file60", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f55, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f55, buf, 16384));
+close(t3533f55);
+int  t3499f58 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f58, buf, 1, 0));
+close(t3499f58);
+t3499f58 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f58, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f58));
+t3499f59 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f59));
+close(t3499f59);
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f58));
+TEMP_FAILURE_RETRY(pwrite(t3499f58, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f58));
+close(t3499f58);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36353719));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 36353749));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2179, 36352000)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34428771));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 59, 34428801));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2230, 34426880)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34441089));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 34441119));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2381, 34439168)); // mmap2
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 1, 0));
+close(t3499f55);
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+t3499f58 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f58));
+close(t3499f58);
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+close(t3499f55);
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 1, 0));
+close(t3499f55);
+t3499f55 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f55, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+t3499f58 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f58));
+close(t3499f58);
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+TEMP_FAILURE_RETRY(pwrite(t3499f55, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f55));
+close(t3499f55);
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 20552));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35601253));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 35601283));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3224, 35598336)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35601560));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 35601590));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3832, 35598336)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511441));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35511471));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3780, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29923242));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 29923272));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3511, 29921280)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28272466));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 28272496));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2171, 28270592)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513993));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35514023));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2120, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34446657));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 53, 34446687));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3721, 34443264)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 16008));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31153857));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 31153887));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4461, 31150080)); // mmap2
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 10864));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34907552));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 34907582));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2551, 34906112)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31809921));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 71, 31809951));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 7755, 31809536)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34423668));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 60, 34423698));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1203, 34422784)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 30431338));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 30431368));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4400, 30429184)); // mmap2
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 14320));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34416128));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 34416158));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1855, 34414592)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29893363));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 66, 29893393));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1244, 29892608)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29892892));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58, 29892922));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 755, 29892608)); // mmap2
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 12208));
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 20736));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36353719));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 43, 36353749));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2179, 36352000)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 8936));
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 2800));
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 20216));
+TEMP_FAILURE_RETRY(read(t3505f56, buf, 16912));
+close(t3505f56);
+t3505f56 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f56, buf, 1, 0));
+close(t3505f56);
+t3505f56 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 16924));
+int  t3499f62 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f62, buf, 1, 0));
+close(t3499f62);
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 16928));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 16932));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 21028));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 21032));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4096, 21036));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 4, 25132));
+t3499f62 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f62, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+int  t3499f68 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f68));
+close(t3499f68);
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+TEMP_FAILURE_RETRY(pread(t3505f56, buf, 8, 25600));
+TEMP_FAILURE_RETRY(fdatasync(t3505f56));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+close(t3499f62);
+int  t3505f62 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3505f62));
+close(t3505f62);
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f56));
+TEMP_FAILURE_RETRY(pwrite(t3505f56, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f56));
+close(t3505f56);
+t3505f56 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f56, buf, 1, 0));
+close(t3505f56);
+int  t3533f56 = TEMP_FAILURE_RETRY(open("file61", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f56, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f56, buf, 16384));
+close(t3533f56);
+int  t3532f56 = TEMP_FAILURE_RETRY(open("file62", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f56, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f56, buf, 16384));
+close(t3532f56);
+t3532f56 = TEMP_FAILURE_RETRY(open("file63", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f56, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f56, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f56, buf, 16384));
+close(t3532f56);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36042811));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 36042841));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2688, 36040704)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29922405));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 29922435));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1962, 29921280)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31522913));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 31522943));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2245, 31522816)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29920348));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 29920378));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 5221, 29917184)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32567874));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 53, 32567904));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 6297, 32567296)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32566237));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 32566267));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4674, 32563200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 32564659));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 32564689));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3037, 32563200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35154576));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 35154606));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3467, 35151872)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34420375));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 34420405));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2143, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34420831));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34420861));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2549, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34421573));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 34421603));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3344, 34418688)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34438470));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 63, 34438500));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3681, 34435072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36457841));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 36457871));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4242, 36454400)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35939717));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 35939747));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1726, 35938304)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 28356265));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 28356295));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4322, 28352512)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 29935078));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 50, 29935108));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1983, 29933568)); // mmap2
+int  t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 1, 0));
+close(t3499f66);
+t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36467015));
+int  t3532f68 = TEMP_FAILURE_RETRY(open("file64", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 36467045));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1083, 36466688)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+TEMP_FAILURE_RETRY(read(t3532f68, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f68, buf, 16384));
+int  t3499f73 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(read(t3532f68, buf, 16384));
+TEMP_FAILURE_RETRY(fdatasync(t3499f73));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34267550));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34267580));
+close(t3499f73);
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 12, 0));
+close(t3532f68);
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 722, 34267136)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+close(t3499f66);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511105));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35511135));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3217, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511441));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35511471));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3780, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513993));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35514023));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2120, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
+int  t3532f61 = TEMP_FAILURE_RETRY(open("file65", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+close(t3532f61);
+int  t3533f61 = TEMP_FAILURE_RETRY(open("file66", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+close(t3533f61);
+t3532f61 = TEMP_FAILURE_RETRY(open("file67", O_RDONLY|O_LARGEFILE));
+t3499f62 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f62, buf, 1, 0));
+close(t3499f62);
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+close(t3532f61);
+t3533f61 = TEMP_FAILURE_RETRY(open("file68", O_RDONLY|O_LARGEFILE));
+t3499f62 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 512, 0));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 512));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 8716));
+close(t3533f61);
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f62, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+int  t3499f61 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f61));
+close(t3499f61);
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+TEMP_FAILURE_RETRY(pwrite(t3499f62, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f62));
+t3532f61 = TEMP_FAILURE_RETRY(open("file69", O_RDONLY|O_LARGEFILE));
+close(t3499f62);
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3532f61, buf, 16384));
+close(t3532f61);
+t3533f61 = TEMP_FAILURE_RETRY(open("file70", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f61, buf, 16384));
+close(t3533f61);
+int  t3519f61 = TEMP_FAILURE_RETRY(open("file71", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f61, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3519f61, buf, 16384));
+close(t3519f61);
+int  t3499f80 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f80, buf, 1, 0));
+close(t3499f80);
+t3499f80 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f80, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f80));
+int  t3499f81 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f81));
+close(t3499f81);
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f80));
+TEMP_FAILURE_RETRY(pwrite(t3499f80, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f80));
+close(t3499f80);
+t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 1, 0));
+close(t3499f66);
+t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+t3499f68 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f68));
+close(t3499f68);
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+close(t3499f66);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34957756));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 29, 34957786));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3273, 34955264)); // mmap2
+int  t3519f68 = TEMP_FAILURE_RETRY(open("file72", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file73", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file74", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file75", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file76", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file77", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file78", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file79", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file80", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file81", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file82", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+int  t3519f70 = TEMP_FAILURE_RETRY(open("file83", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+t3519f68 = TEMP_FAILURE_RETRY(open("file84", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file85", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file86", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file87", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file88", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file89", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file90", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file91", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file92", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f70 = TEMP_FAILURE_RETRY(open("file93", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+t3519f70 = TEMP_FAILURE_RETRY(open("file94", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+t3519f70 = TEMP_FAILURE_RETRY(open("file95", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+int  t3492f72 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f72, buf, 1, 0));
+close(t3492f72);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+close(t3519f70);
+int  t3492f70 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3492f70, buf, 1, 0));
+close(t3492f70);
+TEMP_FAILURE_RETRY(pread(t3492f31, buf, 16, 24));
+t3519f68 = TEMP_FAILURE_RETRY(open("file96", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file97", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file98", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file99", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file100", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file101", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file102", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file103", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file104", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file105", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file106", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file107", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file108", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+t3519f68 = TEMP_FAILURE_RETRY(open("file109", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f68);
+int  t3519f72 = TEMP_FAILURE_RETRY(open("file110", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f72);
+int  t3519f80 = TEMP_FAILURE_RETRY(open("file111", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f80);
+int  t3519f81 = TEMP_FAILURE_RETRY(open("file112", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f81);
+t3519f81 = TEMP_FAILURE_RETRY(open("file113", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f81);
+int  t3519f76 = TEMP_FAILURE_RETRY(open("file114", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f76);
+t3519f70 = TEMP_FAILURE_RETRY(open("file115", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+t3519f70 = TEMP_FAILURE_RETRY(open("file116", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+t3519f70 = TEMP_FAILURE_RETRY(open("file117", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f70);
+int  t3519f67 = TEMP_FAILURE_RETRY(open("file118", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file119", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file120", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file121", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file122", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file123", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file124", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file125", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file126", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f67 = TEMP_FAILURE_RETRY(open("file127", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3519f67);
+t3519f70 = TEMP_FAILURE_RETRY(open("file128", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3519f70);
+int  t3526f70 = TEMP_FAILURE_RETRY(open("file129", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+int  t3519f75 = TEMP_FAILURE_RETRY(open("file128", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+close(t3526f70);
+t3526f70 = TEMP_FAILURE_RETRY(open("file129", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f75, buf, 2991));
+close(t3519f75);
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 3974));
+close(t3526f70);
+t3519f67 = TEMP_FAILURE_RETRY(open("file130", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f67, buf, 16384));
+int  t3499f72 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f72, buf, 1, 0));
+close(t3499f72);
+TEMP_FAILURE_RETRY(read(t3519f67, buf, 16384));
+t3499f72 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 8716));
+close(t3519f67);
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f72, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+int  t3499f67 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f67));
+close(t3499f67);
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+close(t3499f72);
+t3526f70 = TEMP_FAILURE_RETRY(open("file131", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f70);
+t3526f70 = TEMP_FAILURE_RETRY(open("file131", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 4622));
+close(t3526f70);
+int  t3526f72 = TEMP_FAILURE_RETRY(open("file132", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f72);
+t3526f72 = TEMP_FAILURE_RETRY(open("file132", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f72, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f72, buf, 6849));
+close(t3526f72);
+t3526f70 = TEMP_FAILURE_RETRY(open("file133", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f70);
+int  t3526f75 = TEMP_FAILURE_RETRY(open("file133", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f75, buf, 13332));
+close(t3526f75);
+int  t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3495f70, buf, 1, 0));
+close(t3495f70);
+t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3495f70, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+int  t3495f75 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3495f75));
+close(t3495f75);
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+close(t3495f70);
+int  t3526f93 = TEMP_FAILURE_RETRY(open("file134", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f93);
+int  t3526f88 = TEMP_FAILURE_RETRY(open("file134", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f88, buf, 15056));
+close(t3526f88);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34433108));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 56, 34433138));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2496, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34432434));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 50, 34432464));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1795, 34430976)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34431679));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 72, 34431709));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1083, 34430976)); // mmap2
+t3495f75 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3495f75, buf, 1, 0));
+close(t3495f75);
+t3495f75 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3495f75, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3495f75));
+int  t3495f86 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3495f86));
+close(t3495f86);
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f75));
+TEMP_FAILURE_RETRY(pwrite(t3495f75, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f75));
+close(t3495f75);
+int  t3499f74 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f74, buf, 1, 0));
+close(t3499f74);
+t3499f74 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f74, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f74));
+int  t3499f75 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f75));
+close(t3499f75);
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f74));
+TEMP_FAILURE_RETRY(pwrite(t3499f74, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f74));
+close(t3499f74);
+int  t3526f64 = TEMP_FAILURE_RETRY(open("file135", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f64);
+t3526f64 = TEMP_FAILURE_RETRY(open("file135", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f64, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f64, buf, 4873));
+close(t3526f64);
+int  t3526f90 = TEMP_FAILURE_RETRY(open("file136", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file136", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 4199));
+close(t3526f90);
+int  t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
+close(t3499f90);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511105));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 28, 35511135));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3217, 35508224)); // mmap2
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35511441));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 40, 35511471));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3780, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35512004));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 35512034));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4299, 35508224)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+int  t3499f92 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513993));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 34, 35514023));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2120, 35512320)); // mmap2
+close(t3499f92);
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35513539));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 37, 35513569));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1673, 35512320)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+t3499f92 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+t3499f92 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+close(t3499f90);
+int  t3495f72 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3495f72, buf, 1, 0));
+close(t3495f72);
+int  t3499f84 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f84, buf, 1, 0));
+close(t3499f84);
+t3499f72 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 516));
+int  t3495f84 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 512));
+TEMP_FAILURE_RETRY(pread(t3499f72, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4096, 516));
+int  t3499f88 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f88));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 4616));
+close(t3499f88);
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 12, 0));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3495f84, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3495f84));
+TEMP_FAILURE_RETRY(pwrite(t3499f72, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+int  t3495f88 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31156572));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58, 31156602));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3099, 31154176)); // mmap2
+TEMP_FAILURE_RETRY(fdatasync(t3495f88));
+close(t3499f72);
+close(t3495f88);
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f84));
+TEMP_FAILURE_RETRY(pwrite(t3495f84, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f84));
+close(t3495f84);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34907552));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 39, 34907582));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2551, 34906112)); // mmap2
+int  t3495f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3495f66, buf, 1, 0));
+close(t3495f66);
+t3495f66 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3495f66, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3495f66));
+t3495f72 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3495f72));
+close(t3495f72);
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f66));
+TEMP_FAILURE_RETRY(pwrite(t3495f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f66));
+close(t3495f66);
+t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 1, 0));
+close(t3499f66);
+t3499f66 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f66, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+int  t3499f70 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f70));
+close(t3499f70);
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+TEMP_FAILURE_RETRY(pwrite(t3499f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f66));
+close(t3499f66);
+int  t3526f66 = TEMP_FAILURE_RETRY(open("file137", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f66, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f66, buf, 16384));
+close(t3526f66);
+int  t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 1, 0));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file138", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+t3526f70 = TEMP_FAILURE_RETRY(open("file139", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 16384));
+close(t3526f70);
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 10432));
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 4464));
+t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3495f70, buf, 1, 0));
+close(t3495f70);
+t3495f70 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3495f70, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+t3495f72 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3495f72));
+close(t3495f72);
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+TEMP_FAILURE_RETRY(pwrite(t3495f70, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3495f70));
+close(t3495f70);
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 10592));
+int  t3533f70 = TEMP_FAILURE_RETRY(open("file140", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f70);
+t3533f70 = TEMP_FAILURE_RETRY(open("file140", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f70, buf, 4042));
+close(t3533f70);
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 9664));
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 23656));
+t3533f70 = TEMP_FAILURE_RETRY(open("file141", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f70);
+t3526f70 = TEMP_FAILURE_RETRY(open("file142", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+int  t3533f72 = TEMP_FAILURE_RETRY(open("file141", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+close(t3526f70);
+t3526f70 = TEMP_FAILURE_RETRY(open("file142", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f70, buf, 5057));
+TEMP_FAILURE_RETRY(read(t3533f72, buf, 4595));
+close(t3526f70);
+close(t3533f72);
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 19744));
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 9344));
+t3499f70 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f70, buf, 1, 0));
+close(t3499f70);
+t3499f70 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f70, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f70));
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 24672));
+t3499f72 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f72));
+close(t3499f72);
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f70));
+TEMP_FAILURE_RETRY(pwrite(t3499f70, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f70));
+close(t3499f70);
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 7584));
+TEMP_FAILURE_RETRY(read(t3505f66, buf, 10736));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 1, 0));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 16928));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 16932));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 21028));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 21032));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 21036));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 25132));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 8, 25600));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+int  t3505f70 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3505f70));
+close(t3505f70);
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 1, 0));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 1, 0));
+close(t3505f66);
+t3505f66 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3505f66, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+t3505f70 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3505f70));
+close(t3505f70);
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+TEMP_FAILURE_RETRY(pwrite(t3505f66, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f66));
+close(t3505f66);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 36227657));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 38, 36227687));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3166, 36225024)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 30377994));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 33, 30378024));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4545, 30375936)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35333764));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 45, 35333794));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3019, 35332096)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34435036));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 34435066));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 324, 34435072)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34742552));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 34742582));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 602, 34742272)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31308722));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 42, 31308752));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3902, 31305728)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31307465));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 46, 31307495));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2994, 31305728)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31306529));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 41, 31306559));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1737, 31305728)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34261624));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 49, 34261654));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2993, 34258944)); // mmap2
+int  t3533f91 = TEMP_FAILURE_RETRY(open("file143", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f91);
+t3533f91 = TEMP_FAILURE_RETRY(open("file143", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31210525));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 31210555));
+TEMP_FAILURE_RETRY(read(t3533f91, buf, 16384));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3673, 31207424)); // mmap2
+TEMP_FAILURE_RETRY(read(t3533f91, buf, 2024));
+close(t3533f91);
+int  t3499f91 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f91, buf, 1, 0));
+close(t3499f91);
+t3499f91 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f91, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f91));
+int  t3499f93 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f93));
+close(t3499f93);
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f91));
+TEMP_FAILURE_RETRY(pwrite(t3499f91, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f91));
+close(t3499f91);
+int  t3505f84 = TEMP_FAILURE_RETRY(open("file31", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f84, buf, 1, 0));
+close(t3505f84);
+t3505f84 = TEMP_FAILURE_RETRY(open("file31", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3505f84, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3505f84));
+int  t3505f90 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3505f90));
+close(t3505f90);
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f84));
+TEMP_FAILURE_RETRY(pwrite(t3505f84, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3505f84));
+close(t3505f84);
+int  t3533f102 = TEMP_FAILURE_RETRY(open("file144", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f102);
+t3533f72 = TEMP_FAILURE_RETRY(open("file144", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f72, buf, 5550));
+close(t3533f72);
+int  t3526f84 = TEMP_FAILURE_RETRY(open("file145", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f84);
+int  t3526f101 = TEMP_FAILURE_RETRY(open("file145", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f101, buf, 3612));
+close(t3526f101);
+t3526f90 = TEMP_FAILURE_RETRY(open("file146", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file146", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 5414));
+int  t3533f96 = TEMP_FAILURE_RETRY(open("file147", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f96);
+t3533f96 = TEMP_FAILURE_RETRY(open("file147", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+close(t3526f90);
+TEMP_FAILURE_RETRY(read(t3533f96, buf, 3834));
+close(t3533f96);
+int  t3519f90 = TEMP_FAILURE_RETRY(open("file148", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3519f90);
+t3519f90 = TEMP_FAILURE_RETRY(open("file148", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3519f90, buf, 3461));
+int  t3526f96 = TEMP_FAILURE_RETRY(open("file149", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3526f96);
+close(t3519f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file149", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 12766));
+close(t3526f90);
+int  t3533f90 = TEMP_FAILURE_RETRY(open("file150", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f90);
+t3533f90 = TEMP_FAILURE_RETRY(open("file150", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+int  t3505f96 = TEMP_FAILURE_RETRY(open("file151", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 100, 0));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 10056));
+close(t3533f90);
+t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
+close(t3505f90);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 0));
+t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
+close(t3505f90);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
+close(t3505f90);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 8192));
+t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
+close(t3505f90);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+t3505f90 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+int  t3533f99 = TEMP_FAILURE_RETRY(open("file153", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+close(t3533f99);
+TEMP_FAILURE_RETRY(pread(t3505f90, buf, 1, 0));
+close(t3505f90);
+t3533f90 = TEMP_FAILURE_RETRY(open("file153", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 13271));
+close(t3533f90);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 12288));
+int  t3505f99 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f99, buf, 1, 0));
+close(t3505f99);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 147456));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 151552));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 196608));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 253952));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 303104));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 335872));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 450560));
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 4096, 495616));
+t3505f99 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f99, buf, 1, 0));
+close(t3505f99);
+TEMP_FAILURE_RETRY(pread(t3505f96, buf, 16, 24));
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+int  t3499f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f97));
+close(t3499f97);
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 1, 0));
+close(t3499f90);
+t3499f90 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f90, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+t3499f92 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+TEMP_FAILURE_RETRY(pwrite(t3499f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f90));
+close(t3499f90);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34438470));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 63, 34438500));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3681, 34435072)); // mmap2
+int  t3576f95 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3576f95, buf, 1, 0));
+close(t3576f95);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 1, 0));
+close(t3499f92);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+int  t3499f95 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f95));
+close(t3499f95);
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 1, 0));
+close(t3499f92);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+t3499f95 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f95));
+close(t3499f95);
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 31156572));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58, 31156602));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3099, 31154176)); // mmap2
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+t3576f95 = TEMP_FAILURE_RETRY(open("file152", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3576f95, buf, 1, 0));
+close(t3576f95);
+int  t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 1, 0));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+int  t3499f106 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f106));
+close(t3499f106);
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 1, 0));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+int  t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+close(t3499f105);
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 1, 0));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+close(t3499f105);
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 1, 0));
+close(t3499f100);
+t3499f100 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f100, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+close(t3499f105);
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+TEMP_FAILURE_RETRY(pwrite(t3499f100, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f100));
+close(t3499f100);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35636928));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 60, 35636958));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2062, 35635200)); // mmap2
+t3499f84 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f84, buf, 1, 0));
+close(t3499f84);
+int  t3499f27 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f27, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f27));
+t3499f84 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f84));
+close(t3499f84);
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f27));
+TEMP_FAILURE_RETRY(pwrite(t3499f27, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f27));
+close(t3499f27);
+t3499f27 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f27, buf, 1, 0));
+close(t3499f27);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+t3499f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f97));
+close(t3499f97);
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 1, 0));
+close(t3499f92);
+t3499f92 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3499f92, buf, 8, 17408));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+t3499f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f97));
+close(t3499f97);
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+TEMP_FAILURE_RETRY(pwrite(t3499f92, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f92));
+close(t3499f92);
+int  t3545f92 = TEMP_FAILURE_RETRY(open("file154", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 100, 0));
+int  t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 0));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 8192));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34965811));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 34965841));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3053, 34963456)); // mmap2
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 12288));
+t3545f97 = TEMP_FAILURE_RETRY(open("file156", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3545f97, buf, 8));
+TEMP_FAILURE_RETRY(read(t3545f97, buf, 1));
+close(t3545f97);
+int  t3545f100 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f100, buf, 1, 0));
+close(t3545f100);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 20480));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+t3545f100 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f100));
+close(t3545f100);
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+close(t3545f97);
+int  t3545f104 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f104, buf, 1, 0));
+close(t3545f104);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+int  t3545f29 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f29, buf, 1, 0));
+close(t3545f29);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+t3545f29 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+close(t3545f29);
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f97, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+close(t3545f97);
+int  t3575f29 = TEMP_FAILURE_RETRY(open("file16", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3575f29, buf, 17344));
+close(t3575f29);
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f29 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f29, buf, 1, 0));
+close(t3545f29);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f29 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3545f29, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+t3545f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f97));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+close(t3545f29);
+int  t3499f26 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f26, buf, 1, 0));
+close(t3499f26);
+t3499f26 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f26, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f26));
+t3499f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f97));
+close(t3499f97);
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f26));
+TEMP_FAILURE_RETRY(pwrite(t3499f26, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f26));
+close(t3499f26);
+t3499f26 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f26, buf, 1, 0));
+close(t3499f26);
+int  t3499f28 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f28, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+t3499f97 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f97));
+close(t3499f97);
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+close(t3499f28);
+t3545f97 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f97, buf, 1, 0));
+close(t3545f97);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+int  t3545f90 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f90, buf, 1, 0));
+close(t3545f90);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 28672));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 36864));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 40960));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 45056));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 49152));
+t3545f90 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f90, buf, 1, 0));
+close(t3545f90);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f90 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f90, buf, 1, 0));
+close(t3545f90);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f29 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f29, buf, 1, 0));
+close(t3545f29);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f29 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3545f29, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+t3545f90 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f90));
+close(t3545f90);
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f29, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f29));
+close(t3545f29);
+int  t3545f84 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f84, buf, 1, 0));
+close(t3545f84);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+int  t3584f84 = TEMP_FAILURE_RETRY(open("file157", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 100, 0));
+int  t3584f90 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f90, buf, 1, 0));
+close(t3584f90);
+t3545f90 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pread(t3545f90, buf, 1, 0));
+close(t3545f90);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+t3545f90 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 4, 12820));
+int  t3584f99 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f90, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3545f90));
+TEMP_FAILURE_RETRY(pread(t3584f99, buf, 1, 0));
+close(t3584f99);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+int  t3545f99 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f99));
+close(t3545f99);
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f90));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f90, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f90));
+close(t3545f90);
+int  t3584f29 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f29, buf, 1, 0));
+close(t3584f29);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 8192));
+int  t3584f27 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f27, buf, 1, 0));
+close(t3584f27);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+int  t3545f95 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+t3584f99 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3545f95, buf, 1, 0));
+TEMP_FAILURE_RETRY(pread(t3584f99, buf, 1, 0));
+close(t3545f95);
+close(t3584f99);
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 12288));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 32768));
+t3545f99 = TEMP_FAILURE_RETRY(open("file155", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 8716));
+int  t3584f95 = TEMP_FAILURE_RETRY(open("file159", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3584f95, buf, 8));
+TEMP_FAILURE_RETRY(read(t3584f95, buf, 1));
+close(t3584f95);
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 12824));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4096, 12828));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 16924));
+TEMP_FAILURE_RETRY(pread(t3545f92, buf, 4096, 4096));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 16928));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4096, 16932));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 4, 21028));
+int  t3584f101 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f101, buf, 1, 0));
+close(t3584f101);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 40960));
+t3584f101 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f101, buf, 1, 0));
+close(t3584f101);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 45056));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 49152));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 53248));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 57344));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 61440));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 65536));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 69632));
+t3584f101 = TEMP_FAILURE_RETRY(open("file158", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3584f101, buf, 1, 0));
+close(t3584f101);
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3584f84, buf, 4096, 32768));
+TEMP_FAILURE_RETRY(pread(t3545f99, buf, 8, 21504));
+TEMP_FAILURE_RETRY(fdatasync(t3545f99));
+t3545f95 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3545f95));
+close(t3545f95);
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f99));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 0));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 4096));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 28672));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 32768));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 49152));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 53248));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 57344));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 61440));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 65536));
+TEMP_FAILURE_RETRY(pwrite(t3545f92, buf, 4096, 69632));
+TEMP_FAILURE_RETRY(fdatasync(t3545f92));
+TEMP_FAILURE_RETRY(pwrite(t3545f99, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3545f99));
+close(t3545f99);
+int  t3581f99 = TEMP_FAILURE_RETRY(open("file155", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3581f99, buf, 1, 0));
+close(t3581f99);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34970937));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 48, 34970967));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 3831, 34967552)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34291385));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 47, 34291415));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 4092, 34287616)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 30004037));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 30004067));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2007, 30003200)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35001738));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 44, 35001768));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 1840, 35000320)); // mmap2
+t3533f90 = TEMP_FAILURE_RETRY(open("file160", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+close(t3533f90);
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 1580859));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 1580889));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 60268, 1576960)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 35002160));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 36, 35002190));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2527, 35000320)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 34269564));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 55, 34269594));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 2753, 34267136)); // mmap2
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 30, 1637228));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 31, 1637258));
+TEMP_FAILURE_RETRY(pread(t3455f17, buf, 58435, 1634304)); // mmap2
+t3533f90 = TEMP_FAILURE_RETRY(open("file161", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+close(t3533f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file162", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+close(t3526f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file163", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+close(t3526f90);
+t3533f90 = TEMP_FAILURE_RETRY(open("file164", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3533f90, buf, 16384));
+close(t3533f90);
+t3526f90 = TEMP_FAILURE_RETRY(open("file165", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+TEMP_FAILURE_RETRY(read(t3526f90, buf, 16384));
+close(t3526f90);
+int  t3586f102 = TEMP_FAILURE_RETRY(open("file166", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3586f102);
+int  t3586f97 = TEMP_FAILURE_RETRY(open("file167", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3586f97, buf, 8192));
+TEMP_FAILURE_RETRY(read(t3586f97, buf, 8192));
+close(t3586f97);
+int  t3587f95 = TEMP_FAILURE_RETRY(open("file168", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3587f95, buf, 16384));
+close(t3587f95);
+t3499f28 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f28, buf, 1, 0));
+close(t3499f28);
+int  t3496f28 = TEMP_FAILURE_RETRY(open("file169", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE));
+int  t3499f103 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f103, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f103));
+t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+TEMP_FAILURE_RETRY(read(t3496f28, buf, 8188));
+close(t3499f105);
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f103));
+TEMP_FAILURE_RETRY(read(t3496f28, buf, 3166));
+TEMP_FAILURE_RETRY(pwrite(t3499f103, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f103));
+close(t3499f103);
+TEMP_FAILURE_RETRY(fsync(t3496f28));
+t3499f106 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f106, buf, 1, 0));
+close(t3499f106);
+close(t3496f28);
+t3499f28 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f28, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+t3499f105 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+close(t3499f105);
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+TEMP_FAILURE_RETRY(pwrite(t3499f28, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f28));
+close(t3499f28);
+int  t3541f103 = TEMP_FAILURE_RETRY(open("file170", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 100, 0));
+int  t3541f105 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f105, buf, 1, 0));
+close(t3541f105);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 4096, 0));
+t3541f105 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f105, buf, 1, 0));
+close(t3541f105);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 16, 24));
+t3541f105 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f105, buf, 1, 0));
+close(t3541f105);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 4096, 8192));
+t3541f105 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f105, buf, 1, 0));
+close(t3541f105);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 16, 24));
+t3541f105 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f105, buf, 1, 0));
+close(t3541f105);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 4096, 12288));
+t3541f105 = TEMP_FAILURE_RETRY(open("file172", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3541f105, buf, 8));
+TEMP_FAILURE_RETRY(read(t3541f105, buf, 1));
+close(t3541f105);
+int  t3541f106 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3541f106, buf, 1, 0));
+close(t3541f106);
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3541f103, buf, 4096, 20480));
+int  t3499f107 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f107, buf, 1, 0));
+close(t3499f107);
+t3499f107 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f107, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f107));
+int  t3499f108 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f108));
+close(t3499f108);
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f107));
+TEMP_FAILURE_RETRY(pwrite(t3499f107, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f107));
+close(t3499f107);
+t3499f107 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f107, buf, 1, 0));
+close(t3499f107);
+t3499f105 = TEMP_FAILURE_RETRY(open("file18", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 512, 0));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 512));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4096, 516));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 4612));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 4616));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4096, 4620));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 8716));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 8720));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4096, 8724));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 4, 12820));
+TEMP_FAILURE_RETRY(pread(t3499f105, buf, 8, 13312));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+t3499f106 = TEMP_FAILURE_RETRY(open("file22", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(fdatasync(t3499f106));
+close(t3499f106);
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 12, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+TEMP_FAILURE_RETRY(pwrite(t3499f105, buf, 28, 0));
+TEMP_FAILURE_RETRY(fdatasync(t3499f105));
+close(t3499f105);
+int  t3505f106 = TEMP_FAILURE_RETRY(open("file171", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3505f106, buf, 1, 0));
+close(t3505f106);
+int  t3540f107 = TEMP_FAILURE_RETRY(open("file173", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 100, 0));
+int  t3540f108 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f108, buf, 1, 0));
+close(t3540f108);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 0));
+int  t3540f105 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f105, buf, 1, 0));
+close(t3540f105);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+t3540f105 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f105, buf, 1, 0));
+close(t3540f105);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 8192));
+t3540f105 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f105, buf, 1, 0));
+close(t3540f105);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+t3540f105 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f105, buf, 1, 0));
+close(t3540f105);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 12288));
+t3540f105 = TEMP_FAILURE_RETRY(open("file175", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3540f105, buf, 8));
+TEMP_FAILURE_RETRY(read(t3540f105, buf, 1));
+close(t3540f105);
+int  t3540f106 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f106, buf, 1, 0));
+close(t3540f106);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 4096, 20480));
+t3540f106 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f106, buf, 1, 0));
+close(t3540f106);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+t3540f106 = TEMP_FAILURE_RETRY(open("file174", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3540f106, buf, 1, 0));
+close(t3540f106);
+TEMP_FAILURE_RETRY(pread(t3540f107, buf, 16, 24));
+int  t3496f105 = TEMP_FAILURE_RETRY(open("file176", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC));
+close(t3496f105);
+t3499f108 = TEMP_FAILURE_RETRY(open("file18", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3499f108, buf, 1, 0));
+close(t3499f108);
+int  t3597f108 = TEMP_FAILURE_RETRY(open("file177", O_RDWR|O_CREAT|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 100, 0));
+int  t3597f109 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f109, buf, 1, 0));
+close(t3597f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 0));
+t3597f109 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f109, buf, 1, 0));
+close(t3597f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+t3597f109 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f109, buf, 1, 0));
+close(t3597f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 8192));
+t3597f109 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f109, buf, 1, 0));
+close(t3597f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+int  t3540f109 = TEMP_FAILURE_RETRY(open("file179", O_RDONLY|O_LARGEFILE));
+TEMP_FAILURE_RETRY(read(t3540f109, buf, 4000));
+int  t3597f110 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f110, buf, 1, 0));
+close(t3597f110);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+close(t3540f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 16384));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 12288));
+t3597f109 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f109, buf, 1, 0));
+close(t3597f109);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+int  t3597f111 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3597f111, buf, 1, 0));
+close(t3597f111);
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 16, 24));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 24576));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 20480));
+TEMP_FAILURE_RETRY(pread(t3597f108, buf, 4096, 57344));
+int  t3598f111 = TEMP_FAILURE_RETRY(open("file178", O_RDONLY|O_LARGEFILE|O_CLOEXEC));
+TEMP_FAILURE_RETRY(pread(t3598f111, buf, 1, 0));
+close(t3598f111);
+close(t3540f107);
+close(t3541f103);
+close(t3545f92);
+close(t3492f31);
+close(t3505f96);
+close(t3433f17);
+close(t3597f108);
+close(t3584f84);
+close(t3455f17);
+close(t3483f25);
+close(t3483f20);
+
+free(buf);
+return 0;
+}
+
+static status_t CreateFile(const char* name, int len) {
+    int chunk = std::min(len, 65536);
+    int out = -1;
+    std::string buf;
+
+    if (android::vold::ReadRandomBytes(chunk, buf) != OK) {
+        LOG(ERROR) << "Failed to read random data";
+        return -EIO;
+    }
+    if ((out = TEMP_FAILURE_RETRY(open(name, O_WRONLY|O_CREAT|O_TRUNC))) < 0) {
+        PLOG(ERROR) << "Failed to open " << name;
+        return -errno;
+    }
+
+    while (len > 0) {
+        int n = write(out, buf.c_str(), std::min(len, chunk));
+        if (n < 0) {
+            PLOG(ERROR) << "Failed to write";
+            close(out);
+            return -errno;
+        }
+        len -= n;
+    }
+
+    close(out);
+    return OK;
+}
+
+static status_t BenchmarkCreate() {
+status_t res = 0;
+res |= CreateFile("stub", 0);
+
+res |= CreateFile("file115", 0);
+res |= CreateFile("file125", 0);
+res |= CreateFile("file43", 49152);
+res |= CreateFile("file2", 57016320);
+res |= CreateFile("file17", 176128);
+res |= CreateFile("file126", 0);
+res |= CreateFile("file4", 0);
+res |= CreateFile("file175", 9);
+res |= CreateFile("file76", 0);
+res |= CreateFile("file140", 4042);
+res |= CreateFile("file80", 0);
+res |= CreateFile("file139", 49152);
+res |= CreateFile("file50", 32768);
+res |= CreateFile("file179", 4000);
+res |= CreateFile("file144", 5550);
+res |= CreateFile("file138", 130888);
+res |= CreateFile("file28", 3182276);
+res |= CreateFile("file161", 32768);
+res |= CreateFile("file34", 1423);
+res |= CreateFile("file53", 32768);
+res |= CreateFile("file72", 0);
+res |= CreateFile("file55", 16384);
+res |= CreateFile("file54", 39938);
+res |= CreateFile("file129", 3974);
+res |= CreateFile("file107", 0);
+res |= CreateFile("file95", 0);
+res |= CreateFile("file82", 0);
+res |= CreateFile("file27", 53280);
+res |= CreateFile("file167", 16384);
+res |= CreateFile("file9", 24588);
+res |= CreateFile("file123", 0);
+res |= CreateFile("file89", 0);
+res |= CreateFile("file40", 4172);
+res |= CreateFile("file20", 1);
+res |= CreateFile("file151", 499712);
+res |= CreateFile("file106", 0);
+res |= CreateFile("file159", 9);
+res |= CreateFile("file47", 32768);
+res |= CreateFile("file146", 5414);
+res |= CreateFile("file153", 13271);
+res |= CreateFile("file12", 2);
+res |= CreateFile("file137", 32768);
+res |= CreateFile("file157", 73728);
+res |= CreateFile("file172", 9);
+res |= CreateFile("file148", 3461);
+res |= CreateFile("file7", 794976);
+res |= CreateFile("file68", 32768);
+res |= CreateFile("file109", 0);
+res |= CreateFile("file142", 5057);
+res |= CreateFile("file147", 3834);
+res |= CreateFile("file117", 0);
+res |= CreateFile("file94", 0);
+res |= CreateFile("file81", 0);
+res |= CreateFile("file75", 0);
+res |= CreateFile("file111", 0);
+res |= CreateFile("file105", 0);
+res |= CreateFile("file79", 0);
+res |= CreateFile("file65", 32768);
+res |= CreateFile("file135", 21257);
+res |= CreateFile("file124", 0);
+res |= CreateFile("file87", 0);
+res |= CreateFile("file64", 49152);
+res |= CreateFile("file131", 4622);
+res |= CreateFile("file130", 32768);
+res |= CreateFile("file59", 143552);
+res |= CreateFile("file141", 4595);
+res |= CreateFile("file149", 29150);
+res |= CreateFile("file178", 1);
+res |= CreateFile("file163", 32768);
+res |= CreateFile("file67", 32768);
+res |= CreateFile("file155", 21512);
+res |= CreateFile("file156", 9);
+res |= CreateFile("file23", 28700);
+res |= CreateFile("file61", 32768);
+res |= CreateFile("file0", 40464617);
+res |= CreateFile("file39", 32768);
+res |= CreateFile("file145", 3612);
+res |= CreateFile("file70", 32768);
+res |= CreateFile("file69", 32768);
+res |= CreateFile("file24", 94220);
+res |= CreateFile("file57", 32768);
+res |= CreateFile("file104", 0);
+res |= CreateFile("file113", 0);
+res |= CreateFile("file99", 0);
+res |= CreateFile("file120", 0);
+res |= CreateFile("file154", 73728);
+res |= CreateFile("file127", 0);
+res |= CreateFile("file38", 65720);
+res |= CreateFile("file77", 0);
+res |= CreateFile("file85", 0);
+res |= CreateFile("file119", 0);
+res |= CreateFile("file96", 0);
+res |= CreateFile("file91", 0);
+res |= CreateFile("file158", 1);
+res |= CreateFile("file174", 1);
+res |= CreateFile("file48", 32768);
+res |= CreateFile("file33", 32566);
+res |= CreateFile("file83", 0);
+res |= CreateFile("file32", 179192);
+res |= CreateFile("file118", 0);
+res |= CreateFile("file121", 0);
+res |= CreateFile("file101", 0);
+res |= CreateFile("file168", 16384);
+res |= CreateFile("file16", 31392);
+res |= CreateFile("file164", 32768);
+res |= CreateFile("file36", 192544);
+res |= CreateFile("file6", 4636);
+res |= CreateFile("file10", 16484);
+res |= CreateFile("file150", 10056);
+res |= CreateFile("file62", 32768);
+res |= CreateFile("file165", 32768);
+res |= CreateFile("file42", 28736);
+res |= CreateFile("file19", 188416);
+res |= CreateFile("file128", 2991);
+res |= CreateFile("file112", 0);
+res |= CreateFile("file100", 0);
+res |= CreateFile("file103", 0);
+res |= CreateFile("file26", 28676);
+res |= CreateFile("file46", 32768);
+res |= CreateFile("file60", 32768);
+res |= CreateFile("file162", 32768);
+res |= CreateFile("file25", 32872);
+res |= CreateFile("file21", 16384);
+res |= CreateFile("file45", 32768);
+res |= CreateFile("file3", 0);
+res |= CreateFile("file171", 1);
+res |= CreateFile("file15", 2);
+res |= CreateFile("file51", 32768);
+res |= CreateFile("file37", 159752);
+res |= CreateFile("file73", 0);
+res |= CreateFile("file71", 32768);
+res |= CreateFile("file98", 0);
+res |= CreateFile("file74", 0);
+res |= CreateFile("file93", 0);
+res |= CreateFile("file122", 0);
+res |= CreateFile("file143", 18408);
+res |= CreateFile("file8", 20648);
+res |= CreateFile("file152", 1);
+res |= CreateFile("file66", 32768);
+res |= CreateFile("file136", 4199);
+res |= CreateFile("file132", 23233);
+res |= CreateFile("file92", 0);
+res |= CreateFile("file11", 0);
+res |= CreateFile("file86", 0);
+res |= CreateFile("file22", 0);
+res |= CreateFile("file56", 16384);
+res |= CreateFile("file78", 0);
+res |= CreateFile("file41", 32768);
+res |= CreateFile("file110", 0);
+res |= CreateFile("file90", 0);
+res |= CreateFile("file44", 12328);
+res |= CreateFile("file63", 49152);
+res |= CreateFile("file116", 0);
+res |= CreateFile("file29", 1035);
+res |= CreateFile("file35", 118788);
+res |= CreateFile("file170", 24576);
+res |= CreateFile("file30", 98304);
+res |= CreateFile("file14", 0);
+res |= CreateFile("file160", 32768);
+res |= CreateFile("file176", 0);
+res |= CreateFile("file1", 471040);
+res |= CreateFile("file108", 0);
+res |= CreateFile("file173", 28672);
+res |= CreateFile("file18", 17416);
+res |= CreateFile("file134", 15056);
+res |= CreateFile("file31", 25608);
+res |= CreateFile("file97", 0);
+res |= CreateFile("file84", 0);
+res |= CreateFile("file114", 0);
+res |= CreateFile("file88", 0);
+res |= CreateFile("file102", 0);
+res |= CreateFile("file58", 32768);
+res |= CreateFile("file52", 49152);
+res |= CreateFile("file13", 0);
+res |= CreateFile("file5", 41168);
+res |= CreateFile("file133", 13332);
+res |= CreateFile("file169", 11354);
+res |= CreateFile("file166", 0);
+res |= CreateFile("file49", 32768);
+res |= CreateFile("file177", 61440);
+
+return res;
+}
+
+static status_t BenchmarkDestroy() {
+status_t res = 0;
+res |= unlink("stub");
+
+res |= unlink("file115");
+res |= unlink("file125");
+res |= unlink("file43");
+res |= unlink("file2");
+res |= unlink("file17");
+res |= unlink("file126");
+res |= unlink("file4");
+res |= unlink("file175");
+res |= unlink("file76");
+res |= unlink("file140");
+res |= unlink("file80");
+res |= unlink("file139");
+res |= unlink("file50");
+res |= unlink("file179");
+res |= unlink("file144");
+res |= unlink("file138");
+res |= unlink("file28");
+res |= unlink("file161");
+res |= unlink("file34");
+res |= unlink("file53");
+res |= unlink("file72");
+res |= unlink("file55");
+res |= unlink("file54");
+res |= unlink("file129");
+res |= unlink("file107");
+res |= unlink("file95");
+res |= unlink("file82");
+res |= unlink("file27");
+res |= unlink("file167");
+res |= unlink("file9");
+res |= unlink("file123");
+res |= unlink("file89");
+res |= unlink("file40");
+res |= unlink("file20");
+res |= unlink("file151");
+res |= unlink("file106");
+res |= unlink("file159");
+res |= unlink("file47");
+res |= unlink("file146");
+res |= unlink("file153");
+res |= unlink("file12");
+res |= unlink("file137");
+res |= unlink("file157");
+res |= unlink("file172");
+res |= unlink("file148");
+res |= unlink("file7");
+res |= unlink("file68");
+res |= unlink("file109");
+res |= unlink("file142");
+res |= unlink("file147");
+res |= unlink("file117");
+res |= unlink("file94");
+res |= unlink("file81");
+res |= unlink("file75");
+res |= unlink("file111");
+res |= unlink("file105");
+res |= unlink("file79");
+res |= unlink("file65");
+res |= unlink("file135");
+res |= unlink("file124");
+res |= unlink("file87");
+res |= unlink("file64");
+res |= unlink("file131");
+res |= unlink("file130");
+res |= unlink("file59");
+res |= unlink("file141");
+res |= unlink("file149");
+res |= unlink("file178");
+res |= unlink("file163");
+res |= unlink("file67");
+res |= unlink("file155");
+res |= unlink("file156");
+res |= unlink("file23");
+res |= unlink("file61");
+res |= unlink("file0");
+res |= unlink("file39");
+res |= unlink("file145");
+res |= unlink("file70");
+res |= unlink("file69");
+res |= unlink("file24");
+res |= unlink("file57");
+res |= unlink("file104");
+res |= unlink("file113");
+res |= unlink("file99");
+res |= unlink("file120");
+res |= unlink("file154");
+res |= unlink("file127");
+res |= unlink("file38");
+res |= unlink("file77");
+res |= unlink("file85");
+res |= unlink("file119");
+res |= unlink("file96");
+res |= unlink("file91");
+res |= unlink("file158");
+res |= unlink("file174");
+res |= unlink("file48");
+res |= unlink("file33");
+res |= unlink("file83");
+res |= unlink("file32");
+res |= unlink("file118");
+res |= unlink("file121");
+res |= unlink("file101");
+res |= unlink("file168");
+res |= unlink("file16");
+res |= unlink("file164");
+res |= unlink("file36");
+res |= unlink("file6");
+res |= unlink("file10");
+res |= unlink("file150");
+res |= unlink("file62");
+res |= unlink("file165");
+res |= unlink("file42");
+res |= unlink("file19");
+res |= unlink("file128");
+res |= unlink("file112");
+res |= unlink("file100");
+res |= unlink("file103");
+res |= unlink("file26");
+res |= unlink("file46");
+res |= unlink("file60");
+res |= unlink("file162");
+res |= unlink("file25");
+res |= unlink("file21");
+res |= unlink("file45");
+res |= unlink("file3");
+res |= unlink("file171");
+res |= unlink("file15");
+res |= unlink("file51");
+res |= unlink("file37");
+res |= unlink("file73");
+res |= unlink("file71");
+res |= unlink("file98");
+res |= unlink("file74");
+res |= unlink("file93");
+res |= unlink("file122");
+res |= unlink("file143");
+res |= unlink("file8");
+res |= unlink("file152");
+res |= unlink("file66");
+res |= unlink("file136");
+res |= unlink("file132");
+res |= unlink("file92");
+res |= unlink("file11");
+res |= unlink("file86");
+res |= unlink("file22");
+res |= unlink("file56");
+res |= unlink("file78");
+res |= unlink("file41");
+res |= unlink("file110");
+res |= unlink("file90");
+res |= unlink("file44");
+res |= unlink("file63");
+res |= unlink("file116");
+res |= unlink("file29");
+res |= unlink("file35");
+res |= unlink("file170");
+res |= unlink("file30");
+res |= unlink("file14");
+res |= unlink("file160");
+res |= unlink("file176");
+res |= unlink("file1");
+res |= unlink("file108");
+res |= unlink("file173");
+res |= unlink("file18");
+res |= unlink("file134");
+res |= unlink("file31");
+res |= unlink("file97");
+res |= unlink("file84");
+res |= unlink("file114");
+res |= unlink("file88");
+res |= unlink("file102");
+res |= unlink("file58");
+res |= unlink("file52");
+res |= unlink("file13");
+res |= unlink("file5");
+res |= unlink("file133");
+res |= unlink("file169");
+res |= unlink("file166");
+res |= unlink("file49");
+res |= unlink("file177");
+
+return res;
+}
+
+static std::string BenchmarkIdent() {
+return "r1572:w1001:s285";
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/CommandListener.cpp b/CommandListener.cpp
index 696e37d..a9a8031 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -25,8 +25,13 @@
 #include <fs_mgr.h>
 #include <stdio.h>
 #include <string.h>
+#include <stdint.h>
+#include <inttypes.h>
 
 #define LOG_TAG "VoldCmdListener"
+
+#include <base/stringprintf.h>
+#include <cutils/fs.h>
 #include <cutils/log.h>
 
 #include <sysutils/SocketClient.h>
@@ -34,13 +39,15 @@
 
 #include "CommandListener.h"
 #include "VolumeManager.h"
+#include "VolumeBase.h"
 #include "ResponseCode.h"
 #include "Process.h"
 #include "Loop.h"
 #include "Devmapper.h"
 #include "Ext4Crypt.h"
 #include "cryptfs.h"
-#include "fstrim.h"
+#include "MoveTask.h"
+#include "TrimTask.h"
 
 #define DUMP_ARGS 0
 
@@ -51,7 +58,6 @@
     registerCmd(new AsecCmd());
     registerCmd(new ObbCmd());
     registerCmd(new StorageCmd());
-    registerCmd(new CryptfsCmd());
     registerCmd(new FstrimCmd());
 }
 
@@ -87,6 +93,14 @@
 void CommandListener::dumpArgs(int /*argc*/, char ** /*argv*/, int /*argObscure*/) { }
 #endif
 
+int CommandListener::sendGenericOkFail(SocketClient *cli, int cond) {
+    if (!cond) {
+        return cli->sendMsg(ResponseCode::CommandOkay, "Command succeeded", false);
+    } else {
+        return cli->sendMsg(ResponseCode::OperationFailed, "Command failed", false);
+    }
+}
+
 CommandListener::DumpCmd::DumpCmd() :
                  VoldCommand("dump") {
 }
@@ -130,99 +144,135 @@
     }
 
     VolumeManager *vm = VolumeManager::Instance();
-    int rc = 0;
+    std::lock_guard<std::mutex> lock(vm->getLock());
 
-    if (!strcmp(argv[1], "list")) {
-        bool broadcast = argc >= 3 && !strcmp(argv[2], "broadcast");
-        return vm->listVolumes(cli, broadcast);
-    } else if (!strcmp(argv[1], "debug")) {
-        if (argc != 3 || (argc == 3 && (strcmp(argv[2], "off") && strcmp(argv[2], "on")))) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume debug <off/on>", false);
-            return 0;
-        }
-        vm->setDebug(!strcmp(argv[2], "on") ? true : false);
-    } else if (!strcmp(argv[1], "mount")) {
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume mount <path>", false);
-            return 0;
-        }
-        rc = vm->mountVolume(argv[2]);
-    } else if (!strcmp(argv[1], "unmount")) {
-        if (argc < 3 || argc > 4 ||
-           ((argc == 4 && strcmp(argv[3], "force")) &&
-            (argc == 4 && strcmp(argv[3], "force_and_revert")))) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume unmount <path> [force|force_and_revert]", false);
-            return 0;
+    // TODO: tease out methods not directly related to volumes
+
+    std::string cmd(argv[1]);
+    if (cmd == "reset") {
+        return sendGenericOkFail(cli, vm->reset());
+
+    } else if (cmd == "shutdown") {
+        return sendGenericOkFail(cli, vm->shutdown());
+
+    } else if (cmd == "debug") {
+        return sendGenericOkFail(cli, vm->setDebug(true));
+
+    } else if (cmd == "partition" && argc > 3) {
+        // partition [diskId] [public|private|mixed] [ratio]
+        std::string id(argv[2]);
+        auto disk = vm->findDisk(id);
+        if (disk == nullptr) {
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown disk", false);
         }
 
-        bool force = false;
-        bool revert = false;
-        if (argc >= 4 && !strcmp(argv[3], "force")) {
-            force = true;
-        } else if (argc >= 4 && !strcmp(argv[3], "force_and_revert")) {
-            force = true;
-            revert = true;
-        }
-        rc = vm->unmountVolume(argv[2], force, revert);
-    } else if (!strcmp(argv[1], "format")) {
-        if (argc < 3 || argc > 4 ||
-            (argc == 4 && strcmp(argv[3], "wipe"))) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume format <path> [wipe]", false);
-            return 0;
-        }
-        bool wipe = false;
-        if (argc >= 4 && !strcmp(argv[3], "wipe")) {
-            wipe = true;
-        }
-        rc = vm->formatVolume(argv[2], wipe);
-    } else if (!strcmp(argv[1], "share")) {
-        if (argc != 4) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError,
-                    "Usage: volume share <path> <method>", false);
-            return 0;
-        }
-        rc = vm->shareVolume(argv[2], argv[3]);
-    } else if (!strcmp(argv[1], "unshare")) {
-        if (argc != 4) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError,
-                    "Usage: volume unshare <path> <method>", false);
-            return 0;
-        }
-        rc = vm->unshareVolume(argv[2], argv[3]);
-    } else if (!strcmp(argv[1], "shared")) {
-        bool enabled = false;
-        if (argc != 4) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError,
-                    "Usage: volume shared <path> <method>", false);
-            return 0;
-        }
-
-        if (vm->shareEnabled(argv[2], argv[3], &enabled)) {
-            cli->sendMsg(
-                    ResponseCode::OperationFailed, "Failed to determine share enable state", true);
+        std::string type(argv[3]);
+        if (type == "public") {
+            return sendGenericOkFail(cli, disk->partitionPublic());
+        } else if (type == "private") {
+            return sendGenericOkFail(cli, disk->partitionPrivate());
+        } else if (type == "mixed") {
+            if (argc < 4) {
+                return cli->sendMsg(ResponseCode::CommandSyntaxError, nullptr, false);
+            }
+            int frac = atoi(argv[4]);
+            return sendGenericOkFail(cli, disk->partitionMixed(frac));
         } else {
-            cli->sendMsg(ResponseCode::ShareEnabledResult,
-                    (enabled ? "Share enabled" : "Share disabled"), false);
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, nullptr, false);
         }
-        return 0;
-    } else if (!strcmp(argv[1], "mkdirs")) {
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume mkdirs <path>", false);
-            return 0;
+
+    } else if (cmd == "mkdirs" && argc > 2) {
+        // mkdirs [path]
+        return sendGenericOkFail(cli, vm->mkdirs(argv[2]));
+
+    } else if (cmd == "user_added" && argc > 3) {
+        // user_added [user] [serial]
+        return sendGenericOkFail(cli, vm->onUserAdded(atoi(argv[2]), atoi(argv[3])));
+
+    } else if (cmd == "user_removed" && argc > 2) {
+        // user_removed [user]
+        return sendGenericOkFail(cli, vm->onUserRemoved(atoi(argv[2])));
+
+    } else if (cmd == "user_started" && argc > 2) {
+        // user_started [user]
+        return sendGenericOkFail(cli, vm->onUserStarted(atoi(argv[2])));
+
+    } else if (cmd == "user_stopped" && argc > 2) {
+        // user_stopped [user]
+        return sendGenericOkFail(cli, vm->onUserStopped(atoi(argv[2])));
+
+    } else if (cmd == "mount" && argc > 2) {
+        // mount [volId] [flags] [user]
+        std::string id(argv[2]);
+        auto vol = vm->findVolume(id);
+        if (vol == nullptr) {
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume", false);
         }
-        rc = vm->mkdirs(argv[2]);
-    } else {
-        cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume cmd", false);
+
+        int mountFlags = (argc > 3) ? atoi(argv[3]) : 0;
+        userid_t mountUserId = (argc > 4) ? atoi(argv[4]) : -1;
+
+        vol->setMountFlags(mountFlags);
+        vol->setMountUserId(mountUserId);
+
+        int res = vol->mount();
+        if (mountFlags & android::vold::VolumeBase::MountFlags::kPrimary) {
+            vm->setPrimary(vol);
+        }
+        return sendGenericOkFail(cli, res);
+
+    } else if (cmd == "unmount" && argc > 2) {
+        // unmount [volId]
+        std::string id(argv[2]);
+        auto vol = vm->findVolume(id);
+        if (vol == nullptr) {
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume", false);
+        }
+
+        return sendGenericOkFail(cli, vol->unmount());
+
+    } else if (cmd == "format" && argc > 3) {
+        // format [volId] [fsType|auto]
+        std::string id(argv[2]);
+        std::string fsType(argv[3]);
+        auto vol = vm->findVolume(id);
+        if (vol == nullptr) {
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume", false);
+        }
+
+        return sendGenericOkFail(cli, vol->format(fsType));
+
+    } else if (cmd == "move_storage" && argc > 3) {
+        // move_storage [fromVolId] [toVolId]
+        auto fromVol = vm->findVolume(std::string(argv[2]));
+        auto toVol = vm->findVolume(std::string(argv[3]));
+        if (fromVol == nullptr || toVol == nullptr) {
+            return cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume", false);
+        }
+
+        (new android::vold::MoveTask(fromVol, toVol))->start();
+        return sendGenericOkFail(cli, 0);
+
+    } else if (cmd == "benchmark" && argc > 2) {
+        // benchmark [volId]
+        std::string id(argv[2]);
+        nsecs_t res = vm->benchmarkPrivate(id);
+        return cli->sendMsg(ResponseCode::CommandOkay,
+                android::base::StringPrintf("%" PRId64, res).c_str(), false);
+
+    } else if (cmd == "forget_partition" && argc > 2) {
+        // forget_partition [partGuid]
+        std::string partGuid(argv[2]);
+        return sendGenericOkFail(cli, vm->forgetPartition(partGuid));
+
+    } else if (cmd == "remount_uid" && argc > 3) {
+        // remount_uid [uid] [none|default|read|write]
+        uid_t uid = atoi(argv[2]);
+        std::string mode(argv[3]);
+        return sendGenericOkFail(cli, vm->remountUid(uid, mode));
     }
 
-    if (!rc) {
-        cli->sendMsg(ResponseCode::CommandOkay, "volume operation succeeded", false);
-    } else {
-        rc = ResponseCode::convertFromErrno();
-        cli->sendMsg(rc, "volume operation failed", true);
-    }
-
-    return 0;
+    return cli->sendMsg(ResponseCode::CommandSyntaxError, nullptr, false);
 }
 
 CommandListener::StorageCmd::StorageCmd() :
@@ -347,8 +397,8 @@
     if (!strcmp(argv[1], "list")) {
         dumpArgs(argc, argv, -1);
 
-        listAsecsInDirectory(cli, Volume::SEC_ASECDIR_EXT);
-        listAsecsInDirectory(cli, Volume::SEC_ASECDIR_INT);
+        listAsecsInDirectory(cli, VolumeManager::SEC_ASECDIR_EXT);
+        listAsecsInDirectory(cli, VolumeManager::SEC_ASECDIR_INT);
     } else if (!strcmp(argv[1], "create")) {
         dumpArgs(argc, argv, 5);
         if (argc != 8) {
@@ -536,238 +586,6 @@
     return 0;
 }
 
-CommandListener::CryptfsCmd::CryptfsCmd() :
-                 VoldCommand("cryptfs") {
-}
-
-static int getType(const char* type)
-{
-    if (!strcmp(type, "default")) {
-        return CRYPT_TYPE_DEFAULT;
-    } else if (!strcmp(type, "password")) {
-        return CRYPT_TYPE_PASSWORD;
-    } else if (!strcmp(type, "pin")) {
-        return CRYPT_TYPE_PIN;
-    } else if (!strcmp(type, "pattern")) {
-        return CRYPT_TYPE_PATTERN;
-    } else {
-        return -1;
-    }
-}
-
-int CommandListener::CryptfsCmd::runCommand(SocketClient *cli,
-                                                      int argc, char **argv) {
-    if ((cli->getUid() != 0) && (cli->getUid() != AID_SYSTEM)) {
-        cli->sendMsg(ResponseCode::CommandNoPermission, "No permission to run cryptfs commands", false);
-        return 0;
-    }
-
-    if (argc < 2) {
-        cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
-        return 0;
-    }
-
-    int rc = 0;
-
-    if (!strcmp(argv[1], "checkpw")) {
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs checkpw <passwd>", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, 2);
-        rc = cryptfs_check_passwd(argv[2]);
-    } else if (!strcmp(argv[1], "restart")) {
-        if (argc != 2) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs restart", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = cryptfs_restart();
-    } else if (!strcmp(argv[1], "cryptocomplete")) {
-        if (argc != 2) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs cryptocomplete", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = cryptfs_crypto_complete();
-    } else if (!strcmp(argv[1], "enablecrypto")) {
-        const char* syntax = "Usage: cryptfs enablecrypto <wipe|inplace> "
-                             "default|password|pin|pattern [passwd]";
-        if ( (argc != 4 && argc != 5)
-             || (strcmp(argv[2], "wipe") && strcmp(argv[2], "inplace")) ) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
-            return 0;
-        }
-        dumpArgs(argc, argv, 4);
-
-        int tries;
-        for (tries = 0; tries < 2; ++tries) {
-            int type = getType(argv[3]);
-            if (type == -1) {
-                cli->sendMsg(ResponseCode::CommandSyntaxError, syntax,
-                             false);
-                return 0;
-            } else if (type == CRYPT_TYPE_DEFAULT) {
-              rc = cryptfs_enable_default(argv[2], /*allow_reboot*/false);
-            } else {
-                rc = cryptfs_enable(argv[2], type, argv[4],
-                                    /*allow_reboot*/false);
-            }
-
-            if (rc == 0) {
-                break;
-            } else if (tries == 0) {
-                Process::killProcessesWithOpenFiles(DATA_MNT_POINT, 2);
-            }
-        }
-    } else if (!strcmp(argv[1], "enablefilecrypto")) {
-        const char* syntax = "Usage: cryptfs enablefilecrypto";
-        if (argc != 2) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = cryptfs_enable_file();
-    } else if (!strcmp(argv[1], "changepw")) {
-        const char* syntax = "Usage: cryptfs changepw "
-                             "default|password|pin|pattern [newpasswd]";
-        const char* password;
-        if (argc == 3) {
-            password = "";
-        } else if (argc == 4) {
-            password = argv[3];
-        } else {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
-            return 0;
-        }
-        int type = getType(argv[2]);
-        if (type == -1) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
-            return 0;
-        }
-        SLOGD("cryptfs changepw %s {}", argv[2]);
-        rc = cryptfs_changepw(type, password);
-    } else if (!strcmp(argv[1], "verifypw")) {
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs verifypw <passwd>", false);
-            return 0;
-        }
-        SLOGD("cryptfs verifypw {}");
-        rc = cryptfs_verify_passwd(argv[2]);
-    } else if (!strcmp(argv[1], "getfield")) {
-        char *valbuf;
-        int valbuf_len = PROPERTY_VALUE_MAX;
-
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs getfield <fieldname>", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-
-        // Increase the buffer size until it is big enough for the field value stored.
-        while (1) {
-            valbuf = (char*)malloc(valbuf_len);
-            if (valbuf == NULL) {
-                cli->sendMsg(ResponseCode::OperationFailed, "Failed to allocate memory", false);
-                return 0;
-            }
-            rc = cryptfs_getfield(argv[2], valbuf, valbuf_len);
-            if (rc != CRYPTO_GETFIELD_ERROR_BUF_TOO_SMALL) {
-                break;
-            }
-            free(valbuf);
-            valbuf_len *= 2;
-        }
-        if (rc == CRYPTO_GETFIELD_OK) {
-            cli->sendMsg(ResponseCode::CryptfsGetfieldResult, valbuf, false);
-        }
-        free(valbuf);
-    } else if (!strcmp(argv[1], "setfield")) {
-        if (argc != 4) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs setfield <fieldname> <value>", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = cryptfs_setfield(argv[2], argv[3]);
-    } else if (!strcmp(argv[1], "mountdefaultencrypted")) {
-        SLOGD("cryptfs mountdefaultencrypted");
-        dumpArgs(argc, argv, -1);
-        rc = cryptfs_mount_default_encrypted();
-    } else if (!strcmp(argv[1], "getpwtype")) {
-        SLOGD("cryptfs getpwtype");
-        dumpArgs(argc, argv, -1);
-        switch(cryptfs_get_password_type()) {
-        case CRYPT_TYPE_PASSWORD:
-            cli->sendMsg(ResponseCode::PasswordTypeResult, "password", false);
-            return 0;
-        case CRYPT_TYPE_PATTERN:
-            cli->sendMsg(ResponseCode::PasswordTypeResult, "pattern", false);
-            return 0;
-        case CRYPT_TYPE_PIN:
-            cli->sendMsg(ResponseCode::PasswordTypeResult, "pin", false);
-            return 0;
-        case CRYPT_TYPE_DEFAULT:
-            cli->sendMsg(ResponseCode::PasswordTypeResult, "default", false);
-            return 0;
-        default:
-          /** @TODO better error and make sure handled by callers */
-            cli->sendMsg(ResponseCode::OpFailedStorageNotFound, "Error", false);
-            return 0;
-        }
-    } else if (!strcmp(argv[1], "getpw")) {
-        SLOGD("cryptfs getpw");
-        dumpArgs(argc, argv, -1);
-        const char* password = cryptfs_get_password();
-        if (password) {
-            char* message = 0;
-            int size = asprintf(&message, "{{sensitive}} %s", password);
-            if (size != -1) {
-                cli->sendMsg(ResponseCode::CommandOkay, message, false);
-                memset(message, 0, size);
-                free (message);
-                return 0;
-            }
-        }
-        rc = -1;
-    } else if (!strcmp(argv[1], "clearpw")) {
-        SLOGD("cryptfs clearpw");
-        dumpArgs(argc, argv, -1);
-        cryptfs_clear_password();
-        rc = 0;
-    } else if (!strcmp(argv[1], "setusercryptopolicies")) {
-        if (argc != 3) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError,
-                "Usage: cryptfs setusercryptopolicies <path>", false);
-            return 0;
-        }
-        SLOGD("cryptfs setusercryptopolicies");
-        dumpArgs(argc, argv, -1);
-        rc = e4crypt_set_user_crypto_policies(argv[2]);
-    } else if (!strcmp(argv[1], "createnewuserdir")) {
-        if (argc != 4) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError,
-                "Usage: cryptfs createnewuserdir <userHandle> <path>", false);
-            return 0;
-        }
-        // ext4enc:TODO: send a CommandSyntaxError if argv[2] not an integer
-        SLOGD("cryptfs createnewuserdir");
-        dumpArgs(argc, argv, -1);
-        rc = e4crypt_create_new_user_dir(argv[2], argv[3]);
-    } else {
-        dumpArgs(argc, argv, -1);
-        cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown cryptfs cmd", false);
-        return 0;
-    }
-
-    // Always report that the command succeeded and return the error code.
-    // The caller will check the return value to see what the error was.
-    char msg[255];
-    snprintf(msg, sizeof(msg), "%d", rc);
-    cli->sendMsg(ResponseCode::CommandOkay, msg, false);
-
-    return 0;
-}
-
 CommandListener::FstrimCmd::FstrimCmd() :
                  VoldCommand("fstrim") {
 }
@@ -783,32 +601,23 @@
         return 0;
     }
 
-    int rc = 0;
+    VolumeManager *vm = VolumeManager::Instance();
+    std::lock_guard<std::mutex> lock(vm->getLock());
 
-    if (!strcmp(argv[1], "dotrim")) {
-        if (argc != 2) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: fstrim dotrim", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = fstrim_filesystems(0);
-    } else if (!strcmp(argv[1], "dodtrim")) {
-        if (argc != 2) {
-            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: fstrim dodtrim", false);
-            return 0;
-        }
-        dumpArgs(argc, argv, -1);
-        rc = fstrim_filesystems(1);   /* Do Deep Discard trim */
-    } else {
-        dumpArgs(argc, argv, -1);
-        cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown fstrim cmd", false);
+    int flags = 0;
+
+    std::string cmd(argv[1]);
+    if (cmd == "dotrim") {
+        flags = 0;
+    } else if (cmd == "dotrimbench") {
+        flags = android::vold::TrimTask::Flags::kBenchmarkAfter;
+    } else if (cmd == "dodtrim") {
+        flags = android::vold::TrimTask::Flags::kDeepTrim;
+    } else if (cmd == "dodtrimbench") {
+        flags = android::vold::TrimTask::Flags::kDeepTrim
+                | android::vold::TrimTask::Flags::kBenchmarkAfter;
     }
 
-    // Always report that the command succeeded and return the error code.
-    // The caller will check the return value to see what the error was.
-    char msg[255];
-    snprintf(msg, sizeof(msg), "%d", rc);
-    cli->sendMsg(ResponseCode::CommandOkay, msg, false);
-
-    return 0;
+    (new android::vold::TrimTask(flags))->start();
+    return sendGenericOkFail(cli, 0);
 }
diff --git a/CommandListener.h b/CommandListener.h
index 0bd51d2..6ed099b 100644
--- a/CommandListener.h
+++ b/CommandListener.h
@@ -18,6 +18,7 @@
 #define _COMMANDLISTENER_H__
 
 #include <sysutils/FrameworkListener.h>
+#include <utils/Errors.h>
 #include "VoldCommand.h"
 
 class CommandListener : public FrameworkListener {
@@ -27,6 +28,7 @@
 
 private:
     static void dumpArgs(int argc, char **argv, int argObscure);
+    static int sendGenericOkFail(SocketClient *cli, int cond);
 
     class DumpCmd : public VoldCommand {
     public:
@@ -65,13 +67,6 @@
         int runCommand(SocketClient *c, int argc, char ** argv);
     };
 
-    class CryptfsCmd : public VoldCommand {
-    public:
-        CryptfsCmd();
-        virtual ~CryptfsCmd() {}
-        int runCommand(SocketClient *c, int argc, char ** argv);
-    };
-
     class FstrimCmd : public VoldCommand {
     public:
         FstrimCmd();
diff --git a/CryptCommandListener.cpp b/CryptCommandListener.cpp
new file mode 100644
index 0000000..173be63
--- /dev/null
+++ b/CryptCommandListener.cpp
@@ -0,0 +1,334 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <fs_mgr.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#define LOG_TAG "VoldCryptCmdListener"
+
+#include <base/stringprintf.h>
+#include <cutils/fs.h>
+#include <cutils/log.h>
+#include <cutils/sockets.h>
+
+#include <sysutils/SocketClient.h>
+#include <private/android_filesystem_config.h>
+
+#include "CryptCommandListener.h"
+#include "Process.h"
+#include "ResponseCode.h"
+#include "cryptfs.h"
+#include "Ext4Crypt.h"
+
+#define DUMP_ARGS 0
+
+CryptCommandListener::CryptCommandListener() :
+FrameworkListener("cryptd", true) {
+    registerCmd(new CryptfsCmd());
+}
+
+#if DUMP_ARGS
+void CryptCommandListener::dumpArgs(int argc, char **argv, int argObscure) {
+    char buffer[4096];
+    char *p = buffer;
+
+    memset(buffer, 0, sizeof(buffer));
+    int i;
+    for (i = 0; i < argc; i++) {
+        unsigned int len = strlen(argv[i]) + 1; // Account for space
+        if (i == argObscure) {
+            len += 2; // Account for {}
+        }
+        if (((p - buffer) + len) < (sizeof(buffer)-1)) {
+            if (i == argObscure) {
+                *p++ = '{';
+                *p++ = '}';
+                *p++ = ' ';
+                continue;
+            }
+            strcpy(p, argv[i]);
+            p+= strlen(argv[i]);
+            if (i != (argc -1)) {
+                *p++ = ' ';
+            }
+        }
+    }
+    SLOGD("%s", buffer);
+}
+#else
+void CryptCommandListener::dumpArgs(int /*argc*/, char ** /*argv*/, int /*argObscure*/) { }
+#endif
+
+int CryptCommandListener::sendGenericOkFail(SocketClient *cli, int cond) {
+    if (!cond) {
+        return cli->sendMsg(ResponseCode::CommandOkay, "Command succeeded", false);
+    } else {
+        return cli->sendMsg(ResponseCode::OperationFailed, "Command failed", false);
+    }
+}
+
+CryptCommandListener::CryptfsCmd::CryptfsCmd() :
+                 VoldCommand("cryptfs") {
+}
+
+static int getType(const char* type)
+{
+    if (!strcmp(type, "default")) {
+        return CRYPT_TYPE_DEFAULT;
+    } else if (!strcmp(type, "password")) {
+        return CRYPT_TYPE_PASSWORD;
+    } else if (!strcmp(type, "pin")) {
+        return CRYPT_TYPE_PIN;
+    } else if (!strcmp(type, "pattern")) {
+        return CRYPT_TYPE_PATTERN;
+    } else {
+        return -1;
+    }
+}
+
+int CryptCommandListener::CryptfsCmd::runCommand(SocketClient *cli,
+                                                 int argc, char **argv) {
+    if ((cli->getUid() != 0) && (cli->getUid() != AID_SYSTEM)) {
+        cli->sendMsg(ResponseCode::CommandNoPermission, "No permission to run cryptfs commands", false);
+        return 0;
+    }
+
+    if (argc < 2) {
+        cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
+        return 0;
+    }
+
+    int rc = 0;
+
+    if (!strcmp(argv[1], "checkpw")) {
+        if (argc != 3) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs checkpw <passwd>", false);
+            return 0;
+        }
+        dumpArgs(argc, argv, 2);
+        rc = cryptfs_check_passwd(argv[2]);
+    } else if (!strcmp(argv[1], "restart")) {
+        if (argc != 2) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs restart", false);
+            return 0;
+        }
+        dumpArgs(argc, argv, -1);
+        rc = cryptfs_restart();
+    } else if (!strcmp(argv[1], "cryptocomplete")) {
+        if (argc != 2) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs cryptocomplete", false);
+            return 0;
+        }
+        dumpArgs(argc, argv, -1);
+        rc = cryptfs_crypto_complete();
+    } else if (!strcmp(argv[1], "enablecrypto")) {
+        const char* syntax = "Usage: cryptfs enablecrypto <wipe|inplace> "
+                             "default|password|pin|pattern [passwd]";
+        if ( (argc != 4 && argc != 5)
+             || (strcmp(argv[2], "wipe") && strcmp(argv[2], "inplace")) ) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
+            return 0;
+        }
+        dumpArgs(argc, argv, 4);
+
+        int tries;
+        for (tries = 0; tries < 2; ++tries) {
+            int type = getType(argv[3]);
+            if (type == -1) {
+                cli->sendMsg(ResponseCode::CommandSyntaxError, syntax,
+                             false);
+                return 0;
+            } else if (type == CRYPT_TYPE_DEFAULT) {
+              rc = cryptfs_enable_default(argv[2], /*allow_reboot*/false);
+            } else {
+                rc = cryptfs_enable(argv[2], type, argv[4],
+                                    /*allow_reboot*/false);
+            }
+
+            if (rc == 0) {
+                break;
+            } else if (tries == 0) {
+                Process::killProcessesWithOpenFiles(DATA_MNT_POINT, SIGKILL);
+            }
+        }
+    } else if (!strcmp(argv[1], "enablefilecrypto")) {
+        const char* syntax = "Usage: cryptfs enablefilecrypto";
+        if (argc != 2) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
+            return 0;
+        }
+        dumpArgs(argc, argv, -1);
+        rc = cryptfs_enable_file();
+    } else if (!strcmp(argv[1], "changepw")) {
+        const char* syntax = "Usage: cryptfs changepw "
+                             "default|password|pin|pattern [newpasswd]";
+        const char* password;
+        if (argc == 3) {
+            password = "";
+        } else if (argc == 4) {
+            password = argv[3];
+        } else {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
+            return 0;
+        }
+        int type = getType(argv[2]);
+        if (type == -1) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, syntax, false);
+            return 0;
+        }
+        SLOGD("cryptfs changepw %s {}", argv[2]);
+        rc = cryptfs_changepw(type, password);
+    } else if (!strcmp(argv[1], "verifypw")) {
+        if (argc != 3) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs verifypw <passwd>", false);
+            return 0;
+        }
+        SLOGD("cryptfs verifypw {}");
+        rc = cryptfs_verify_passwd(argv[2]);
+    } else if (!strcmp(argv[1], "getfield")) {
+        char *valbuf;
+        int valbuf_len = PROPERTY_VALUE_MAX;
+
+        if (argc != 3) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs getfield <fieldname>", false);
+            return 0;
+        }
+        dumpArgs(argc, argv, -1);
+
+        // Increase the buffer size until it is big enough for the field value stored.
+        while (1) {
+            valbuf = (char*)malloc(valbuf_len);
+            if (valbuf == NULL) {
+                cli->sendMsg(ResponseCode::OperationFailed, "Failed to allocate memory", false);
+                return 0;
+            }
+            rc = cryptfs_getfield(argv[2], valbuf, valbuf_len);
+            if (rc != CRYPTO_GETFIELD_ERROR_BUF_TOO_SMALL) {
+                break;
+            }
+            free(valbuf);
+            valbuf_len *= 2;
+        }
+        if (rc == CRYPTO_GETFIELD_OK) {
+            cli->sendMsg(ResponseCode::CryptfsGetfieldResult, valbuf, false);
+        }
+        free(valbuf);
+    } else if (!strcmp(argv[1], "setfield")) {
+        if (argc != 4) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs setfield <fieldname> <value>", false);
+            return 0;
+        }
+        dumpArgs(argc, argv, -1);
+        rc = cryptfs_setfield(argv[2], argv[3]);
+    } else if (!strcmp(argv[1], "mountdefaultencrypted")) {
+        SLOGD("cryptfs mountdefaultencrypted");
+        dumpArgs(argc, argv, -1);
+        rc = cryptfs_mount_default_encrypted();
+    } else if (!strcmp(argv[1], "getpwtype")) {
+        SLOGD("cryptfs getpwtype");
+        dumpArgs(argc, argv, -1);
+        switch(cryptfs_get_password_type()) {
+        case CRYPT_TYPE_PASSWORD:
+            cli->sendMsg(ResponseCode::PasswordTypeResult, "password", false);
+            return 0;
+        case CRYPT_TYPE_PATTERN:
+            cli->sendMsg(ResponseCode::PasswordTypeResult, "pattern", false);
+            return 0;
+        case CRYPT_TYPE_PIN:
+            cli->sendMsg(ResponseCode::PasswordTypeResult, "pin", false);
+            return 0;
+        case CRYPT_TYPE_DEFAULT:
+            cli->sendMsg(ResponseCode::PasswordTypeResult, "default", false);
+            return 0;
+        default:
+          /** @TODO better error and make sure handled by callers */
+            cli->sendMsg(ResponseCode::OpFailedStorageNotFound, "Error", false);
+            return 0;
+        }
+    } else if (!strcmp(argv[1], "getpw")) {
+        SLOGD("cryptfs getpw");
+        dumpArgs(argc, argv, -1);
+        const char* password = cryptfs_get_password();
+        if (password) {
+            char* message = 0;
+            int size = asprintf(&message, "{{sensitive}} %s", password);
+            if (size != -1) {
+                cli->sendMsg(ResponseCode::CommandOkay, message, false);
+                memset(message, 0, size);
+                free (message);
+                return 0;
+            }
+        }
+        rc = -1;
+    } else if (!strcmp(argv[1], "clearpw")) {
+        SLOGD("cryptfs clearpw");
+        dumpArgs(argc, argv, -1);
+        cryptfs_clear_password();
+        rc = 0;
+    } else if (!strcmp(argv[1], "setusercryptopolicies")) {
+        if (argc != 3) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError,
+                "Usage: cryptfs setusercryptopolicies <path>", false);
+            return 0;
+        }
+        SLOGD("cryptfs setusercryptopolicies");
+        dumpArgs(argc, argv, -1);
+        rc = e4crypt_set_user_crypto_policies(argv[2]);
+    } else if (!strcmp(argv[1], "createnewuserdir")) {
+        if (argc != 4) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError,
+                "Usage: cryptfs createnewuserdir <userHandle> <path>", false);
+            return 0;
+        }
+        // ext4enc:TODO: send a CommandSyntaxError if argv[2] not an integer
+        SLOGD("cryptfs createnewuserdir");
+        dumpArgs(argc, argv, -1);
+        rc = e4crypt_create_new_user_dir(argv[2], argv[3]);
+    } else if (!strcmp(argv[1], "deleteuserkey")) {
+        if (argc != 3) {
+            cli->sendMsg(ResponseCode::CommandSyntaxError,
+                "Usage: cryptfs deleteuserkey <userHandle>", false);
+            return 0;
+        }
+        // ext4enc:TODO: send a CommandSyntaxError if argv[2] not an integer
+        SLOGD("cryptfs deleteuserkey");
+        dumpArgs(argc, argv, -1);
+        rc = e4crypt_delete_user_key(argv[2]);
+    } else {
+        dumpArgs(argc, argv, -1);
+        cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown cryptfs cmd", false);
+        return 0;
+    }
+
+    // Always report that the command succeeded and return the error code.
+    // The caller will check the return value to see what the error was.
+    char msg[255];
+    snprintf(msg, sizeof(msg), "%d", rc);
+    cli->sendMsg(ResponseCode::CommandOkay, msg, false);
+
+    return 0;
+}
diff --git a/CryptCommandListener.h b/CryptCommandListener.h
new file mode 100644
index 0000000..1653239
--- /dev/null
+++ b/CryptCommandListener.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CRYPTCOMMANDLISTENER_H__
+#define _CRYPTCOMMANDLISTENER_H__
+
+#include <sysutils/FrameworkListener.h>
+#include <utils/Errors.h>
+#include "VoldCommand.h"
+
+class CryptCommandListener : public FrameworkListener {
+public:
+    CryptCommandListener();
+    virtual ~CryptCommandListener() {}
+
+private:
+    static void dumpArgs(int argc, char **argv, int argObscure);
+    static int sendGenericOkFail(SocketClient *cli, int cond);
+
+    class CryptfsCmd : public VoldCommand {
+    public:
+        CryptfsCmd();
+        virtual ~CryptfsCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    };
+    int getSocket();
+};
+
+#endif
diff --git a/Devmapper.cpp b/Devmapper.cpp
index 703902f..703eade 100644
--- a/Devmapper.cpp
+++ b/Devmapper.cpp
@@ -55,7 +55,7 @@
     }
 
     int fd;
-    if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) {
+    if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Error opening devmapper (%s)", strerror(errno));
         free(buffer);
         free(buffer2);
@@ -138,7 +138,7 @@
     }
 
     int fd;
-    if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) {
+    if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Error opening devmapper (%s)", strerror(errno));
         free(buffer);
         return -1;
@@ -172,7 +172,7 @@
     }
 
     int fd;
-    if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) {
+    if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Error opening devmapper (%s)", strerror(errno));
         free(buffer);
         return -1;
@@ -269,7 +269,7 @@
     }
 
     int fd;
-    if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) {
+    if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Error opening devmapper (%s)", strerror(errno));
         free(buffer);
         return -1;
diff --git a/DirectVolume.cpp b/DirectVolume.cpp
deleted file mode 100644
index 64d7744..0000000
--- a/DirectVolume.cpp
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fnmatch.h>
-
-#include <linux/kdev_t.h>
-
-#define LOG_TAG "DirectVolume"
-
-#include <cutils/log.h>
-#include <sysutils/NetlinkEvent.h>
-
-#include "DirectVolume.h"
-#include "VolumeManager.h"
-#include "ResponseCode.h"
-#include "cryptfs.h"
-
-// #define PARTITION_DEBUG
-
-PathInfo::PathInfo(const char *p)
-{
-    warned = false;
-    pattern = strdup(p);
-
-    if (!strchr(pattern, '*')) {
-        patternType = prefix;
-    } else {
-        patternType = wildcard;
-    }
-}
-
-PathInfo::~PathInfo()
-{
-    free(pattern);
-}
-
-bool PathInfo::match(const char *path)
-{
-    switch (patternType) {
-    case prefix:
-    {
-        bool ret = (strncmp(path, pattern, strlen(pattern)) == 0);
-        if (!warned && ret && (strlen(pattern) != strlen(path))) {
-            SLOGW("Deprecated implied prefix pattern detected, please use '%s*' instead", pattern);
-            warned = true;
-        }
-        return ret;
-    }
-    case wildcard:
-        return fnmatch(pattern, path, 0) == 0;
-    }
-    SLOGE("Bad matching type");
-    return false;
-}
-
-DirectVolume::DirectVolume(VolumeManager *vm, const fstab_rec* rec, int flags) :
-        Volume(vm, rec, flags) {
-    mPaths = new PathCollection();
-    for (int i = 0; i < MAX_PARTITIONS; i++)
-        mPartMinors[i] = -1;
-    mPendingPartCount = 0;
-    mDiskMajor = -1;
-    mDiskMinor = -1;
-    mDiskNumParts = 0;
-    mIsDecrypted = 0;
-
-    if (strcmp(rec->mount_point, "auto") != 0) {
-        ALOGE("Vold managed volumes must have auto mount point; ignoring %s",
-              rec->mount_point);
-    }
-
-    char mount[PATH_MAX];
-
-    snprintf(mount, PATH_MAX, "%s/%s", Volume::MEDIA_DIR, rec->label);
-    mMountpoint = strdup(mount);
-    snprintf(mount, PATH_MAX, "%s/%s", Volume::FUSE_DIR, rec->label);
-    mFuseMountpoint = strdup(mount);
-
-    setState(Volume::State_NoMedia);
-}
-
-DirectVolume::~DirectVolume() {
-    PathCollection::iterator it;
-
-    for (it = mPaths->begin(); it != mPaths->end(); ++it)
-        delete *it;
-    delete mPaths;
-}
-
-int DirectVolume::addPath(const char *path) {
-    mPaths->push_back(new PathInfo(path));
-    return 0;
-}
-
-dev_t DirectVolume::getDiskDevice() {
-    return MKDEV(mDiskMajor, mDiskMinor);
-}
-
-dev_t DirectVolume::getShareDevice() {
-    if (mPartIdx != -1) {
-        return MKDEV(mDiskMajor, mPartIdx);
-    } else {
-        return MKDEV(mDiskMajor, mDiskMinor);
-    }
-}
-
-void DirectVolume::handleVolumeShared() {
-    setState(Volume::State_Shared);
-}
-
-void DirectVolume::handleVolumeUnshared() {
-    setState(Volume::State_Idle);
-}
-
-int DirectVolume::handleBlockEvent(NetlinkEvent *evt) {
-    const char *dp = evt->findParam("DEVPATH");
-
-    PathCollection::iterator  it;
-    for (it = mPaths->begin(); it != mPaths->end(); ++it) {
-        if ((*it)->match(dp)) {
-            /* We can handle this disk */
-            int action = evt->getAction();
-            const char *devtype = evt->findParam("DEVTYPE");
-
-            if (action == NetlinkEvent::NlActionAdd) {
-                int major = atoi(evt->findParam("MAJOR"));
-                int minor = atoi(evt->findParam("MINOR"));
-                char nodepath[255];
-
-                snprintf(nodepath,
-                         sizeof(nodepath), "/dev/block/vold/%d:%d",
-                         major, minor);
-                if (createDeviceNode(nodepath, major, minor)) {
-                    SLOGE("Error making device node '%s' (%s)", nodepath,
-                                                               strerror(errno));
-                }
-                if (!strcmp(devtype, "disk")) {
-                    handleDiskAdded(dp, evt);
-                } else {
-                    handlePartitionAdded(dp, evt);
-                }
-                /* Send notification iff disk is ready (ie all partitions found) */
-                if (getState() == Volume::State_Idle) {
-                    char msg[255];
-
-                    snprintf(msg, sizeof(msg),
-                             "Volume %s %s disk inserted (%d:%d)", getLabel(),
-                             getFuseMountpoint(), mDiskMajor, mDiskMinor);
-                    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeDiskInserted,
-                                                         msg, false);
-                }
-            } else if (action == NetlinkEvent::NlActionRemove) {
-                if (!strcmp(devtype, "disk")) {
-                    handleDiskRemoved(dp, evt);
-                } else {
-                    handlePartitionRemoved(dp, evt);
-                }
-            } else if (action == NetlinkEvent::NlActionChange) {
-                if (!strcmp(devtype, "disk")) {
-                    handleDiskChanged(dp, evt);
-                } else {
-                    handlePartitionChanged(dp, evt);
-                }
-            } else {
-                    SLOGW("Ignoring non add/remove/change event");
-            }
-
-            return 0;
-        }
-    }
-    errno = ENODEV;
-    return -1;
-}
-
-void DirectVolume::handleDiskAdded(const char * /*devpath*/,
-                                   NetlinkEvent *evt) {
-    mDiskMajor = atoi(evt->findParam("MAJOR"));
-    mDiskMinor = atoi(evt->findParam("MINOR"));
-
-    const char *tmp = evt->findParam("NPARTS");
-    if (tmp) {
-        mDiskNumParts = atoi(tmp);
-    } else {
-        SLOGW("Kernel block uevent missing 'NPARTS'");
-        mDiskNumParts = 1;
-    }
-
-    mPendingPartCount = mDiskNumParts;
-    for (int i = 0; i < MAX_PARTITIONS; i++)
-        mPartMinors[i] = -1;
-
-    if (mDiskNumParts == 0) {
-#ifdef PARTITION_DEBUG
-        SLOGD("Dv::diskIns - No partitions - good to go son!");
-#endif
-        setState(Volume::State_Idle);
-    } else {
-#ifdef PARTITION_DEBUG
-        SLOGD("Dv::diskIns - waiting for %d pending partitions", mPendingPartCount);
-#endif
-        setState(Volume::State_Pending);
-    }
-}
-
-void DirectVolume::handlePartitionAdded(const char *devpath, NetlinkEvent *evt) {
-    int major = atoi(evt->findParam("MAJOR"));
-    int minor = atoi(evt->findParam("MINOR"));
-
-    int part_num;
-
-    const char *tmp = evt->findParam("PARTN");
-
-    if (tmp) {
-        part_num = atoi(tmp);
-    } else {
-        SLOGW("Kernel block uevent missing 'PARTN'");
-        part_num = 1;
-    }
-
-    if (part_num > MAX_PARTITIONS || part_num < 1) {
-        SLOGE("Invalid 'PARTN' value");
-        return;
-    }
-
-    if (part_num > mDiskNumParts) {
-        mDiskNumParts = part_num;
-    }
-
-    if (major != mDiskMajor) {
-        SLOGE("Partition '%s' has a different major than its disk!", devpath);
-        return;
-    }
-#ifdef PARTITION_DEBUG
-    SLOGD("Dv:partAdd: part_num = %d, minor = %d\n", part_num, minor);
-#endif
-    if (part_num >= MAX_PARTITIONS) {
-        SLOGE("Dv:partAdd: ignoring part_num = %d (max: %d)\n", part_num, MAX_PARTITIONS-1);
-    } else {
-        if ((mPartMinors[part_num - 1] == -1) && mPendingPartCount)
-            mPendingPartCount--;
-        mPartMinors[part_num -1] = minor;
-    }
-
-    if (!mPendingPartCount) {
-#ifdef PARTITION_DEBUG
-        SLOGD("Dv:partAdd: Got all partitions - ready to rock!");
-#endif
-        if (getState() != Volume::State_Formatting) {
-            setState(Volume::State_Idle);
-            if (mRetryMount == true) {
-                mRetryMount = false;
-                mountVol();
-            }
-        }
-    } else {
-#ifdef PARTITION_DEBUG
-        SLOGD("Dv:partAdd: pending %d disk", mPendingPartCount);
-#endif
-    }
-}
-
-void DirectVolume::handleDiskChanged(const char * /*devpath*/,
-                                     NetlinkEvent *evt) {
-    int major = atoi(evt->findParam("MAJOR"));
-    int minor = atoi(evt->findParam("MINOR"));
-
-    if ((major != mDiskMajor) || (minor != mDiskMinor)) {
-        return;
-    }
-
-    SLOGI("Volume %s disk has changed", getLabel());
-    const char *tmp = evt->findParam("NPARTS");
-    if (tmp) {
-        mDiskNumParts = atoi(tmp);
-    } else {
-        SLOGW("Kernel block uevent missing 'NPARTS'");
-        mDiskNumParts = 1;
-    }
-
-    mPendingPartCount = mDiskNumParts;
-    for (int i = 0; i < MAX_PARTITIONS; i++)
-        mPartMinors[i] = -1;
-
-    if (getState() != Volume::State_Formatting) {
-        if (mDiskNumParts == 0) {
-            setState(Volume::State_Idle);
-        } else {
-            setState(Volume::State_Pending);
-        }
-    }
-}
-
-void DirectVolume::handlePartitionChanged(const char * /*devpath*/,
-                                          NetlinkEvent *evt) {
-    int major = atoi(evt->findParam("MAJOR"));
-    int minor = atoi(evt->findParam("MINOR"));
-    SLOGD("Volume %s %s partition %d:%d changed\n", getLabel(), getMountpoint(), major, minor);
-}
-
-void DirectVolume::handleDiskRemoved(const char * /*devpath*/,
-                                     NetlinkEvent *evt) {
-    int major = atoi(evt->findParam("MAJOR"));
-    int minor = atoi(evt->findParam("MINOR"));
-    char msg[255];
-    bool enabled;
-
-    SLOGD("Volume %s %s disk %d:%d removed\n", getLabel(), getMountpoint(), major, minor);
-    if ((dev_t) MKDEV(major, minor) == mCurrentlyMountedKdev) {
-        /*
-         * Yikes, our mounted disk is going away!
-         */
-
-        doUnmount(major, minor);
-    } else if (mVm->shareEnabled(getLabel(), "ums", &enabled) == 0 && enabled) {
-        mVm->unshareVolume(getLabel(), "ums");
-    }
-
-    snprintf(msg, sizeof(msg), "Volume %s %s disk removed (%d:%d)",
-             getLabel(), getFuseMountpoint(), major, minor);
-    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeDiskRemoved,
-                                             msg, false);
-    setState(Volume::State_NoMedia);
-}
-
-void DirectVolume::handlePartitionRemoved(const char * /*devpath*/,
-                                          NetlinkEvent *evt) {
-    int major = atoi(evt->findParam("MAJOR"));
-    int minor = atoi(evt->findParam("MINOR"));
-    char msg[255];
-    int state;
-
-    SLOGD("Volume %s %s partition %d:%d removed\n", getLabel(), getMountpoint(), major, minor);
-
-    /*
-     * The framework doesn't need to get notified of
-     * partition removal unless it's mounted. Otherwise
-     * the removal notification will be sent on the Disk
-     * itself
-     */
-    state = getState();
-    if (state != Volume::State_Mounted && state != Volume::State_Shared) {
-        return;
-    }
-
-    if ((dev_t) MKDEV(major, minor) == mCurrentlyMountedKdev) {
-        /*
-         * Yikes, our mounted partition is going away!
-         */
-        doUnmount(major, minor);
-    } else if (state == Volume::State_Shared) {
-        /* removed during mass storage */
-        snprintf(msg, sizeof(msg), "Volume %s bad removal (%d:%d)",
-                 getLabel(), major, minor);
-        mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval,
-                                             msg, false);
-
-        if (mVm->unshareVolume(getLabel(), "ums")) {
-            SLOGE("Failed to unshare volume on bad removal (%s)",
-                strerror(errno));
-        } else {
-            SLOGD("Crisis averted");
-        }
-    }
-}
-
-void DirectVolume::doUnmount(int major, int minor) {
-    char msg[255];
-    bool providesAsec = (getFlags() & VOL_PROVIDES_ASEC) != 0;
-    if (providesAsec && mVm->cleanupAsec(this, true)) {
-        SLOGE("Failed to cleanup ASEC - unmount will probably fail!");
-    }
-
-    snprintf(msg, sizeof(msg), "Volume %s %s bad removal (%d:%d)",
-                getLabel(), getFuseMountpoint(), major, minor);
-    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval,
-                                            msg, false);
-
-    if (Volume::unmountVol(true, false)) {
-        SLOGE("Failed to unmount volume on bad removal (%s)",
-                strerror(errno));
-        // XXX: At this point we're screwed for now
-    } else {
-        SLOGD("Crisis averted");
-    }
-}
-
-/*
- * Called from base to get a list of devicenodes for mounting
- */
-int DirectVolume::getDeviceNodes(dev_t *devs, int max) {
-
-    if (mPartIdx == -1) {
-        // If the disk has no partitions, try the disk itself
-        if (!mDiskNumParts) {
-            devs[0] = MKDEV(mDiskMajor, mDiskMinor);
-            return 1;
-        }
-
-        int i;
-        for (i = 0; i < mDiskNumParts; i++) {
-            if (i == max)
-                break;
-            devs[i] = MKDEV(mDiskMajor, mPartMinors[i]);
-        }
-        return mDiskNumParts;
-    }
-    devs[0] = MKDEV(mDiskMajor, mPartMinors[mPartIdx -1]);
-    return 1;
-}
-
-/*
- * Called from base to update device info,
- * e.g. When setting up an dm-crypt mapping for the sd card.
- */
-int DirectVolume::updateDeviceInfo(char *new_path, int new_major, int new_minor)
-{
-    PathCollection::iterator it;
-
-    if (mPartIdx == -1) {
-        SLOGE("Can only change device info on a partition\n");
-        return -1;
-    }
-
-    /*
-     * This is to change the sysfs path associated with a partition, in particular,
-     * for an internal SD card partition that is encrypted.  Thus, the list is
-     * expected to be only 1 entry long.  Check that and bail if not.
-     */
-    if (mPaths->size() != 1) {
-        SLOGE("Cannot change path if there are more than one for a volume\n");
-        return -1;
-    }
-
-    it = mPaths->begin();
-    delete *it; /* Free the string storage */
-    mPaths->erase(it); /* Remove it from the list */
-    addPath(new_path); /* Put the new path on the list */
-
-    /* Save away original info so we can restore it when doing factory reset.
-     * Then, when doing the format, it will format the original device in the
-     * clear, otherwise it just formats the encrypted device which is not
-     * readable when the device boots unencrypted after the reset.
-     */
-    mOrigDiskMajor = mDiskMajor;
-    mOrigDiskMinor = mDiskMinor;
-    mOrigPartIdx = mPartIdx;
-    memcpy(mOrigPartMinors, mPartMinors, sizeof(mPartMinors));
-
-    mDiskMajor = new_major;
-    mDiskMinor = new_minor;
-    /* Ugh, virual block devices don't use minor 0 for whole disk and minor > 0 for
-     * partition number.  They don't have partitions, they are just virtual block
-     * devices, and minor number 0 is the first dm-crypt device.  Luckily the first
-     * dm-crypt device is for the userdata partition, which gets minor number 0, and
-     * it is not managed by vold.  So the next device is minor number one, which we
-     * will call partition one.
-     */
-    mPartIdx = new_minor;
-    mPartMinors[new_minor-1] = new_minor;
-
-    mIsDecrypted = 1;
-
-    return 0;
-}
-
-/*
- * Called from base to revert device info to the way it was before a
- * crypto mapping was created for it.
- */
-void DirectVolume::revertDeviceInfo(void)
-{
-    if (mIsDecrypted) {
-        mDiskMajor = mOrigDiskMajor;
-        mDiskMinor = mOrigDiskMinor;
-        mPartIdx = mOrigPartIdx;
-        memcpy(mPartMinors, mOrigPartMinors, sizeof(mPartMinors));
-
-        mIsDecrypted = 0;
-    }
-
-    return;
-}
-
-/*
- * Called from base to give cryptfs all the info it needs to encrypt eligible volumes
- */
-int DirectVolume::getVolInfo(struct volume_info *v)
-{
-    strcpy(v->label, mLabel);
-    strcpy(v->mnt_point, mMountpoint);
-    v->flags = getFlags();
-    /* Other fields of struct volume_info are filled in by the caller or cryptfs.c */
-
-    return 0;
-}
diff --git a/DirectVolume.h b/DirectVolume.h
deleted file mode 100644
index 96f46af..0000000
--- a/DirectVolume.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _DEVICEVOLUME_H
-#define _DEVICEVOLUME_H
-
-#include <utils/List.h>
-
-#include "Volume.h"
-
-class PathInfo {
-public:
-	PathInfo(const char *pattern);
-	~PathInfo();
-	bool match(const char *path);
-private:
-	bool warned;
-	char *pattern;
-	enum PatternType { prefix, wildcard };
-	PatternType patternType;
-};
-
-typedef android::List<PathInfo *> PathCollection;
-
-class DirectVolume : public Volume {
-public:
-    static const int MAX_PARTITIONS = 32;
-protected:
-    const char* mMountpoint;
-    const char* mFuseMountpoint;
-
-    PathCollection *mPaths;
-    int            mDiskMajor;
-    int            mDiskMinor;
-    int            mPartMinors[MAX_PARTITIONS];
-    int            mOrigDiskMajor;
-    int            mOrigDiskMinor;
-    int            mOrigPartMinors[MAX_PARTITIONS];
-    int            mDiskNumParts;
-    int            mPendingPartCount;
-    int            mIsDecrypted;
-
-public:
-    DirectVolume(VolumeManager *vm, const fstab_rec* rec, int flags);
-    virtual ~DirectVolume();
-
-    int addPath(const char *path);
-
-    const char *getMountpoint() { return mMountpoint; }
-    const char *getFuseMountpoint() { return mFuseMountpoint; }
-
-    int handleBlockEvent(NetlinkEvent *evt);
-    dev_t getDiskDevice();
-    dev_t getShareDevice();
-    void handleVolumeShared();
-    void handleVolumeUnshared();
-    int getVolInfo(struct volume_info *v);
-
-protected:
-    int getDeviceNodes(dev_t *devs, int max);
-    int updateDeviceInfo(char *new_path, int new_major, int new_minor);
-    virtual void revertDeviceInfo(void);
-    int isDecrypted() { return mIsDecrypted; }
-
-private:
-    void handleDiskAdded(const char *devpath, NetlinkEvent *evt);
-    void handleDiskRemoved(const char *devpath, NetlinkEvent *evt);
-    void handleDiskChanged(const char *devpath, NetlinkEvent *evt);
-    void handlePartitionAdded(const char *devpath, NetlinkEvent *evt);
-    void handlePartitionRemoved(const char *devpath, NetlinkEvent *evt);
-    void handlePartitionChanged(const char *devpath, NetlinkEvent *evt);
-
-    int doMountVfat(const char *deviceNode, const char *mountPoint);
-    void doUnmount(int major, int minor);
-
-};
-
-typedef android::List<DirectVolume *> DirectVolumeCollection;
-
-#endif
diff --git a/Disk.cpp b/Disk.cpp
new file mode 100644
index 0000000..1e76bee
--- /dev/null
+++ b/Disk.cpp
@@ -0,0 +1,503 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Disk.h"
+#include "PublicVolume.h"
+#include "PrivateVolume.h"
+#include "Utils.h"
+#include "VolumeBase.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/file.h>
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <diskconfig/diskconfig.h>
+
+#include <vector>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+
+using android::base::ReadFileToString;
+using android::base::WriteStringToFile;
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+static const char* kSgdiskPath = "/system/bin/sgdisk";
+static const char* kSgdiskToken = " \t\n";
+
+static const char* kSysfsMmcMaxMinors = "/sys/module/mmcblk/parameters/perdev_minors";
+
+static const unsigned int kMajorBlockScsiA = 8;
+static const unsigned int kMajorBlockScsiB = 65;
+static const unsigned int kMajorBlockScsiC = 66;
+static const unsigned int kMajorBlockScsiD = 67;
+static const unsigned int kMajorBlockScsiE = 68;
+static const unsigned int kMajorBlockScsiF = 69;
+static const unsigned int kMajorBlockScsiG = 70;
+static const unsigned int kMajorBlockScsiH = 71;
+static const unsigned int kMajorBlockScsiI = 128;
+static const unsigned int kMajorBlockScsiJ = 129;
+static const unsigned int kMajorBlockScsiK = 130;
+static const unsigned int kMajorBlockScsiL = 131;
+static const unsigned int kMajorBlockScsiM = 132;
+static const unsigned int kMajorBlockScsiN = 133;
+static const unsigned int kMajorBlockScsiO = 134;
+static const unsigned int kMajorBlockScsiP = 135;
+static const unsigned int kMajorBlockMmc = 179;
+
+static const char* kGptBasicData = "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7";
+static const char* kGptAndroidMeta = "19A710A2-B3CA-11E4-B026-10604B889DCF";
+static const char* kGptAndroidExpand = "193D1EA4-B3CA-11E4-B075-10604B889DCF";
+
+enum class Table {
+    kUnknown,
+    kMbr,
+    kGpt,
+};
+
+Disk::Disk(const std::string& eventPath, dev_t device,
+        const std::string& nickname, int flags) :
+        mDevice(device), mSize(-1), mNickname(nickname), mFlags(flags), mCreated(
+                false), mJustPartitioned(false) {
+    mId = StringPrintf("disk:%u,%u", major(device), minor(device));
+    mEventPath = eventPath;
+    mSysPath = StringPrintf("/sys/%s", eventPath.c_str());
+    mDevPath = StringPrintf("/dev/block/vold/%s", mId.c_str());
+    CreateDeviceNode(mDevPath, mDevice);
+}
+
+Disk::~Disk() {
+    CHECK(!mCreated);
+    DestroyDeviceNode(mDevPath);
+}
+
+std::shared_ptr<VolumeBase> Disk::findVolume(const std::string& id) {
+    for (auto vol : mVolumes) {
+        if (vol->getId() == id) {
+            return vol;
+        }
+        auto stackedVol = vol->findVolume(id);
+        if (stackedVol != nullptr) {
+            return stackedVol;
+        }
+    }
+    return nullptr;
+}
+
+void Disk::listVolumes(VolumeBase::Type type, std::list<std::string>& list) {
+    for (auto vol : mVolumes) {
+        if (vol->getType() == type) {
+            list.push_back(vol->getId());
+        }
+        // TODO: consider looking at stacked volumes
+    }
+}
+
+status_t Disk::create() {
+    CHECK(!mCreated);
+    mCreated = true;
+    notifyEvent(ResponseCode::DiskCreated, StringPrintf("%d", mFlags));
+    readMetadata();
+    readPartitions();
+    return OK;
+}
+
+status_t Disk::destroy() {
+    CHECK(mCreated);
+    destroyAllVolumes();
+    mCreated = false;
+    notifyEvent(ResponseCode::DiskDestroyed);
+    return OK;
+}
+
+void Disk::createPublicVolume(dev_t device) {
+    auto vol = std::shared_ptr<VolumeBase>(new PublicVolume(device));
+    if (mJustPartitioned) {
+        LOG(DEBUG) << "Device just partitioned; silently formatting";
+        vol->setSilent(true);
+        vol->create();
+        vol->format("auto");
+        vol->destroy();
+        vol->setSilent(false);
+    }
+
+    mVolumes.push_back(vol);
+    vol->setDiskId(getId());
+    vol->create();
+}
+
+void Disk::createPrivateVolume(dev_t device, const std::string& partGuid) {
+    std::string normalizedGuid;
+    if (NormalizeHex(partGuid, normalizedGuid)) {
+        LOG(WARNING) << "Invalid GUID " << partGuid;
+        return;
+    }
+
+    std::string keyRaw;
+    if (!ReadFileToString(BuildKeyPath(normalizedGuid), &keyRaw)) {
+        PLOG(ERROR) << "Failed to load key for GUID " << normalizedGuid;
+        return;
+    }
+
+    LOG(DEBUG) << "Found key for GUID " << normalizedGuid;
+
+    auto vol = std::shared_ptr<VolumeBase>(new PrivateVolume(device, keyRaw));
+    if (mJustPartitioned) {
+        LOG(DEBUG) << "Device just partitioned; silently formatting";
+        vol->setSilent(true);
+        vol->create();
+        vol->format("auto");
+        vol->destroy();
+        vol->setSilent(false);
+    }
+
+    mVolumes.push_back(vol);
+    vol->setDiskId(getId());
+    vol->setPartGuid(partGuid);
+    vol->create();
+}
+
+void Disk::destroyAllVolumes() {
+    for (auto vol : mVolumes) {
+        vol->destroy();
+    }
+    mVolumes.clear();
+}
+
+status_t Disk::readMetadata() {
+    mSize = -1;
+    mLabel.clear();
+
+    int fd = open(mDevPath.c_str(), O_RDONLY | O_CLOEXEC);
+    if (fd != -1) {
+        if (ioctl(fd, BLKGETSIZE64, &mSize)) {
+            mSize = -1;
+        }
+        close(fd);
+    }
+
+    switch (major(mDevice)) {
+    case kMajorBlockScsiA: case kMajorBlockScsiB: case kMajorBlockScsiC: case kMajorBlockScsiD:
+    case kMajorBlockScsiE: case kMajorBlockScsiF: case kMajorBlockScsiG: case kMajorBlockScsiH:
+    case kMajorBlockScsiI: case kMajorBlockScsiJ: case kMajorBlockScsiK: case kMajorBlockScsiL:
+    case kMajorBlockScsiM: case kMajorBlockScsiN: case kMajorBlockScsiO: case kMajorBlockScsiP: {
+        std::string path(mSysPath + "/device/vendor");
+        std::string tmp;
+        if (!ReadFileToString(path, &tmp)) {
+            PLOG(WARNING) << "Failed to read vendor from " << path;
+            return -errno;
+        }
+        mLabel = tmp;
+        break;
+    }
+    case kMajorBlockMmc: {
+        std::string path(mSysPath + "/device/manfid");
+        std::string tmp;
+        if (!ReadFileToString(path, &tmp)) {
+            PLOG(WARNING) << "Failed to read manufacturer from " << path;
+            return -errno;
+        }
+        uint64_t manfid = strtoll(tmp.c_str(), nullptr, 16);
+        // Our goal here is to give the user a meaningful label, ideally
+        // matching whatever is silk-screened on the card.  To reduce
+        // user confusion, this list doesn't contain white-label manfid.
+        switch (manfid) {
+        case 0x000003: mLabel = "SanDisk"; break;
+        case 0x00001b: mLabel = "Samsung"; break;
+        case 0x000028: mLabel = "Lexar"; break;
+        case 0x000074: mLabel = "Transcend"; break;
+        }
+        break;
+    }
+    default: {
+        LOG(WARNING) << "Unsupported block major type" << major(mDevice);
+        return -ENOTSUP;
+    }
+    }
+
+    notifyEvent(ResponseCode::DiskSizeChanged, StringPrintf("%" PRId64, mSize));
+    notifyEvent(ResponseCode::DiskLabelChanged, mLabel);
+    notifyEvent(ResponseCode::DiskSysPathChanged, mSysPath);
+    return OK;
+}
+
+status_t Disk::readPartitions() {
+    int8_t maxMinors = getMaxMinors();
+    if (maxMinors < 0) {
+        return -ENOTSUP;
+    }
+
+    destroyAllVolumes();
+
+    // Parse partition table
+
+    std::vector<std::string> cmd;
+    cmd.push_back(kSgdiskPath);
+    cmd.push_back("--android-dump");
+    cmd.push_back(mDevPath);
+
+    std::vector<std::string> output;
+    status_t res = ForkExecvp(cmd, output);
+    if (res != OK) {
+        LOG(WARNING) << "sgdisk failed to scan " << mDevPath;
+        notifyEvent(ResponseCode::DiskScanned);
+        mJustPartitioned = false;
+        return res;
+    }
+
+    Table table = Table::kUnknown;
+    bool foundParts = false;
+    for (auto line : output) {
+        char* cline = (char*) line.c_str();
+        char* token = strtok(cline, kSgdiskToken);
+        if (token == nullptr) continue;
+
+        if (!strcmp(token, "DISK")) {
+            const char* type = strtok(nullptr, kSgdiskToken);
+            if (!strcmp(type, "mbr")) {
+                table = Table::kMbr;
+            } else if (!strcmp(type, "gpt")) {
+                table = Table::kGpt;
+            }
+        } else if (!strcmp(token, "PART")) {
+            foundParts = true;
+            int i = strtol(strtok(nullptr, kSgdiskToken), nullptr, 10);
+            if (i <= 0 || i > maxMinors) {
+                LOG(WARNING) << mId << " is ignoring partition " << i
+                        << " beyond max supported devices";
+                continue;
+            }
+            dev_t partDevice = makedev(major(mDevice), minor(mDevice) + i);
+
+            if (table == Table::kMbr) {
+                const char* type = strtok(nullptr, kSgdiskToken);
+
+                switch (strtol(type, nullptr, 16)) {
+                case 0x06: // FAT16
+                case 0x0b: // W95 FAT32 (LBA)
+                case 0x0c: // W95 FAT32 (LBA)
+                case 0x0e: // W95 FAT16 (LBA)
+                    createPublicVolume(partDevice);
+                    break;
+                }
+            } else if (table == Table::kGpt) {
+                const char* typeGuid = strtok(nullptr, kSgdiskToken);
+                const char* partGuid = strtok(nullptr, kSgdiskToken);
+
+                if (!strcasecmp(typeGuid, kGptBasicData)) {
+                    createPublicVolume(partDevice);
+                } else if (!strcasecmp(typeGuid, kGptAndroidExpand)) {
+                    createPrivateVolume(partDevice, partGuid);
+                }
+            }
+        }
+    }
+
+    // Ugly last ditch effort, treat entire disk as partition
+    if (table == Table::kUnknown || !foundParts) {
+        LOG(WARNING) << mId << " has unknown partition table; trying entire device";
+
+        std::string fsType;
+        std::string unused;
+        if (ReadMetadataUntrusted(mDevPath, fsType, unused, unused) == OK) {
+            createPublicVolume(mDevice);
+        } else {
+            LOG(WARNING) << mId << " failed to identify, giving up";
+        }
+    }
+
+    notifyEvent(ResponseCode::DiskScanned);
+    mJustPartitioned = false;
+    return OK;
+}
+
+status_t Disk::unmountAll() {
+    for (auto vol : mVolumes) {
+        vol->unmount();
+    }
+    return OK;
+}
+
+status_t Disk::partitionPublic() {
+    // TODO: improve this code
+    destroyAllVolumes();
+    mJustPartitioned = true;
+
+    struct disk_info dinfo;
+    memset(&dinfo, 0, sizeof(dinfo));
+
+    if (!(dinfo.part_lst = (struct part_info *) malloc(
+            MAX_NUM_PARTS * sizeof(struct part_info)))) {
+        return -1;
+    }
+
+    memset(dinfo.part_lst, 0, MAX_NUM_PARTS * sizeof(struct part_info));
+    dinfo.device = strdup(mDevPath.c_str());
+    dinfo.scheme = PART_SCHEME_MBR;
+    dinfo.sect_size = 512;
+    dinfo.skip_lba = 2048;
+    dinfo.num_lba = 0;
+    dinfo.num_parts = 1;
+
+    struct part_info *pinfo = &dinfo.part_lst[0];
+
+    pinfo->name = strdup("android_sdcard");
+    pinfo->flags |= PART_ACTIVE_FLAG;
+    pinfo->type = PC_PART_TYPE_FAT32;
+    pinfo->len_kb = -1;
+
+    int rc = apply_disk_config(&dinfo, 0);
+    if (rc) {
+        LOG(ERROR) << "Failed to apply disk configuration: " << rc;
+        goto out;
+    }
+
+out:
+    free(pinfo->name);
+    free(dinfo.device);
+    free(dinfo.part_lst);
+
+    return rc;
+}
+
+status_t Disk::partitionPrivate() {
+    return partitionMixed(0);
+}
+
+status_t Disk::partitionMixed(int8_t ratio) {
+    int res;
+
+    destroyAllVolumes();
+    mJustPartitioned = true;
+
+    // First nuke any existing partition table
+    std::vector<std::string> cmd;
+    cmd.push_back(kSgdiskPath);
+    cmd.push_back("--zap-all");
+    cmd.push_back(mDevPath);
+
+    // Zap sometimes returns an error when it actually succeeded, so
+    // just log as warning and keep rolling forward.
+    if ((res = ForkExecvp(cmd)) != 0) {
+        LOG(WARNING) << "Failed to zap; status " << res;
+    }
+
+    // We've had some success above, so generate both the private partition
+    // GUID and encryption key and persist them.
+    std::string partGuidRaw;
+    std::string keyRaw;
+    if (ReadRandomBytes(16, partGuidRaw) || ReadRandomBytes(16, keyRaw)) {
+        LOG(ERROR) << "Failed to generate GUID or key";
+        return -EIO;
+    }
+
+    std::string partGuid;
+    StrToHex(partGuidRaw, partGuid);
+
+    if (!WriteStringToFile(keyRaw, BuildKeyPath(partGuid))) {
+        LOG(ERROR) << "Failed to persist key";
+        return -EIO;
+    } else {
+        LOG(DEBUG) << "Persisted key for GUID " << partGuid;
+    }
+
+    // Now let's build the new GPT table. We heavily rely on sgdisk to
+    // force optimal alignment on the created partitions.
+    cmd.clear();
+    cmd.push_back(kSgdiskPath);
+
+    // If requested, create a public partition first. Mixed-mode partitioning
+    // like this is an experimental feature.
+    if (ratio > 0) {
+        if (ratio < 10 || ratio > 90) {
+            LOG(ERROR) << "Mixed partition ratio must be between 10-90%";
+            return -EINVAL;
+        }
+
+        uint64_t splitMb = ((mSize / 100) * ratio) / 1024 / 1024;
+        cmd.push_back(StringPrintf("--new=0:0:+%" PRId64 "M", splitMb));
+        cmd.push_back(StringPrintf("--typecode=0:%s", kGptBasicData));
+        cmd.push_back("--change-name=0:shared");
+    }
+
+    // Define a metadata partition which is designed for future use; there
+    // should only be one of these per physical device, even if there are
+    // multiple private volumes.
+    cmd.push_back("--new=0:0:+16M");
+    cmd.push_back(StringPrintf("--typecode=0:%s", kGptAndroidMeta));
+    cmd.push_back("--change-name=0:android_meta");
+
+    // Define a single private partition filling the rest of disk.
+    cmd.push_back("--new=0:0:-0");
+    cmd.push_back(StringPrintf("--typecode=0:%s", kGptAndroidExpand));
+    cmd.push_back(StringPrintf("--partition-guid=0:%s", partGuid.c_str()));
+    cmd.push_back("--change-name=0:android_expand");
+
+    cmd.push_back(mDevPath);
+
+    if ((res = ForkExecvp(cmd)) != 0) {
+        LOG(ERROR) << "Failed to partition; status " << res;
+        return res;
+    }
+
+    return OK;
+}
+
+void Disk::notifyEvent(int event) {
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
+            getId().c_str(), false);
+}
+
+void Disk::notifyEvent(int event, const std::string& value) {
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
+            StringPrintf("%s %s", getId().c_str(), value.c_str()).c_str(), false);
+}
+
+int Disk::getMaxMinors() {
+    // Figure out maximum partition devices supported
+    switch (major(mDevice)) {
+    case kMajorBlockScsiA: case kMajorBlockScsiB: case kMajorBlockScsiC: case kMajorBlockScsiD:
+    case kMajorBlockScsiE: case kMajorBlockScsiF: case kMajorBlockScsiG: case kMajorBlockScsiH:
+    case kMajorBlockScsiI: case kMajorBlockScsiJ: case kMajorBlockScsiK: case kMajorBlockScsiL:
+    case kMajorBlockScsiM: case kMajorBlockScsiN: case kMajorBlockScsiO: case kMajorBlockScsiP: {
+        // Per Documentation/devices.txt this is static
+        return 15;
+    }
+    case kMajorBlockMmc: {
+        // Per Documentation/devices.txt this is dynamic
+        std::string tmp;
+        if (!ReadFileToString(kSysfsMmcMaxMinors, &tmp)) {
+            LOG(ERROR) << "Failed to read max minors";
+            return -errno;
+        }
+        return atoi(tmp.c_str());
+    }
+    }
+
+    LOG(ERROR) << "Unsupported block major type " << major(mDevice);
+    return -ENOTSUP;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/Disk.h b/Disk.h
new file mode 100644
index 0000000..77ec7df
--- /dev/null
+++ b/Disk.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_DISK_H
+#define ANDROID_VOLD_DISK_H
+
+#include "Utils.h"
+#include "VolumeBase.h"
+
+#include <utils/Errors.h>
+
+#include <vector>
+
+namespace android {
+namespace vold {
+
+class VolumeBase;
+
+/*
+ * Representation of detected physical media.
+ *
+ * Knows how to create volumes based on the partition tables found, and also
+ * how to repartition itself.
+ */
+class Disk {
+public:
+    Disk(const std::string& eventPath, dev_t device, const std::string& nickname, int flags);
+    virtual ~Disk();
+
+    enum Flags {
+        /* Flag that disk is adoptable */
+        kAdoptable = 1 << 0,
+        /* Flag that disk is considered primary when the user hasn't
+         * explicitly picked a primary storage location */
+        kDefaultPrimary = 1 << 1,
+        /* Flag that disk is SD card */
+        kSd = 1 << 2,
+        /* Flag that disk is USB disk */
+        kUsb = 1 << 3,
+        /* Flag that disk is EMMC internal */
+        kEmmc = 1 << 4,
+    };
+
+    const std::string& getId() { return mId; }
+    const std::string& getEventPath() { return mEventPath; }
+    const std::string& getSysPath() { return mSysPath; }
+    const std::string& getDevPath() { return mDevPath; }
+    dev_t getDevice() { return mDevice; }
+    uint64_t getSize() { return mSize; }
+    const std::string& getLabel() { return mLabel; }
+    int getFlags() { return mFlags; }
+
+    std::shared_ptr<VolumeBase> findVolume(const std::string& id);
+
+    void listVolumes(VolumeBase::Type type, std::list<std::string>& list);
+
+    status_t create();
+    status_t destroy();
+
+    status_t readMetadata();
+    status_t readPartitions();
+
+    status_t unmountAll();
+
+    status_t partitionPublic();
+    status_t partitionPrivate();
+    status_t partitionMixed(int8_t ratio);
+
+    void notifyEvent(int msg);
+    void notifyEvent(int msg, const std::string& value);
+
+private:
+    /* ID that uniquely references this disk */
+    std::string mId;
+    /* Original event path */
+    std::string mEventPath;
+    /* Device path under sysfs */
+    std::string mSysPath;
+    /* Device path under dev */
+    std::string mDevPath;
+    /* Kernel device representing disk */
+    dev_t mDevice;
+    /* Size of disk, in bytes */
+    uint64_t mSize;
+    /* User-visible label, such as manufacturer */
+    std::string mLabel;
+    /* Current partitions on disk */
+    std::vector<std::shared_ptr<VolumeBase>> mVolumes;
+    /* Nickname for this disk */
+    std::string mNickname;
+    /* Flags applicable to this disk */
+    int mFlags;
+    /* Flag indicating object is created */
+    bool mCreated;
+    /* Flag that we just partitioned and should format all volumes */
+    bool mJustPartitioned;
+
+    void createPublicVolume(dev_t device);
+    void createPrivateVolume(dev_t device, const std::string& partGuid);
+
+    void destroyAllVolumes();
+
+    int getMaxMinors();
+
+    DISALLOW_COPY_AND_ASSIGN(Disk);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/EmulatedVolume.cpp b/EmulatedVolume.cpp
new file mode 100644
index 0000000..6e440cc
--- /dev/null
+++ b/EmulatedVolume.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EmulatedVolume.h"
+#include "Utils.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <cutils/fs.h>
+#include <private/android_filesystem_config.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+static const char* kFusePath = "/system/bin/sdcard";
+
+EmulatedVolume::EmulatedVolume(const std::string& rawPath) :
+        VolumeBase(Type::kEmulated), mFusePid(0) {
+    setId("emulated");
+    mRawPath = rawPath;
+    mLabel = "emulated";
+}
+
+EmulatedVolume::EmulatedVolume(const std::string& rawPath, dev_t device,
+        const std::string& fsUuid) : VolumeBase(Type::kEmulated), mFusePid(0) {
+    setId(StringPrintf("emulated:%u,%u", major(device), minor(device)));
+    mRawPath = rawPath;
+    mLabel = fsUuid;
+}
+
+EmulatedVolume::~EmulatedVolume() {
+}
+
+status_t EmulatedVolume::doMount() {
+    // We could have migrated storage to an adopted private volume, so always
+    // call primary storage "emulated" to avoid media rescans.
+    std::string label = mLabel;
+    if (getMountFlags() & MountFlags::kPrimary) {
+        label = "emulated";
+    }
+
+    mFuseDefault = StringPrintf("/mnt/runtime/default/%s", label.c_str());
+    mFuseRead = StringPrintf("/mnt/runtime/read/%s", label.c_str());
+    mFuseWrite = StringPrintf("/mnt/runtime/write/%s", label.c_str());
+
+    setInternalPath(mRawPath);
+    setPath(StringPrintf("/storage/%s", label.c_str()));
+
+    if (fs_prepare_dir(mFuseDefault.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseRead.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseWrite.c_str(), 0700, AID_ROOT, AID_ROOT)) {
+        PLOG(ERROR) << getId() << " failed to create mount points";
+        return -errno;
+    }
+
+    dev_t before = GetDevice(mFuseWrite);
+
+    if (!(mFusePid = fork())) {
+        if (execl(kFusePath, kFusePath,
+                "-u", "1023", // AID_MEDIA_RW
+                "-g", "1023", // AID_MEDIA_RW
+                "-m",
+                "-w",
+                mRawPath.c_str(),
+                label.c_str(),
+                NULL)) {
+            PLOG(ERROR) << "Failed to exec";
+        }
+
+        LOG(ERROR) << "FUSE exiting";
+        _exit(1);
+    }
+
+    if (mFusePid == -1) {
+        PLOG(ERROR) << getId() << " failed to fork";
+        return -errno;
+    }
+
+    while (before == GetDevice(mFuseWrite)) {
+        LOG(VERBOSE) << "Waiting for FUSE to spin up...";
+        usleep(50000); // 50ms
+    }
+
+    return OK;
+}
+
+status_t EmulatedVolume::doUnmount() {
+    if (mFusePid > 0) {
+        kill(mFusePid, SIGTERM);
+        TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0));
+        mFusePid = 0;
+    }
+
+    ForceUnmount(mFuseDefault);
+    ForceUnmount(mFuseRead);
+    ForceUnmount(mFuseWrite);
+
+    rmdir(mFuseDefault.c_str());
+    rmdir(mFuseRead.c_str());
+    rmdir(mFuseWrite.c_str());
+
+    mFuseDefault.clear();
+    mFuseRead.clear();
+    mFuseWrite.clear();
+
+    return OK;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/EmulatedVolume.h b/EmulatedVolume.h
new file mode 100644
index 0000000..09686c1
--- /dev/null
+++ b/EmulatedVolume.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_EMULATED_VOLUME_H
+#define ANDROID_VOLD_EMULATED_VOLUME_H
+
+#include "VolumeBase.h"
+
+#include <cutils/multiuser.h>
+
+namespace android {
+namespace vold {
+
+/*
+ * Shared storage emulated on top of private storage.
+ *
+ * Knows how to spawn a FUSE daemon to synthesize permissions.  ObbVolume
+ * can be stacked above it.
+ *
+ * This volume is always multi-user aware, but is only binds itself to
+ * users when its primary storage.  This volume should never be presented
+ * as secondary storage, since we're strongly encouraging developers to
+ * store data local to their app.
+ */
+class EmulatedVolume : public VolumeBase {
+public:
+    EmulatedVolume(const std::string& rawPath);
+    EmulatedVolume(const std::string& rawPath, dev_t device, const std::string& fsUuid);
+    virtual ~EmulatedVolume();
+
+protected:
+    status_t doMount() override;
+    status_t doUnmount() override;
+
+private:
+    std::string mRawPath;
+    std::string mLabel;
+
+    std::string mFuseDefault;
+    std::string mFuseRead;
+    std::string mFuseWrite;
+
+    /* PID of FUSE wrapper */
+    pid_t mFusePid;
+
+    DISALLOW_COPY_AND_ASSIGN(EmulatedVolume);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/Ext4.cpp b/Ext4.cpp
deleted file mode 100644
index f5a964a..0000000
--- a/Ext4.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
-
-#include <linux/kdev_t.h>
-
-#define LOG_TAG "Vold"
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include <logwrap/logwrap.h>
-
-#include "Ext4.h"
-#include "VoldUtil.h"
-
-#define MKEXT4FS_PATH "/system/bin/make_ext4fs"
-#define RESIZE2FS_PATH "/system/bin/resize2fs"
-
-int Ext4::doMount(const char *fsPath, const char *mountPoint, bool ro, bool remount,
-        bool executable) {
-    int rc;
-    unsigned long flags;
-
-    flags = MS_NOATIME | MS_NODEV | MS_NOSUID | MS_DIRSYNC;
-
-    flags |= (executable ? 0 : MS_NOEXEC);
-    flags |= (ro ? MS_RDONLY : 0);
-    flags |= (remount ? MS_REMOUNT : 0);
-
-    rc = mount(fsPath, mountPoint, "ext4", flags, NULL);
-
-    if (rc && errno == EROFS) {
-        SLOGE("%s appears to be a read only filesystem - retrying mount RO", fsPath);
-        flags |= MS_RDONLY;
-        rc = mount(fsPath, mountPoint, "ext4", flags, NULL);
-    }
-
-    return rc;
-}
-
-int Ext4::resize(const char *fspath, unsigned int numSectors) {
-    const char *args[4];
-    char* size_str;
-    int rc;
-    int status;
-
-    args[0] = RESIZE2FS_PATH;
-    args[1] = "-f";
-    args[2] = fspath;
-    if (asprintf(&size_str, "%ds", numSectors) < 0)
-    {
-      SLOGE("Filesystem (ext4) resize failed to set size");
-      return -1;
-    }
-    args[3] = size_str;
-    rc = android_fork_execvp(ARRAY_SIZE(args), (char **)args, &status, false,
-            true);
-    free(size_str);
-    if (rc != 0) {
-        SLOGE("Filesystem (ext4) resize failed due to logwrap error");
-        errno = EIO;
-        return -1;
-    }
-
-    if (!WIFEXITED(status)) {
-        SLOGE("Filesystem (ext4) resize did not exit properly");
-        errno = EIO;
-        return -1;
-    }
-
-    status = WEXITSTATUS(status);
-
-    if (status == 0) {
-        SLOGI("Filesystem (ext4) resized OK");
-        return 0;
-    } else {
-        SLOGE("Resize (ext4) failed (unknown exit code %d)", status);
-        errno = EIO;
-        return -1;
-    }
-    return 0;
-}
-
-int Ext4::format(const char *fsPath, unsigned int numSectors, const char *mountpoint) {
-    const char *args[7];
-    int rc;
-    int status;
-
-    args[0] = MKEXT4FS_PATH;
-    args[1] = "-J";
-    args[2] = "-a";
-    args[3] = mountpoint;
-    if (numSectors) {
-        char tmp[32];
-        snprintf(tmp, sizeof(tmp), "%u", numSectors * 512);
-        const char *size = tmp;
-        args[4] = "-l";
-        args[5] = size;
-        args[6] = fsPath;
-        rc = android_fork_execvp(ARRAY_SIZE(args), (char **)args, &status, false, true);
-    } else {
-        args[4] = fsPath;
-        rc = android_fork_execvp(5, (char **)args, &status, false, true);
-    }
-    rc = android_fork_execvp(ARRAY_SIZE(args), (char **)args, &status, false,
-            true);
-    if (rc != 0) {
-        SLOGE("Filesystem (ext4) format failed due to logwrap error");
-        errno = EIO;
-        return -1;
-    }
-
-    if (!WIFEXITED(status)) {
-        SLOGE("Filesystem (ext4) format did not exit properly");
-        errno = EIO;
-        return -1;
-    }
-
-    status = WEXITSTATUS(status);
-
-    if (status == 0) {
-        SLOGI("Filesystem (ext4) formatted OK");
-        return 0;
-    } else {
-        SLOGE("Format (ext4) failed (unknown exit code %d)", status);
-        errno = EIO;
-        return -1;
-    }
-    return 0;
-}
diff --git a/Ext4.h b/Ext4.h
deleted file mode 100644
index c768f5a..0000000
--- a/Ext4.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _EXT4_H
-#define _EXT4_H
-
-#include <unistd.h>
-
-class Ext4 {
-public:
-    static int doMount(const char *fsPath, const char *mountPoint, bool ro, bool remount,
-            bool executable);
-    static int format(const char *fsPath, unsigned int numSectors, const char *mountpoint);
-    static int resize(const char *fsPath, unsigned int numSectors);
-};
-
-#endif
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index 7470ff9..95cbfb7 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -285,6 +285,7 @@
     return 0;
 }
 
+// Get raw keyref - used to make keyname and to pass to ioctl
 static std::string generate_key_ref(const char* key, int length)
 {
     SHA512_CTX c;
@@ -351,9 +352,7 @@
     return 0;
 }
 
-// Install password into global keyring
-// Return raw key reference for use in policy
-static std::string e4crypt_install_key(const std::string &key)
+static ext4_encryption_key fill_key(const std::string &key)
 {
     // ext4enc:TODO Currently raw key is required to be of length
     // sizeof(ext4_key.raw) == EXT4_MAX_KEY_SIZE, so zero pad to
@@ -365,37 +364,52 @@
     static_assert(key_length / 8 <= sizeof(ext4_key.raw),
                   "Key too long!");
     memcpy(ext4_key.raw, &key[0], key.size());
+    return ext4_key;
+}
 
-    // Get raw keyref - used to make keyname and to pass to ioctl
-    auto raw_ref = generate_key_ref(ext4_key.raw, ext4_key.size);
-
-    // Generate keyname
+static std::string keyname(const std::string &raw_ref)
+{
     std::ostringstream o;
+    o << "ext4:";
     for (auto i = raw_ref.begin(); i != raw_ref.end(); ++i) {
         o << std::hex << std::setw(2) << std::setfill('0') << (int)*i;
     }
-    auto ref = std::string("ext4:") + o.str();
+    return o.str();
+}
 
-    // Find existing keyring
-    key_serial_t device_keyring = keyctl_search(KEY_SPEC_SESSION_KEYRING,
-                                                "keyring", "e4crypt", 0);
+// Get the keyring we store all keys in
+static key_serial_t e4crypt_keyring()
+{
+    return keyctl_search(KEY_SPEC_SESSION_KEYRING, "keyring", "e4crypt", 0);
+}
 
+static int e4crypt_install_key(const ext4_encryption_key &ext4_key, const std::string &ref)
+{
+    key_serial_t device_keyring = e4crypt_keyring();
     SLOGI("Found device_keyring - id is %d", device_keyring);
-
-    // Add key ...
     key_serial_t key_id = add_key("logon", ref.c_str(),
                                   (void*)&ext4_key, sizeof(ext4_key),
                                   device_keyring);
-
     if (key_id == -1) {
         SLOGE("Failed to insert key into keyring with error %s",
               strerror(errno));
-        return "";
+        return -1;
     }
-
     SLOGI("Added key %d (%s) to keyring %d in process %d",
           key_id, ref.c_str(), device_keyring, getpid());
+    return 0;
+}
 
+// Install password into global keyring
+// Return raw key reference for use in policy
+static std::string e4crypt_install_key(const std::string &key)
+{
+    auto ext4_key = fill_key(key);
+    auto raw_ref = generate_key_ref(ext4_key.raw, ext4_key.size);
+    auto ref = keyname(raw_ref);
+    if (e4crypt_install_key(ext4_key, ref) == -1) {
+        return "";
+    }
     return raw_ref;
 }
 
@@ -493,12 +507,9 @@
         .Set(fieldname, std::string(value)) ? 0 : -1;
 }
 
-// ext4enc:TODO this can't be the only place keys are read from /dev/urandom
-// we should unite those places.
-static std::string e4crypt_get_user_key(
+static std::string get_key_path(
     const char *mount_path,
-    const char *user_handle,
-    bool create_if_absent)
+    const char *user_handle)
 {
     // ext4enc:TODO get the path properly
     auto key_dir = android::base::StringPrintf("%s/misc/vold/user_keys",
@@ -507,7 +518,15 @@
         SLOGE("Unable to create %s (%s)", key_dir.c_str(), strerror(errno));
         return "";
     }
-    auto key_path = key_dir + "/" + user_handle;
+    return key_dir + "/" + user_handle;
+}
+
+// ext4enc:TODO this can't be the only place keys are read from /dev/urandom
+// we should unite those places.
+static std::string e4crypt_get_key(
+    const std::string &key_path,
+    bool create_if_absent)
+{
     std::string content;
     if (android::base::ReadFileToString(key_path, &content)) {
         if (content.size() != key_length/8) {
@@ -532,20 +551,21 @@
         SLOGE("Unable to read key from /dev/urandom (%s)", strerror(errno));
         return "";
     }
-    std::string user_key(key_bytes, sizeof(key_bytes));
-    if (!android::base::WriteStringToFile(user_key, key_path)) {
+    std::string key(key_bytes, sizeof(key_bytes));
+    if (!android::base::WriteStringToFile(key, key_path)) {
         SLOGE("Unable to write key to %s (%s)",
                 key_path.c_str(), strerror(errno));
         return "";
     }
-    return user_key;
+    return key;
 }
 
 static int e4crypt_set_user_policy(const char *mount_path, const char *user_handle,
                             const char *path, bool create_if_absent)
 {
     SLOGD("e4crypt_set_user_policy for %s", user_handle);
-    auto user_key = e4crypt_get_user_key(mount_path, user_handle,
+    auto user_key = e4crypt_get_key(
+        get_key_path(mount_path, user_handle),
         create_if_absent);
     if (user_key.empty()) {
         return -1;
@@ -612,3 +632,35 @@
     }
     return 0;
 }
+
+int e4crypt_delete_user_key(const char *user_handle) {
+    SLOGD("e4crypt_delete_user_key(\"%s\")", user_handle);
+    auto key_path = get_key_path(DATA_MNT_POINT, user_handle);
+    auto key = e4crypt_get_key(key_path, false);
+    auto ext4_key = fill_key(key);
+    auto ref = keyname(generate_key_ref(ext4_key.raw, ext4_key.size));
+    auto key_serial = keyctl_search(e4crypt_keyring(), "logon", ref.c_str(), 0);
+    if (keyctl_revoke(key_serial) == 0) {
+        SLOGD("Revoked key with serial %ld ref %s\n", key_serial, ref.c_str());
+    } else {
+        SLOGE("Failed to revoke key with serial %ld ref %s: %s\n",
+            key_serial, ref.c_str(), strerror(errno));
+    }
+    int pid = fork();
+    if (pid < 0) {
+        SLOGE("Unable to fork: %s", strerror(errno));
+        return -1;
+    }
+    if (pid == 0) {
+        SLOGD("Forked for secdiscard");
+        execl("/system/bin/secdiscard",
+            "/system/bin/secdiscard",
+            key_path.c_str(),
+            NULL);
+        SLOGE("Unable to launch secdiscard on %s: %s\n", key_path.c_str(),
+            strerror(errno));
+        exit(-1);
+    }
+    // ext4enc:TODO reap the zombie
+    return 0;
+}
diff --git a/Ext4Crypt.h b/Ext4Crypt.h
index c502b62..f5c2871 100644
--- a/Ext4Crypt.h
+++ b/Ext4Crypt.h
@@ -20,5 +20,6 @@
                       const char* value);
 int e4crypt_set_user_crypto_policies(const char *path);
 int e4crypt_create_new_user_dir(const char *user_handle, const char *path);
+int e4crypt_delete_user_key(const char *user_handle);
 
 __END_DECLS
diff --git a/Fat.cpp b/Fat.cpp
deleted file mode 100644
index 0c0bdaa..0000000
--- a/Fat.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
-#include <linux/fs.h>
-#include <sys/ioctl.h>
-
-#include <linux/kdev_t.h>
-
-#define LOG_TAG "Vold"
-
-#include <cutils/log.h>
-#include <cutils/properties.h>
-
-#include <logwrap/logwrap.h>
-
-#include "Fat.h"
-#include "VoldUtil.h"
-
-static char FSCK_MSDOS_PATH[] = "/system/bin/fsck_msdos";
-static char MKDOSFS_PATH[] = "/system/bin/newfs_msdos";
-extern "C" int mount(const char *, const char *, const char *, unsigned long, const void *);
-
-int Fat::check(const char *fsPath) {
-    if (access(FSCK_MSDOS_PATH, X_OK)) {
-        SLOGW("Skipping fs checks\n");
-        return 0;
-    }
-
-    int pass = 1;
-    int rc = 0;
-    do {
-        const char *args[4];
-        int status;
-        args[0] = FSCK_MSDOS_PATH;
-        args[1] = "-p";
-        args[2] = "-f";
-        args[3] = fsPath;
-
-        rc = android_fork_execvp(ARRAY_SIZE(args), (char **)args, &status,
-                false, true);
-        if (rc != 0) {
-            SLOGE("Filesystem check failed due to logwrap error");
-            errno = EIO;
-            return -1;
-        }
-
-        if (!WIFEXITED(status)) {
-            SLOGE("Filesystem check did not exit properly");
-            errno = EIO;
-            return -1;
-        }
-
-        status = WEXITSTATUS(status);
-
-        switch(status) {
-        case 0:
-            SLOGI("Filesystem check completed OK");
-            return 0;
-
-        case 2:
-            SLOGE("Filesystem check failed (not a FAT filesystem)");
-            errno = ENODATA;
-            return -1;
-
-        case 4:
-            if (pass++ <= 3) {
-                SLOGW("Filesystem modified - rechecking (pass %d)",
-                        pass);
-                continue;
-            }
-            SLOGE("Failing check after too many rechecks");
-            errno = EIO;
-            return -1;
-
-        default:
-            SLOGE("Filesystem check failed (unknown exit code %d)", status);
-            errno = EIO;
-            return -1;
-        }
-    } while (0);
-
-    return 0;
-}
-
-int Fat::doMount(const char *fsPath, const char *mountPoint,
-                 bool ro, bool remount, bool executable,
-                 int ownerUid, int ownerGid, int permMask, bool createLost) {
-    int rc;
-    unsigned long flags;
-    char mountData[255];
-
-    flags = MS_NODEV | MS_NOSUID | MS_DIRSYNC;
-
-    flags |= (executable ? 0 : MS_NOEXEC);
-    flags |= (ro ? MS_RDONLY : 0);
-    flags |= (remount ? MS_REMOUNT : 0);
-
-    sprintf(mountData,
-            "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,shortname=mixed",
-            ownerUid, ownerGid, permMask, permMask);
-
-    rc = mount(fsPath, mountPoint, "vfat", flags, mountData);
-
-    if (rc && errno == EROFS) {
-        SLOGE("%s appears to be a read only filesystem - retrying mount RO", fsPath);
-        flags |= MS_RDONLY;
-        rc = mount(fsPath, mountPoint, "vfat", flags, mountData);
-    }
-
-    if (rc == 0 && createLost) {
-        char *lost_path;
-        asprintf(&lost_path, "%s/LOST.DIR", mountPoint);
-        if (access(lost_path, F_OK)) {
-            /*
-             * Create a LOST.DIR in the root so we have somewhere to put
-             * lost cluster chains (fsck_msdos doesn't currently do this)
-             */
-            if (mkdir(lost_path, 0755)) {
-                SLOGE("Unable to create LOST.DIR (%s)", strerror(errno));
-            }
-        }
-        free(lost_path);
-    }
-
-    return rc;
-}
-
-int Fat::format(const char *fsPath, unsigned int numSectors, bool wipe) {
-    const char *args[11];
-    int rc;
-    int status;
-
-    if (wipe) {
-        Fat::wipe(fsPath, numSectors);
-    }
-
-    args[0] = MKDOSFS_PATH;
-    args[1] = "-F";
-    args[2] = "32";
-    args[3] = "-O";
-    args[4] = "android";
-    args[5] = "-c";
-    args[6] = "64";
-    args[7] = "-A";
-
-    if (numSectors) {
-        char tmp[32];
-        snprintf(tmp, sizeof(tmp), "%u", numSectors);
-        const char *size = tmp;
-        args[8] = "-s";
-        args[9] = size;
-        args[10] = fsPath;
-        rc = android_fork_execvp(ARRAY_SIZE(args), (char **)args, &status,
-                false, true);
-    } else {
-        args[8] = fsPath;
-        rc = android_fork_execvp(9, (char **)args, &status, false,
-                true);
-    }
-
-    if (rc != 0) {
-        SLOGE("Filesystem format failed due to logwrap error");
-        errno = EIO;
-        return -1;
-    }
-
-    if (!WIFEXITED(status)) {
-        SLOGE("Filesystem format did not exit properly");
-        errno = EIO;
-        return -1;
-    }
-
-    status = WEXITSTATUS(status);
-
-    if (status == 0) {
-        SLOGI("Filesystem formatted OK");
-        return 0;
-    } else {
-        SLOGE("Format failed (unknown exit code %d)", status);
-        errno = EIO;
-        return -1;
-    }
-    return 0;
-}
-
-void Fat::wipe(const char *fsPath, unsigned int numSectors) {
-    unsigned long long range[2];
-
-    int fd = open(fsPath, O_RDWR);
-    if (fd == -1) {
-        SLOGE("Fat wipe failed to open device %s", fsPath);
-        return;
-    }
-
-    if (numSectors == 0) {
-        unsigned long nr_sec;
-        get_blkdev_size(fd, &nr_sec);
-        if (nr_sec > UINT32_MAX) {
-            SLOGE("Too many sectors for FAT: %ld", nr_sec);
-            close(fd);
-            return;
-        }
-        numSectors = nr_sec;
-    }
-    if (numSectors == 0) {
-        SLOGE("Fat wipe failed to determine size of %s", fsPath);
-        close(fd);
-        return;
-    }
-    range[0] = 0;
-    range[1] = (unsigned long long)numSectors * 512;
-    if (ioctl(fd, BLKDISCARD, &range) < 0) {
-        SLOGE("Fat wipe failed to discard blocks on %s", fsPath);
-    } else {
-        SLOGI("Fat wipe %d sectors on %s succeeded", numSectors, fsPath);
-    }
-    close(fd);
-}
diff --git a/Fat.h b/Fat.h
deleted file mode 100644
index 19614d1..0000000
--- a/Fat.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _FAT_H
-#define _FAT_H
-
-#include <unistd.h>
-
-class Fat {
-public:
-    static int check(const char *fsPath);
-    static int doMount(const char *fsPath, const char *mountPoint,
-                       bool ro, bool remount, bool executable,
-                       int ownerUid, int ownerGid, int permMask,
-                       bool createLost);
-    static int format(const char *fsPath, unsigned int numSectors, bool wipe);
-
-private:
-    static void wipe(const char *fsPath, unsigned int numSectors);
-};
-
-#endif
diff --git a/Loop.cpp b/Loop.cpp
index 37ad102..059b963 100644
--- a/Loop.cpp
+++ b/Loop.cpp
@@ -49,7 +49,7 @@
 
         sprintf(filename, "/dev/block/loop%d", i);
 
-        if ((fd = open(filename, O_RDWR)) < 0) {
+        if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
             if (errno != ENOENT) {
                 SLOGE("Unable to open %s (%s)", filename, strerror(errno));
             } else {
@@ -93,7 +93,7 @@
 
         sprintf(filename, "/dev/block/loop%d", i);
 
-        if ((fd = open(filename, O_RDWR)) < 0) {
+        if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
             if (errno != ENOENT) {
                 SLOGE("Unable to open %s (%s)", filename, strerror(errno));
             } else {
@@ -169,7 +169,7 @@
             setfscreatecon(NULL);
         }
 
-        if ((fd = open(filename, O_RDWR)) < 0) {
+        if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
             SLOGE("Unable to open %s (%s)", filename, strerror(errno));
             return -1;
         }
@@ -197,7 +197,7 @@
 
     int file_fd;
 
-    if ((file_fd = open(loopFile, O_RDWR)) < 0) {
+    if ((file_fd = open(loopFile, O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Unable to open %s (%s)", loopFile, strerror(errno));
         close(fd);
         return -1;
@@ -232,7 +232,7 @@
 int Loop::destroyByDevice(const char *loopDevice) {
     int device_fd;
 
-    device_fd = open(loopDevice, O_RDONLY);
+    device_fd = open(loopDevice, O_RDONLY | O_CLOEXEC);
     if (device_fd < 0) {
         SLOGE("Failed to open loop (%d)", errno);
         return -1;
@@ -273,7 +273,7 @@
 int Loop::resizeImageFile(const char *file, unsigned int numSectors) {
     int fd;
 
-    if ((fd = open(file, O_RDWR)) < 0) {
+    if ((fd = open(file, O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Error opening imagefile (%s)", strerror(errno));
         return -1;
     }
@@ -302,7 +302,7 @@
     int fd;
     struct asec_superblock buffer;
 
-    if ((fd = open(loopDevice, O_RDONLY)) < 0) {
+    if ((fd = open(loopDevice, O_RDONLY | O_CLOEXEC)) < 0) {
         SLOGE("Failed to open loopdevice (%s)", strerror(errno));
         destroyByDevice(loopDevice);
         return -1;
diff --git a/MoveTask.cpp b/MoveTask.cpp
new file mode 100644
index 0000000..10cd549
--- /dev/null
+++ b/MoveTask.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "MoveTask.h"
+#include "Utils.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <private/android_filesystem_config.h>
+#include <hardware_legacy/power.h>
+
+#include <dirent.h>
+#include <sys/wait.h>
+
+#define CONSTRAIN(amount, low, high) (amount < low ? low : (amount > high ? high : amount))
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+// TODO: keep in sync with PackageManager
+static const int kMoveSucceeded = -100;
+static const int kMoveFailedInternalError = -6;
+
+static const char* kCpPath = "/system/bin/cp";
+static const char* kRmPath = "/system/bin/rm";
+
+static const char* kWakeLock = "MoveTask";
+
+MoveTask::MoveTask(const std::shared_ptr<VolumeBase>& from,
+        const std::shared_ptr<VolumeBase>& to) :
+        mFrom(from), mTo(to) {
+}
+
+MoveTask::~MoveTask() {
+}
+
+void MoveTask::start() {
+    mThread = std::thread(&MoveTask::run, this);
+}
+
+static void notifyProgress(int progress) {
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(ResponseCode::MoveStatus,
+            StringPrintf("%d", progress).c_str(), false);
+}
+
+static status_t pushBackContents(const std::string& path, std::vector<std::string>& cmd) {
+    DIR* dir = opendir(path.c_str());
+    if (dir == NULL) {
+        return -1;
+    }
+    bool found = false;
+    struct dirent* ent;
+    while ((ent = readdir(dir)) != NULL) {
+        if ((!strcmp(ent->d_name, ".")) || (!strcmp(ent->d_name, ".."))) {
+            continue;
+        }
+        cmd.push_back(StringPrintf("%s/%s", path.c_str(), ent->d_name));
+        found = true;
+    }
+    closedir(dir);
+    return found ? OK : -1;
+}
+
+static status_t execRm(const std::string& path, int startProgress, int stepProgress) {
+    notifyProgress(startProgress);
+
+    uint64_t expectedBytes = GetTreeBytes(path);
+    uint64_t startFreeBytes = GetFreeBytes(path);
+
+    std::vector<std::string> cmd;
+    cmd.push_back(kRmPath);
+    cmd.push_back("-f"); /* force: remove without confirmation, no error if it doesn't exist */
+    cmd.push_back("-R"); /* recursive: remove directory contents */
+    if (pushBackContents(path, cmd) != OK) {
+        LOG(WARNING) << "No contents in " << path;
+        return OK;
+    }
+
+    pid_t pid = ForkExecvpAsync(cmd);
+    if (pid == -1) return -1;
+
+    int status;
+    while (true) {
+        if (waitpid(pid, &status, WNOHANG) == pid) {
+            if (WIFEXITED(status)) {
+                LOG(DEBUG) << "Finished rm with status " << WEXITSTATUS(status);
+                return (WEXITSTATUS(status) == 0) ? OK : -1;
+            } else {
+                break;
+            }
+        }
+
+        sleep(1);
+        uint64_t deltaFreeBytes = GetFreeBytes(path) - startFreeBytes;
+        notifyProgress(startProgress + CONSTRAIN((int)
+                ((deltaFreeBytes * stepProgress) / expectedBytes), 0, stepProgress));
+    }
+    return -1;
+}
+
+static status_t execCp(const std::string& fromPath, const std::string& toPath,
+        int startProgress, int stepProgress) {
+    notifyProgress(startProgress);
+
+    uint64_t expectedBytes = GetTreeBytes(fromPath);
+    uint64_t startFreeBytes = GetFreeBytes(toPath);
+
+    std::vector<std::string> cmd;
+    cmd.push_back(kCpPath);
+    cmd.push_back("-p"); /* preserve timestamps, ownership, and permissions */
+    cmd.push_back("-R"); /* recurse into subdirectories (DEST must be a directory) */
+    cmd.push_back("-P"); /* Do not follow symlinks [default] */
+    cmd.push_back("-d"); /* don't dereference symlinks */
+    if (pushBackContents(fromPath, cmd) != OK) {
+        LOG(WARNING) << "No contents in " << fromPath;
+        return OK;
+    }
+    cmd.push_back(toPath.c_str());
+
+    pid_t pid = ForkExecvpAsync(cmd);
+    if (pid == -1) return -1;
+
+    int status;
+    while (true) {
+        if (waitpid(pid, &status, WNOHANG) == pid) {
+            if (WIFEXITED(status)) {
+                LOG(DEBUG) << "Finished cp with status " << WEXITSTATUS(status);
+                return (WEXITSTATUS(status) == 0) ? OK : -1;
+            } else {
+                break;
+            }
+        }
+
+        sleep(1);
+        uint64_t deltaFreeBytes = startFreeBytes - GetFreeBytes(toPath);
+        notifyProgress(startProgress + CONSTRAIN((int)
+                ((deltaFreeBytes * stepProgress) / expectedBytes), 0, stepProgress));
+    }
+    return -1;
+}
+
+static void bringOffline(const std::shared_ptr<VolumeBase>& vol) {
+    vol->destroy();
+    vol->setSilent(true);
+    vol->create();
+    vol->setMountFlags(0);
+    vol->mount();
+}
+
+static void bringOnline(const std::shared_ptr<VolumeBase>& vol) {
+    vol->destroy();
+    vol->setSilent(false);
+    vol->create();
+}
+
+void MoveTask::run() {
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
+
+    std::string fromPath;
+    std::string toPath;
+
+    // TODO: add support for public volumes
+    if (mFrom->getType() != VolumeBase::Type::kEmulated) goto fail;
+    if (mTo->getType() != VolumeBase::Type::kEmulated) goto fail;
+
+    // Step 1: tear down volumes and mount silently without making
+    // visible to userspace apps
+    bringOffline(mFrom);
+    bringOffline(mTo);
+
+    fromPath = mFrom->getInternalPath();
+    toPath = mTo->getInternalPath();
+
+    // Step 2: clean up any stale data
+    if (execRm(toPath, 10, 10) != OK) {
+        goto fail;
+    }
+
+    // Step 3: perform actual copy
+    if (execCp(fromPath, toPath, 20, 60) != OK) {
+        goto fail;
+    }
+
+    // NOTE: MountService watches for this magic value to know
+    // that move was successful
+    notifyProgress(82);
+    bringOnline(mFrom);
+    bringOnline(mTo);
+
+    // Step 4: clean up old data
+    if (execRm(fromPath, 85, 15) != OK) {
+        goto fail;
+    }
+
+    notifyProgress(kMoveSucceeded);
+    release_wake_lock(kWakeLock);
+    return;
+fail:
+    bringOnline(mFrom);
+    bringOnline(mTo);
+    notifyProgress(kMoveFailedInternalError);
+    release_wake_lock(kWakeLock);
+    return;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/MoveTask.h b/MoveTask.h
new file mode 100644
index 0000000..b1777c0
--- /dev/null
+++ b/MoveTask.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_MOVE_TASK_H
+#define ANDROID_VOLD_MOVE_TASK_H
+
+#include "Utils.h"
+#include "VolumeBase.h"
+
+#include <thread>
+
+namespace android {
+namespace vold {
+
+class MoveTask {
+public:
+    MoveTask(const std::shared_ptr<VolumeBase>& from, const std::shared_ptr<VolumeBase>& to);
+    virtual ~MoveTask();
+
+    void start();
+
+private:
+    std::shared_ptr<VolumeBase> mFrom;
+    std::shared_ptr<VolumeBase> mTo;
+    std::thread mThread;
+
+    void run();
+
+    DISALLOW_COPY_AND_ASSIGN(MoveTask);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/NetlinkManager.cpp b/NetlinkManager.cpp
index d2e16b2..b5069a6 100644
--- a/NetlinkManager.cpp
+++ b/NetlinkManager.cpp
@@ -58,8 +58,8 @@
     nladdr.nl_pid = getpid();
     nladdr.nl_groups = 0xffffffff;
 
-    if ((mSock = socket(PF_NETLINK,
-                        SOCK_DGRAM,NETLINK_KOBJECT_UEVENT)) < 0) {
+    if ((mSock = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC,
+            NETLINK_KOBJECT_UEVENT)) < 0) {
         SLOGE("Unable to create uevent socket: %s", strerror(errno));
         return -1;
     }
diff --git a/PrivateVolume.cpp b/PrivateVolume.cpp
new file mode 100644
index 0000000..6ddef3f
--- /dev/null
+++ b/PrivateVolume.cpp
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "fs/Ext4.h"
+#include "fs/F2fs.h"
+#include "PrivateVolume.h"
+#include "EmulatedVolume.h"
+#include "Utils.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+#include "cryptfs.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <cutils/fs.h>
+#include <private/android_filesystem_config.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+static const unsigned int kMajorBlockMmc = 179;
+
+PrivateVolume::PrivateVolume(dev_t device, const std::string& keyRaw) :
+        VolumeBase(Type::kPrivate), mRawDevice(device), mKeyRaw(keyRaw) {
+    setId(StringPrintf("private:%u,%u", major(device), minor(device)));
+    mRawDevPath = StringPrintf("/dev/block/vold/%s", getId().c_str());
+}
+
+PrivateVolume::~PrivateVolume() {
+}
+
+status_t PrivateVolume::readMetadata() {
+    status_t res = ReadMetadata(mDmDevPath, mFsType, mFsUuid, mFsLabel);
+    notifyEvent(ResponseCode::VolumeFsTypeChanged, mFsType);
+    notifyEvent(ResponseCode::VolumeFsUuidChanged, mFsUuid);
+    notifyEvent(ResponseCode::VolumeFsLabelChanged, mFsLabel);
+    return res;
+}
+
+status_t PrivateVolume::doCreate() {
+    if (CreateDeviceNode(mRawDevPath, mRawDevice)) {
+        return -EIO;
+    }
+
+    // Recover from stale vold by tearing down any old mappings
+    cryptfs_revert_ext_volume(getId().c_str());
+
+    // TODO: figure out better SELinux labels for private volumes
+
+    unsigned char* key = (unsigned char*) mKeyRaw.data();
+    char crypto_blkdev[MAXPATHLEN];
+    int res = cryptfs_setup_ext_volume(getId().c_str(), mRawDevPath.c_str(),
+            key, mKeyRaw.size(), crypto_blkdev);
+    mDmDevPath = crypto_blkdev;
+    if (res != 0) {
+        PLOG(ERROR) << getId() << " failed to setup cryptfs";
+        return -EIO;
+    }
+
+    return OK;
+}
+
+status_t PrivateVolume::doDestroy() {
+    if (cryptfs_revert_ext_volume(getId().c_str())) {
+        LOG(ERROR) << getId() << " failed to revert cryptfs";
+    }
+    return DestroyDeviceNode(mRawDevPath);
+}
+
+status_t PrivateVolume::doMount() {
+    if (readMetadata()) {
+        LOG(ERROR) << getId() << " failed to read metadata";
+        return -EIO;
+    }
+
+    mPath = StringPrintf("/mnt/expand/%s", mFsUuid.c_str());
+    setPath(mPath);
+
+    if (PrepareDir(mPath, 0700, AID_ROOT, AID_ROOT)) {
+        PLOG(ERROR) << getId() << " failed to create mount point " << mPath;
+        return -EIO;
+    }
+
+    if (mFsType == "ext4") {
+        int res = ext4::Check(mDmDevPath, mPath);
+        if (res == 0 || res == 1) {
+            LOG(DEBUG) << getId() << " passed filesystem check";
+        } else {
+            PLOG(ERROR) << getId() << " failed filesystem check";
+            return -EIO;
+        }
+
+        if (ext4::Mount(mDmDevPath, mPath, false, false, true)) {
+            PLOG(ERROR) << getId() << " failed to mount";
+            return -EIO;
+        }
+
+    } else if (mFsType == "f2fs") {
+        int res = f2fs::Check(mDmDevPath);
+        if (res == 0) {
+            LOG(DEBUG) << getId() << " passed filesystem check";
+        } else {
+            PLOG(ERROR) << getId() << " failed filesystem check";
+            return -EIO;
+        }
+
+        if (f2fs::Mount(mDmDevPath, mPath)) {
+            PLOG(ERROR) << getId() << " failed to mount";
+            return -EIO;
+        }
+
+    } else {
+        LOG(ERROR) << getId() << " unsupported filesystem " << mFsType;
+        return -EIO;
+    }
+
+    LOG(VERBOSE) << "Starting restorecon of " << mPath;
+
+    // TODO: find a cleaner way of waiting for restorecon to finish
+    property_set("selinux.restorecon_recursive", "");
+    property_set("selinux.restorecon_recursive", mPath.c_str());
+
+    char value[PROPERTY_VALUE_MAX];
+    while (true) {
+        property_get("selinux.restorecon_recursive", value, "");
+        if (strcmp(mPath.c_str(), value) == 0) {
+            break;
+        }
+        sleep(1);
+        LOG(VERBOSE) << "Waiting for restorecon...";
+    }
+
+    LOG(VERBOSE) << "Finished restorecon of " << mPath;
+
+    // Verify that common directories are ready to roll
+    if (PrepareDir(mPath + "/app", 0771, AID_SYSTEM, AID_SYSTEM) ||
+            PrepareDir(mPath + "/user", 0711, AID_SYSTEM, AID_SYSTEM) ||
+            PrepareDir(mPath + "/media", 0770, AID_MEDIA_RW, AID_MEDIA_RW) ||
+            PrepareDir(mPath + "/media/0", 0770, AID_MEDIA_RW, AID_MEDIA_RW) ||
+            PrepareDir(mPath + "/local", 0751, AID_ROOT, AID_ROOT) ||
+            PrepareDir(mPath + "/local/tmp", 0771, AID_SHELL, AID_SHELL)) {
+        PLOG(ERROR) << getId() << " failed to prepare";
+        return -EIO;
+    }
+
+    // Create a new emulated volume stacked above us, it will automatically
+    // be destroyed during unmount
+    std::string mediaPath(mPath + "/media");
+    auto vol = std::shared_ptr<VolumeBase>(
+            new EmulatedVolume(mediaPath, mRawDevice, mFsUuid));
+    addVolume(vol);
+    vol->create();
+
+    return OK;
+}
+
+status_t PrivateVolume::doUnmount() {
+    ForceUnmount(mPath);
+
+    if (TEMP_FAILURE_RETRY(rmdir(mPath.c_str()))) {
+        PLOG(ERROR) << getId() << " failed to rmdir mount point " << mPath;
+    }
+
+    return OK;
+}
+
+status_t PrivateVolume::doFormat(const std::string& fsType) {
+    std::string resolvedFsType = fsType;
+    if (fsType == "auto") {
+        // For now, assume that all MMC devices are flash-based SD cards, and
+        // give everyone else ext4 because sysfs rotational isn't reliable.
+        if ((major(mRawDevice) == kMajorBlockMmc) && f2fs::IsSupported()) {
+            resolvedFsType = "f2fs";
+        } else {
+            resolvedFsType = "ext4";
+        }
+        LOG(DEBUG) << "Resolved auto to " << resolvedFsType;
+    }
+
+    if (resolvedFsType == "ext4") {
+        // TODO: change reported mountpoint once we have better selinux support
+        if (ext4::Format(mDmDevPath, 0, "/data")) {
+            PLOG(ERROR) << getId() << " failed to format";
+            return -EIO;
+        }
+    } else if (resolvedFsType == "f2fs") {
+        if (f2fs::Format(mDmDevPath)) {
+            PLOG(ERROR) << getId() << " failed to format";
+            return -EIO;
+        }
+    } else {
+        LOG(ERROR) << getId() << " unsupported filesystem " << fsType;
+        return -EINVAL;
+    }
+
+    return OK;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/PrivateVolume.h b/PrivateVolume.h
new file mode 100644
index 0000000..95b718d
--- /dev/null
+++ b/PrivateVolume.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_PRIVATE_VOLUME_H
+#define ANDROID_VOLD_PRIVATE_VOLUME_H
+
+#include "VolumeBase.h"
+
+#include <cutils/multiuser.h>
+
+namespace android {
+namespace vold {
+
+/*
+ * Private storage provided by an encrypted partition.
+ *
+ * Given a raw block device, it knows how to wrap it in dm-crypt and
+ * format as ext4/f2fs.  EmulatedVolume can be stacked above it.
+ *
+ * This volume is designed to behave much like the internal /data
+ * partition, both in layout and function.  For example, apps and
+ * private app data can be safely stored on this volume because the
+ * keys are tightly tied to this device.
+ */
+class PrivateVolume : public VolumeBase {
+public:
+    PrivateVolume(dev_t device, const std::string& keyRaw);
+    virtual ~PrivateVolume();
+
+protected:
+    status_t doCreate() override;
+    status_t doDestroy() override;
+    status_t doMount() override;
+    status_t doUnmount() override;
+    status_t doFormat(const std::string& fsType) override;
+
+    status_t readMetadata();
+
+private:
+    /* Kernel device of raw, encrypted partition */
+    dev_t mRawDevice;
+    /* Path to raw, encrypted block device */
+    std::string mRawDevPath;
+    /* Path to decrypted block device */
+    std::string mDmDevPath;
+    /* Path where decrypted device is mounted */
+    std::string mPath;
+
+    /* Encryption key as raw bytes */
+    std::string mKeyRaw;
+
+    /* Filesystem type */
+    std::string mFsType;
+    /* Filesystem UUID */
+    std::string mFsUuid;
+    /* User-visible filesystem label */
+    std::string mFsLabel;
+
+    DISALLOW_COPY_AND_ASSIGN(PrivateVolume);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/Process.cpp b/Process.cpp
index cc06998..a6f0cc6 100644
--- a/Process.cpp
+++ b/Process.cpp
@@ -66,7 +66,7 @@
 void Process::getProcessName(int pid, char *buffer, size_t max) {
     int fd;
     snprintf(buffer, max, "/proc/%d/cmdline", pid);
-    fd = open(buffer, O_RDONLY);
+    fd = open(buffer, O_RDONLY | O_CLOEXEC);
     if (fd < 0) {
         strcpy(buffer, "???");
     } else {
@@ -170,18 +170,14 @@
     return result;
 }
 
-extern "C" void vold_killProcessesWithOpenFiles(const char *path, int action) {
-	Process::killProcessesWithOpenFiles(path, action);
+extern "C" void vold_killProcessesWithOpenFiles(const char *path, int signal) {
+	Process::killProcessesWithOpenFiles(path, signal);
 }
 
 /*
  * Hunt down processes that have files open at the given mount point.
- * action = 0 to just warn,
- * action = 1 to SIGHUP,
- * action = 2 to SIGKILL
  */
-// hunt down and kill processes that have files open on the given mount point
-void Process::killProcessesWithOpenFiles(const char *path, int action) {
+void Process::killProcessesWithOpenFiles(const char *path, int signal) {
     DIR*    dir;
     struct dirent* de;
 
@@ -213,12 +209,10 @@
         } else {
             continue;
         }
-        if (action == 1) {
-            SLOGW("Sending SIGHUP to process %d", pid);
-            kill(pid, SIGTERM);
-        } else if (action == 2) {
-            SLOGE("Sending SIGKILL to process %d", pid);
-            kill(pid, SIGKILL);
+
+        if (signal != 0) {
+            SLOGW("Sending %s to process %d", strsignal(signal), pid);
+            kill(pid, signal);
         }
     }
     closedir(dir);
diff --git a/Process.h b/Process.h
index e745ca4..81b5f18 100644
--- a/Process.h
+++ b/Process.h
@@ -21,7 +21,7 @@
 
 class Process {
 public:
-    static void killProcessesWithOpenFiles(const char *path, int action);
+    static void killProcessesWithOpenFiles(const char *path, int signal);
     static int getPid(const char *s);
     static int checkSymLink(int pid, const char *path, const char *name);
     static int checkFileMaps(int pid, const char *path);
@@ -36,7 +36,7 @@
 
 extern "C" {
 #endif /* __cplusplus */
-	void vold_killProcessesWithOpenFiles(const char *path, int action);
+	void vold_killProcessesWithOpenFiles(const char *path, int signal);
 #ifdef __cplusplus
 }
 #endif
diff --git a/PublicVolume.cpp b/PublicVolume.cpp
new file mode 100644
index 0000000..eb550c3
--- /dev/null
+++ b/PublicVolume.cpp
@@ -0,0 +1,237 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "fs/Vfat.h"
+#include "PublicVolume.h"
+#include "Utils.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <cutils/fs.h>
+#include <private/android_filesystem_config.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+static const char* kFusePath = "/system/bin/sdcard";
+
+static const char* kAsecPath = "/mnt/secure/asec";
+
+PublicVolume::PublicVolume(dev_t device) :
+        VolumeBase(Type::kPublic), mDevice(device), mFusePid(0) {
+    setId(StringPrintf("public:%u,%u", major(device), minor(device)));
+    mDevPath = StringPrintf("/dev/block/vold/%s", getId().c_str());
+}
+
+PublicVolume::~PublicVolume() {
+}
+
+status_t PublicVolume::readMetadata() {
+    status_t res = ReadMetadataUntrusted(mDevPath, mFsType, mFsUuid, mFsLabel);
+    notifyEvent(ResponseCode::VolumeFsTypeChanged, mFsType);
+    notifyEvent(ResponseCode::VolumeFsUuidChanged, mFsUuid);
+    notifyEvent(ResponseCode::VolumeFsLabelChanged, mFsLabel);
+    return res;
+}
+
+status_t PublicVolume::initAsecStage() {
+    std::string legacyPath(mRawPath + "/android_secure");
+    std::string securePath(mRawPath + "/.android_secure");
+
+    // Recover legacy secure path
+    if (!access(legacyPath.c_str(), R_OK | X_OK)
+            && access(securePath.c_str(), R_OK | X_OK)) {
+        if (rename(legacyPath.c_str(), securePath.c_str())) {
+            PLOG(WARNING) << getId() << " failed to rename legacy ASEC dir";
+        }
+    }
+
+    if (TEMP_FAILURE_RETRY(mkdir(securePath.c_str(), 0700))) {
+        if (errno != EEXIST) {
+            PLOG(WARNING) << getId() << " creating ASEC stage failed";
+            return -errno;
+        }
+    }
+
+    BindMount(securePath, kAsecPath);
+
+    return OK;
+}
+
+status_t PublicVolume::doCreate() {
+    return CreateDeviceNode(mDevPath, mDevice);
+}
+
+status_t PublicVolume::doDestroy() {
+    return DestroyDeviceNode(mDevPath);
+}
+
+status_t PublicVolume::doMount() {
+    // TODO: expand to support mounting other filesystems
+    readMetadata();
+
+    if (mFsType != "vfat") {
+        LOG(ERROR) << getId() << " unsupported filesystem " << mFsType;
+        return -EIO;
+    }
+
+    if (vfat::Check(mDevPath)) {
+        LOG(ERROR) << getId() << " failed filesystem check";
+        return -EIO;
+    }
+
+    // Use UUID as stable name, if available
+    std::string stableName = getId();
+    if (!mFsUuid.empty()) {
+        stableName = mFsUuid;
+    }
+
+    mRawPath = StringPrintf("/mnt/media_rw/%s", stableName.c_str());
+
+    mFuseDefault = StringPrintf("/mnt/runtime/default/%s", stableName.c_str());
+    mFuseRead = StringPrintf("/mnt/runtime/read/%s", stableName.c_str());
+    mFuseWrite = StringPrintf("/mnt/runtime/write/%s", stableName.c_str());
+
+    setInternalPath(mRawPath);
+    if (getMountFlags() & MountFlags::kVisible) {
+        setPath(StringPrintf("/storage/%s", stableName.c_str()));
+    } else {
+        setPath(mRawPath);
+    }
+
+    if (fs_prepare_dir(mRawPath.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseDefault.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseRead.c_str(), 0700, AID_ROOT, AID_ROOT) ||
+            fs_prepare_dir(mFuseWrite.c_str(), 0700, AID_ROOT, AID_ROOT)) {
+        PLOG(ERROR) << getId() << " failed to create mount points";
+        return -errno;
+    }
+
+    if (vfat::Mount(mDevPath, mRawPath, false, false, false,
+            AID_MEDIA_RW, AID_MEDIA_RW, 0007, true)) {
+        PLOG(ERROR) << getId() << " failed to mount " << mDevPath;
+        return -EIO;
+    }
+
+    if (getMountFlags() & MountFlags::kPrimary) {
+        initAsecStage();
+    }
+
+    if (!(getMountFlags() & MountFlags::kVisible)) {
+        // Not visible to apps, so no need to spin up FUSE
+        return OK;
+    }
+
+    dev_t before = GetDevice(mFuseWrite);
+
+    if (!(mFusePid = fork())) {
+        if (getMountFlags() & MountFlags::kPrimary) {
+            if (execl(kFusePath, kFusePath,
+                    "-u", "1023", // AID_MEDIA_RW
+                    "-g", "1023", // AID_MEDIA_RW
+                    "-U", std::to_string(getMountUserId()).c_str(),
+                    "-w",
+                    mRawPath.c_str(),
+                    stableName.c_str(),
+                    NULL)) {
+                PLOG(ERROR) << "Failed to exec";
+            }
+        } else {
+            if (execl(kFusePath, kFusePath,
+                    "-u", "1023", // AID_MEDIA_RW
+                    "-g", "1023", // AID_MEDIA_RW
+                    "-U", std::to_string(getMountUserId()).c_str(),
+                    mRawPath.c_str(),
+                    stableName.c_str(),
+                    NULL)) {
+                PLOG(ERROR) << "Failed to exec";
+            }
+        }
+
+        LOG(ERROR) << "FUSE exiting";
+        _exit(1);
+    }
+
+    if (mFusePid == -1) {
+        PLOG(ERROR) << getId() << " failed to fork";
+        return -errno;
+    }
+
+    while (before == GetDevice(mFuseWrite)) {
+        LOG(VERBOSE) << "Waiting for FUSE to spin up...";
+        usleep(50000); // 50ms
+    }
+
+    return OK;
+}
+
+status_t PublicVolume::doUnmount() {
+    if (mFusePid > 0) {
+        kill(mFusePid, SIGTERM);
+        TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0));
+        mFusePid = 0;
+    }
+
+    ForceUnmount(kAsecPath);
+
+    ForceUnmount(mFuseDefault);
+    ForceUnmount(mFuseRead);
+    ForceUnmount(mFuseWrite);
+    ForceUnmount(mRawPath);
+
+    rmdir(mFuseDefault.c_str());
+    rmdir(mFuseRead.c_str());
+    rmdir(mFuseWrite.c_str());
+    rmdir(mRawPath.c_str());
+
+    mFuseDefault.clear();
+    mFuseRead.clear();
+    mFuseWrite.clear();
+    mRawPath.clear();
+
+    return OK;
+}
+
+status_t PublicVolume::doFormat(const std::string& fsType) {
+    if (fsType == "vfat" || fsType == "auto") {
+        if (WipeBlockDevice(mDevPath) != OK) {
+            LOG(WARNING) << getId() << " failed to wipe";
+        }
+        if (vfat::Format(mDevPath, 0)) {
+            LOG(ERROR) << getId() << " failed to format";
+            return -errno;
+        }
+    } else {
+        LOG(ERROR) << "Unsupported filesystem " << fsType;
+        return -EINVAL;
+    }
+
+    return OK;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/PublicVolume.h b/PublicVolume.h
new file mode 100644
index 0000000..3aa7a73
--- /dev/null
+++ b/PublicVolume.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_PUBLIC_VOLUME_H
+#define ANDROID_VOLD_PUBLIC_VOLUME_H
+
+#include "VolumeBase.h"
+
+#include <cutils/multiuser.h>
+
+namespace android {
+namespace vold {
+
+/*
+ * Shared storage provided by public (vfat) partition.
+ *
+ * Knows how to mount itself and then spawn a FUSE daemon to synthesize
+ * permissions.  AsecVolume and ObbVolume can be stacked above it.
+ *
+ * This volume is not inherently multi-user aware, so it has two possible
+ * modes of operation:
+ * 1. If primary storage for the device, it only binds itself to the
+ * owner user.
+ * 2. If secondary storage, it binds itself for all users, but masks
+ * away the Android directory for secondary users.
+ */
+class PublicVolume : public VolumeBase {
+public:
+    explicit PublicVolume(dev_t device);
+    virtual ~PublicVolume();
+
+protected:
+    status_t doCreate() override;
+    status_t doDestroy() override;
+    status_t doMount() override;
+    status_t doUnmount() override;
+    status_t doFormat(const std::string& fsType) override;
+
+    status_t readMetadata();
+    status_t initAsecStage();
+
+private:
+    /* Kernel device representing partition */
+    dev_t mDevice;
+    /* Block device path */
+    std::string mDevPath;
+    /* Mount point of raw partition */
+    std::string mRawPath;
+
+    std::string mFuseDefault;
+    std::string mFuseRead;
+    std::string mFuseWrite;
+
+    /* PID of FUSE wrapper */
+    pid_t mFusePid;
+
+    /* Filesystem type */
+    std::string mFsType;
+    /* Filesystem UUID */
+    std::string mFsUuid;
+    /* User-visible filesystem label */
+    std::string mFsLabel;
+
+    DISALLOW_COPY_AND_ASSIGN(PublicVolume);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/ResponseCode.h b/ResponseCode.h
index 0dc0500..f2c533e 100644
--- a/ResponseCode.h
+++ b/ResponseCode.h
@@ -66,6 +66,26 @@
     static const int VolumeDiskRemoved             = 631;
     static const int VolumeBadRemoval              = 632;
 
+    static const int DiskCreated = 640;
+    static const int DiskSizeChanged = 641;
+    static const int DiskLabelChanged = 642;
+    static const int DiskScanned = 643;
+    static const int DiskSysPathChanged = 644;
+    static const int DiskDestroyed = 649;
+
+    static const int VolumeCreated = 650;
+    static const int VolumeStateChanged = 651;
+    static const int VolumeFsTypeChanged = 652;
+    static const int VolumeFsUuidChanged = 653;
+    static const int VolumeFsLabelChanged = 654;
+    static const int VolumePathChanged = 655;
+    static const int VolumeInternalPathChanged = 656;
+    static const int VolumeDestroyed = 659;
+
+    static const int MoveStatus = 660;
+    static const int BenchmarkResult = 661;
+    static const int TrimResult = 662;
+
     static int convertFromErrno();
 };
 #endif
diff --git a/TrimTask.cpp b/TrimTask.cpp
new file mode 100644
index 0000000..1c6eb1f
--- /dev/null
+++ b/TrimTask.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "TrimTask.h"
+#include "Benchmark.h"
+#include "Utils.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+#include <cutils/properties.h>
+#include <fs_mgr.h>
+#include <private/android_filesystem_config.h>
+#include <hardware_legacy/power.h>
+
+#include <dirent.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+
+/* From a would-be kernel header */
+#define FIDTRIM         _IOWR('f', 128, struct fstrim_range)    /* Deep discard trim */
+
+#define BENCHMARK_ENABLED 0
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+static const char* kWakeLock = "TrimTask";
+
+TrimTask::TrimTask(int flags) : mFlags(flags) {
+    // Collect both fstab and vold volumes
+    addFromFstab();
+
+    VolumeManager* vm = VolumeManager::Instance();
+    std::list<std::string> privateIds;
+    vm->listVolumes(VolumeBase::Type::kPrivate, privateIds);
+    for (auto id : privateIds) {
+        auto vol = vm->findVolume(id);
+        if (vol != nullptr && vol->getState() == VolumeBase::State::kMounted) {
+            mPaths.push_back(vol->getPath());
+        }
+    }
+}
+
+TrimTask::~TrimTask() {
+}
+
+void TrimTask::addFromFstab() {
+    struct fstab *fstab;
+    struct fstab_rec *prev_rec = NULL;
+
+    fstab = fs_mgr_read_fstab(android::vold::DefaultFstabPath().c_str());
+    for (int i = 0; i < fstab->num_entries; i++) {
+        /* Skip raw partitions */
+        if (!strcmp(fstab->recs[i].fs_type, "emmc") ||
+            !strcmp(fstab->recs[i].fs_type, "mtd")) {
+            continue;
+        }
+        /* Skip read-only filesystems */
+        if (fstab->recs[i].flags & MS_RDONLY) {
+            continue;
+        }
+        if (fs_mgr_is_voldmanaged(&fstab->recs[i])) {
+            continue; /* Should we trim fat32 filesystems? */
+        }
+        if (fs_mgr_is_notrim(&fstab->recs[i])) {
+            continue;
+        }
+
+        /* Skip the multi-type partitions, which are required to be following each other.
+         * See fs_mgr.c's mount_with_alternatives().
+         */
+        if (prev_rec && !strcmp(prev_rec->mount_point, fstab->recs[i].mount_point)) {
+            continue;
+        }
+
+        mPaths.push_back(fstab->recs[i].mount_point);
+        prev_rec = &fstab->recs[i];
+    }
+    fs_mgr_free_fstab(fstab);
+}
+
+void TrimTask::start() {
+    mThread = std::thread(&TrimTask::run, this);
+}
+
+static void notifyResult(const std::string& path, int64_t bytes, int64_t delta) {
+    std::string res(path
+            + " " + std::to_string(bytes)
+            + " " + std::to_string(delta));
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(
+            ResponseCode::TrimResult, res.c_str(), false);
+}
+
+void TrimTask::run() {
+    acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock);
+
+    for (auto path : mPaths) {
+        LOG(DEBUG) << "Starting trim of " << path;
+
+        int fd = open(path.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
+        if (fd < 0) {
+            PLOG(WARNING) << "Failed to open " << path;
+            continue;
+        }
+
+        struct fstrim_range range;
+        memset(&range, 0, sizeof(range));
+        range.len = ULLONG_MAX;
+
+        nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME);
+        if (ioctl(fd, (mFlags & Flags::kDeepTrim) ? FIDTRIM : FITRIM, &range)) {
+            PLOG(WARNING) << "Trim failed on " << path;
+            notifyResult(path, -1, -1);
+        } else {
+            nsecs_t delta = systemTime(SYSTEM_TIME_BOOTTIME) - start;
+            LOG(INFO) << "Trimmed " << range.len << " bytes on " << path
+                    << " in " << nanoseconds_to_milliseconds(delta) << "ms";
+            notifyResult(path, range.len, delta);
+        }
+        close(fd);
+
+        if (mFlags & Flags::kBenchmarkAfter) {
+#if BENCHMARK_ENABLED
+            BenchmarkPrivate(path);
+#else
+            LOG(DEBUG) << "Benchmark disabled";
+#endif
+        }
+    }
+
+    release_wake_lock(kWakeLock);
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/TrimTask.h b/TrimTask.h
new file mode 100644
index 0000000..57be802
--- /dev/null
+++ b/TrimTask.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_TRIM_TASK_H
+#define ANDROID_VOLD_TRIM_TASK_H
+
+#include "Utils.h"
+
+#include <thread>
+#include <list>
+
+namespace android {
+namespace vold {
+
+class TrimTask {
+public:
+    TrimTask(int flags);
+    virtual ~TrimTask();
+
+    enum Flags {
+        kDeepTrim = 1 << 0,
+        kBenchmarkAfter = 1 << 1,
+    };
+
+    void start();
+
+private:
+    int mFlags;
+    std::list<std::string> mPaths;
+    std::thread mThread;
+
+    void addFromFstab();
+    void run();
+
+    DISALLOW_COPY_AND_ASSIGN(TrimTask);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/Utils.cpp b/Utils.cpp
new file mode 100644
index 0000000..e19c9df
--- /dev/null
+++ b/Utils.cpp
@@ -0,0 +1,549 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "sehandle.h"
+#include "Utils.h"
+#include "Process.h"
+
+#include <base/file.h>
+#include <base/logging.h>
+#include <base/stringprintf.h>
+#include <cutils/fs.h>
+#include <cutils/properties.h>
+#include <private/android_filesystem_config.h>
+#include <logwrap/logwrap.h>
+
+#include <mutex>
+#include <dirent.h>
+#include <fcntl.h>
+#include <linux/fs.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/statvfs.h>
+
+#ifndef UMOUNT_NOFOLLOW
+#define UMOUNT_NOFOLLOW    0x00000008  /* Don't follow symlink on umount */
+#endif
+
+using android::base::ReadFileToString;
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+
+security_context_t sBlkidContext = nullptr;
+security_context_t sBlkidUntrustedContext = nullptr;
+security_context_t sFsckContext = nullptr;
+security_context_t sFsckUntrustedContext = nullptr;
+
+static const char* kBlkidPath = "/system/bin/blkid";
+static const char* kKeyPath = "/data/misc/vold";
+
+static const char* kProcFilesystems = "/proc/filesystems";
+
+status_t CreateDeviceNode(const std::string& path, dev_t dev) {
+    const char* cpath = path.c_str();
+    status_t res = 0;
+
+    char* secontext = nullptr;
+    if (sehandle) {
+        if (!selabel_lookup(sehandle, &secontext, cpath, S_IFBLK)) {
+            setfscreatecon(secontext);
+        }
+    }
+
+    mode_t mode = 0660 | S_IFBLK;
+    if (mknod(cpath, mode, dev) < 0) {
+        if (errno != EEXIST) {
+            PLOG(ERROR) << "Failed to create device node for " << major(dev)
+                    << ":" << minor(dev) << " at " << path;
+            res = -errno;
+        }
+    }
+
+    if (secontext) {
+        setfscreatecon(nullptr);
+        freecon(secontext);
+    }
+
+    return res;
+}
+
+status_t DestroyDeviceNode(const std::string& path) {
+    const char* cpath = path.c_str();
+    if (TEMP_FAILURE_RETRY(unlink(cpath))) {
+        return -errno;
+    } else {
+        return OK;
+    }
+}
+
+status_t PrepareDir(const std::string& path, mode_t mode, uid_t uid, gid_t gid) {
+    const char* cpath = path.c_str();
+
+    char* secontext = nullptr;
+    if (sehandle) {
+        if (!selabel_lookup(sehandle, &secontext, cpath, S_IFDIR)) {
+            setfscreatecon(secontext);
+        }
+    }
+
+    int res = fs_prepare_dir(cpath, mode, uid, gid);
+
+    if (secontext) {
+        setfscreatecon(nullptr);
+        freecon(secontext);
+    }
+
+    if (res == 0) {
+        return OK;
+    } else {
+        return -errno;
+    }
+}
+
+status_t ForceUnmount(const std::string& path) {
+    const char* cpath = path.c_str();
+    if (!umount2(cpath, UMOUNT_NOFOLLOW) || errno == EINVAL || errno == ENOENT) {
+        return OK;
+    }
+    PLOG(WARNING) << "Failed to unmount " << path;
+
+    sleep(5);
+    Process::killProcessesWithOpenFiles(cpath, SIGINT);
+
+    if (!umount2(cpath, UMOUNT_NOFOLLOW) || errno == EINVAL || errno == ENOENT) {
+        return OK;
+    }
+    PLOG(WARNING) << "Failed to unmount " << path;
+
+    sleep(5);
+    Process::killProcessesWithOpenFiles(cpath, SIGTERM);
+
+    if (!umount2(cpath, UMOUNT_NOFOLLOW) || errno == EINVAL || errno == ENOENT) {
+        return OK;
+    }
+    PLOG(WARNING) << "Failed to unmount " << path;
+
+    sleep(5);
+    Process::killProcessesWithOpenFiles(cpath, SIGKILL);
+
+    if (!umount2(cpath, UMOUNT_NOFOLLOW) || errno == EINVAL || errno == ENOENT) {
+        return OK;
+    }
+    PLOG(ERROR) << "Failed to unmount " << path;
+
+    return -errno;
+}
+
+status_t BindMount(const std::string& source, const std::string& target) {
+    if (::mount(source.c_str(), target.c_str(), "", MS_BIND, NULL)) {
+        PLOG(ERROR) << "Failed to bind mount " << source << " to " << target;
+        return -errno;
+    }
+    return OK;
+}
+
+static status_t readMetadata(const std::string& path, std::string& fsType,
+        std::string& fsUuid, std::string& fsLabel, bool untrusted) {
+    fsType.clear();
+    fsUuid.clear();
+    fsLabel.clear();
+
+    std::vector<std::string> cmd;
+    cmd.push_back(kBlkidPath);
+    cmd.push_back("-c");
+    cmd.push_back("/dev/null");
+    cmd.push_back("-s");
+    cmd.push_back("TYPE");
+    cmd.push_back("-s");
+    cmd.push_back("UUID");
+    cmd.push_back("-s");
+    cmd.push_back("LABEL");
+    cmd.push_back(path);
+
+    std::vector<std::string> output;
+    status_t res = ForkExecvp(cmd, output, untrusted ? sBlkidUntrustedContext : sBlkidContext);
+    if (res != OK) {
+        LOG(WARNING) << "blkid failed to identify " << path;
+        return res;
+    }
+
+    char value[128];
+    for (auto line : output) {
+        // Extract values from blkid output, if defined
+        const char* cline = line.c_str();
+        char* start = strstr(cline, "TYPE=");
+        if (start != nullptr && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
+            fsType = value;
+        }
+
+        start = strstr(cline, "UUID=");
+        if (start != nullptr && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
+            fsUuid = value;
+        }
+
+        start = strstr(cline, "LABEL=");
+        if (start != nullptr && sscanf(start + 6, "\"%127[^\"]\"", value) == 1) {
+            fsLabel = value;
+        }
+    }
+
+    return OK;
+}
+
+status_t ReadMetadata(const std::string& path, std::string& fsType,
+        std::string& fsUuid, std::string& fsLabel) {
+    return readMetadata(path, fsType, fsUuid, fsLabel, false);
+}
+
+status_t ReadMetadataUntrusted(const std::string& path, std::string& fsType,
+        std::string& fsUuid, std::string& fsLabel) {
+    return readMetadata(path, fsType, fsUuid, fsLabel, true);
+}
+
+status_t ForkExecvp(const std::vector<std::string>& args) {
+    return ForkExecvp(args, nullptr);
+}
+
+status_t ForkExecvp(const std::vector<std::string>& args, security_context_t context) {
+    size_t argc = args.size();
+    char** argv = (char**) calloc(argc, sizeof(char*));
+    for (size_t i = 0; i < argc; i++) {
+        argv[i] = (char*) args[i].c_str();
+        if (i == 0) {
+            LOG(VERBOSE) << args[i];
+        } else {
+            LOG(VERBOSE) << "    " << args[i];
+        }
+    }
+
+    if (setexeccon(context)) {
+        LOG(ERROR) << "Failed to setexeccon";
+        abort();
+    }
+    status_t res = android_fork_execvp(argc, argv, NULL, false, true);
+    if (setexeccon(nullptr)) {
+        LOG(ERROR) << "Failed to setexeccon";
+        abort();
+    }
+
+    free(argv);
+    return res;
+}
+
+status_t ForkExecvp(const std::vector<std::string>& args,
+        std::vector<std::string>& output) {
+    return ForkExecvp(args, output, nullptr);
+}
+
+status_t ForkExecvp(const std::vector<std::string>& args,
+        std::vector<std::string>& output, security_context_t context) {
+    std::string cmd;
+    for (size_t i = 0; i < args.size(); i++) {
+        cmd += args[i] + " ";
+        if (i == 0) {
+            LOG(VERBOSE) << args[i];
+        } else {
+            LOG(VERBOSE) << "    " << args[i];
+        }
+    }
+    output.clear();
+
+    if (setexeccon(context)) {
+        LOG(ERROR) << "Failed to setexeccon";
+        abort();
+    }
+    FILE* fp = popen(cmd.c_str(), "r");
+    if (setexeccon(nullptr)) {
+        LOG(ERROR) << "Failed to setexeccon";
+        abort();
+    }
+
+    if (!fp) {
+        PLOG(ERROR) << "Failed to popen " << cmd;
+        return -errno;
+    }
+    char line[1024];
+    while (fgets(line, sizeof(line), fp) != nullptr) {
+        LOG(VERBOSE) << line;
+        output.push_back(std::string(line));
+    }
+    if (pclose(fp) != 0) {
+        PLOG(ERROR) << "Failed to pclose " << cmd;
+        return -errno;
+    }
+
+    return OK;
+}
+
+pid_t ForkExecvpAsync(const std::vector<std::string>& args) {
+    size_t argc = args.size();
+    char** argv = (char**) calloc(argc + 1, sizeof(char*));
+    for (size_t i = 0; i < argc; i++) {
+        argv[i] = (char*) args[i].c_str();
+        if (i == 0) {
+            LOG(VERBOSE) << args[i];
+        } else {
+            LOG(VERBOSE) << "    " << args[i];
+        }
+    }
+
+    pid_t pid = fork();
+    if (pid == 0) {
+        close(STDIN_FILENO);
+        close(STDOUT_FILENO);
+        close(STDERR_FILENO);
+
+        if (execvp(argv[0], argv)) {
+            PLOG(ERROR) << "Failed to exec";
+        }
+
+        _exit(1);
+    }
+
+    if (pid == -1) {
+        PLOG(ERROR) << "Failed to exec";
+    }
+
+    free(argv);
+    return pid;
+}
+
+status_t ReadRandomBytes(size_t bytes, std::string& out) {
+    out.clear();
+
+    int fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY | O_CLOEXEC | O_NOFOLLOW));
+    if (fd == -1) {
+        return -errno;
+    }
+
+    char buf[BUFSIZ];
+    size_t n;
+    while ((n = TEMP_FAILURE_RETRY(read(fd, &buf[0], std::min(sizeof(buf), bytes)))) > 0) {
+        out.append(buf, n);
+        bytes -= n;
+    }
+    close(fd);
+
+    if (bytes == 0) {
+        return OK;
+    } else {
+        return -EIO;
+    }
+}
+
+status_t HexToStr(const std::string& hex, std::string& str) {
+    str.clear();
+    bool even = true;
+    char cur = 0;
+    for (size_t i = 0; i < hex.size(); i++) {
+        int val = 0;
+        switch (hex[i]) {
+        case ' ': case '-': case ':': continue;
+        case 'f': case 'F': val = 15; break;
+        case 'e': case 'E': val = 14; break;
+        case 'd': case 'D': val = 13; break;
+        case 'c': case 'C': val = 12; break;
+        case 'b': case 'B': val = 11; break;
+        case 'a': case 'A': val = 10; break;
+        case '9': val = 9; break;
+        case '8': val = 8; break;
+        case '7': val = 7; break;
+        case '6': val = 6; break;
+        case '5': val = 5; break;
+        case '4': val = 4; break;
+        case '3': val = 3; break;
+        case '2': val = 2; break;
+        case '1': val = 1; break;
+        case '0': val = 0; break;
+        default: return -EINVAL;
+        }
+
+        if (even) {
+            cur = val << 4;
+        } else {
+            cur += val;
+            str.push_back(cur);
+            cur = 0;
+        }
+        even = !even;
+    }
+    return even ? OK : -EINVAL;
+}
+
+static const char* kLookup = "0123456789abcdef";
+
+status_t StrToHex(const std::string& str, std::string& hex) {
+    hex.clear();
+    for (size_t i = 0; i < str.size(); i++) {
+        hex.push_back(kLookup[(str[i] & 0xF0) >> 4]);
+        hex.push_back(kLookup[str[i] & 0x0F]);
+    }
+    return OK;
+}
+
+status_t NormalizeHex(const std::string& in, std::string& out) {
+    std::string tmp;
+    if (HexToStr(in, tmp)) {
+        return -EINVAL;
+    }
+    return StrToHex(tmp, out);
+}
+
+uint64_t GetFreeBytes(const std::string& path) {
+    struct statvfs sb;
+    if (statvfs(path.c_str(), &sb) == 0) {
+        return sb.f_bfree * sb.f_bsize;
+    } else {
+        return -1;
+    }
+}
+
+// TODO: borrowed from frameworks/native/libs/diskusage/ which should
+// eventually be migrated into system/
+static int64_t stat_size(struct stat *s) {
+    int64_t blksize = s->st_blksize;
+    // count actual blocks used instead of nominal file size
+    int64_t size = s->st_blocks * 512;
+
+    if (blksize) {
+        /* round up to filesystem block size */
+        size = (size + blksize - 1) & (~(blksize - 1));
+    }
+
+    return size;
+}
+
+// TODO: borrowed from frameworks/native/libs/diskusage/ which should
+// eventually be migrated into system/
+int64_t calculate_dir_size(int dfd) {
+    int64_t size = 0;
+    struct stat s;
+    DIR *d;
+    struct dirent *de;
+
+    d = fdopendir(dfd);
+    if (d == NULL) {
+        close(dfd);
+        return 0;
+    }
+
+    while ((de = readdir(d))) {
+        const char *name = de->d_name;
+        if (fstatat(dfd, name, &s, AT_SYMLINK_NOFOLLOW) == 0) {
+            size += stat_size(&s);
+        }
+        if (de->d_type == DT_DIR) {
+            int subfd;
+
+            /* always skip "." and ".." */
+            if (name[0] == '.') {
+                if (name[1] == 0)
+                    continue;
+                if ((name[1] == '.') && (name[2] == 0))
+                    continue;
+            }
+
+            subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY);
+            if (subfd >= 0) {
+                size += calculate_dir_size(subfd);
+            }
+        }
+    }
+    closedir(d);
+    return size;
+}
+
+uint64_t GetTreeBytes(const std::string& path) {
+    int dirfd = open(path.c_str(), O_DIRECTORY, O_RDONLY);
+    if (dirfd < 0) {
+        PLOG(WARNING) << "Failed to open " << path;
+        return -1;
+    } else {
+        uint64_t res = calculate_dir_size(dirfd);
+        close(dirfd);
+        return res;
+    }
+}
+
+bool IsFilesystemSupported(const std::string& fsType) {
+    std::string supported;
+    if (!ReadFileToString(kProcFilesystems, &supported)) {
+        PLOG(ERROR) << "Failed to read supported filesystems";
+        return false;
+    }
+    return supported.find(fsType + "\n") != std::string::npos;
+}
+
+status_t WipeBlockDevice(const std::string& path) {
+    status_t res = -1;
+    const char* c_path = path.c_str();
+    unsigned long nr_sec = 0;
+    unsigned long long range[2];
+
+    int fd = TEMP_FAILURE_RETRY(open(c_path, O_RDWR | O_CLOEXEC));
+    if (fd == -1) {
+        PLOG(ERROR) << "Failed to open " << path;
+        goto done;
+    }
+
+    if ((ioctl(fd, BLKGETSIZE, nr_sec)) == -1) {
+        PLOG(ERROR) << "Failed to determine size of " << path;
+        goto done;
+    }
+
+    range[0] = 0;
+    range[1] = (unsigned long long) nr_sec * 512;
+
+    LOG(INFO) << "About to discard " << range[1] << " on " << path;
+    if (ioctl(fd, BLKDISCARD, &range) == 0) {
+        LOG(INFO) << "Discard success on " << path;
+        res = 0;
+    } else {
+        PLOG(ERROR) << "Discard failure on " << path;
+    }
+
+done:
+    close(fd);
+    return res;
+}
+
+std::string BuildKeyPath(const std::string& partGuid) {
+    return StringPrintf("%s/expand_%s.key", kKeyPath, partGuid.c_str());
+}
+
+dev_t GetDevice(const std::string& path) {
+    struct stat sb;
+    if (stat(path.c_str(), &sb)) {
+        PLOG(WARNING) << "Failed to stat " << path;
+        return 0;
+    } else {
+        return sb.st_dev;
+    }
+}
+
+std::string DefaultFstabPath() {
+    char hardware[PROPERTY_VALUE_MAX];
+    property_get("ro.hardware", hardware, "");
+    return StringPrintf("/fstab.%s", hardware);
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/Utils.h b/Utils.h
new file mode 100644
index 0000000..f33a379
--- /dev/null
+++ b/Utils.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_UTILS_H
+#define ANDROID_VOLD_UTILS_H
+
+#include <utils/Errors.h>
+#include <selinux/selinux.h>
+
+#include <vector>
+#include <string>
+
+// DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions. It goes in the private:
+// declarations in a class.
+#if !defined(DISALLOW_COPY_AND_ASSIGN)
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+    TypeName(const TypeName&) = delete;  \
+    void operator=(const TypeName&) = delete
+#endif
+
+namespace android {
+namespace vold {
+
+/* SELinux contexts used depending on the block device type */
+extern security_context_t sBlkidContext;
+extern security_context_t sBlkidUntrustedContext;
+extern security_context_t sFsckContext;
+extern security_context_t sFsckUntrustedContext;
+
+status_t CreateDeviceNode(const std::string& path, dev_t dev);
+status_t DestroyDeviceNode(const std::string& path);
+
+/* fs_prepare_dir wrapper that creates with SELinux context */
+status_t PrepareDir(const std::string& path, mode_t mode, uid_t uid, gid_t gid);
+
+/* Really unmounts the path, killing active processes along the way */
+status_t ForceUnmount(const std::string& path);
+
+/* Creates bind mount from source to target */
+status_t BindMount(const std::string& source, const std::string& target);
+
+/* Reads filesystem metadata from device at path */
+status_t ReadMetadata(const std::string& path, std::string& fsType,
+        std::string& fsUuid, std::string& fsLabel);
+
+/* Reads filesystem metadata from untrusted device at path */
+status_t ReadMetadataUntrusted(const std::string& path, std::string& fsType,
+        std::string& fsUuid, std::string& fsLabel);
+
+/* Returns either WEXITSTATUS() status, or a negative errno */
+status_t ForkExecvp(const std::vector<std::string>& args);
+status_t ForkExecvp(const std::vector<std::string>& args, security_context_t context);
+
+status_t ForkExecvp(const std::vector<std::string>& args,
+        std::vector<std::string>& output);
+status_t ForkExecvp(const std::vector<std::string>& args,
+        std::vector<std::string>& output, security_context_t context);
+
+pid_t ForkExecvpAsync(const std::vector<std::string>& args);
+
+status_t ReadRandomBytes(size_t bytes, std::string& out);
+
+/* Converts hex string to raw bytes, ignoring [ :-] */
+status_t HexToStr(const std::string& hex, std::string& str);
+/* Converts raw bytes to hex string */
+status_t StrToHex(const std::string& str, std::string& hex);
+/* Normalize given hex string into consistent format */
+status_t NormalizeHex(const std::string& in, std::string& out);
+
+uint64_t GetFreeBytes(const std::string& path);
+uint64_t GetTreeBytes(const std::string& path);
+
+bool IsFilesystemSupported(const std::string& fsType);
+
+/* Wipes contents of block device at given path */
+status_t WipeBlockDevice(const std::string& path);
+
+std::string BuildKeyPath(const std::string& partGuid);
+
+dev_t GetDevice(const std::string& path);
+
+std::string DefaultFstabPath();
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/Volume.cpp b/Volume.cpp
deleted file mode 100644
index ce4ed1e..0000000
--- a/Volume.cpp
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <mntent.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/param.h>
-
-#include <linux/kdev_t.h>
-
-#include <cutils/properties.h>
-
-#include <diskconfig/diskconfig.h>
-
-#include <private/android_filesystem_config.h>
-
-#define LOG_TAG "Vold"
-
-#include <cutils/fs.h>
-#include <cutils/log.h>
-
-#include <string>
-
-#include "Volume.h"
-#include "VolumeManager.h"
-#include "ResponseCode.h"
-#include "Fat.h"
-#include "Process.h"
-#include "cryptfs.h"
-#include "sehandle.h"
-
-extern "C" void dos_partition_dec(void const *pp, struct dos_partition *d);
-extern "C" void dos_partition_enc(void *pp, struct dos_partition *d);
-
-
-/*
- * Media directory - stuff that only media_rw user can see
- */
-const char *Volume::MEDIA_DIR           = "/mnt/media_rw";
-
-/*
- * Fuse directory - location where fuse wrapped filesystems go
- */
-const char *Volume::FUSE_DIR           = "/storage";
-
-/*
- * Path to external storage where *only* root can access ASEC image files
- */
-const char *Volume::SEC_ASECDIR_EXT   = "/mnt/secure/asec";
-
-/*
- * Path to internal storage where *only* root can access ASEC image files
- */
-const char *Volume::SEC_ASECDIR_INT   = "/data/app-asec";
-
-/*
- * Path to where secure containers are mounted
- */
-const char *Volume::ASECDIR           = "/mnt/asec";
-
-/*
- * Path to where OBBs are mounted
- */
-const char *Volume::LOOPDIR           = "/mnt/obb";
-
-const char *Volume::BLKID_PATH = "/system/bin/blkid";
-
-static const char *stateToStr(int state) {
-    if (state == Volume::State_Init)
-        return "Initializing";
-    else if (state == Volume::State_NoMedia)
-        return "No-Media";
-    else if (state == Volume::State_Idle)
-        return "Idle-Unmounted";
-    else if (state == Volume::State_Pending)
-        return "Pending";
-    else if (state == Volume::State_Mounted)
-        return "Mounted";
-    else if (state == Volume::State_Unmounting)
-        return "Unmounting";
-    else if (state == Volume::State_Checking)
-        return "Checking";
-    else if (state == Volume::State_Formatting)
-        return "Formatting";
-    else if (state == Volume::State_Shared)
-        return "Shared-Unmounted";
-    else if (state == Volume::State_SharedMnt)
-        return "Shared-Mounted";
-    else
-        return "Unknown-Error";
-}
-
-Volume::Volume(VolumeManager *vm, const fstab_rec* rec, int flags) {
-    mVm = vm;
-    mDebug = false;
-    mLabel = strdup(rec->label);
-    mUuid = NULL;
-    mUserLabel = NULL;
-    mState = Volume::State_Init;
-    mFlags = flags;
-    mCurrentlyMountedKdev = -1;
-    mPartIdx = rec->partnum;
-    mRetryMount = false;
-}
-
-Volume::~Volume() {
-    free(mLabel);
-    free(mUuid);
-    free(mUserLabel);
-}
-
-void Volume::setDebug(bool enable) {
-    mDebug = enable;
-}
-
-dev_t Volume::getDiskDevice() {
-    return MKDEV(0, 0);
-};
-
-dev_t Volume::getShareDevice() {
-    return getDiskDevice();
-}
-
-void Volume::handleVolumeShared() {
-}
-
-void Volume::handleVolumeUnshared() {
-}
-
-int Volume::handleBlockEvent(NetlinkEvent * /*evt*/) {
-    errno = ENOSYS;
-    return -1;
-}
-
-void Volume::setUuid(const char* uuid) {
-    char msg[256];
-
-    if (mUuid) {
-        free(mUuid);
-    }
-
-    if (uuid) {
-        mUuid = strdup(uuid);
-        snprintf(msg, sizeof(msg), "%s %s \"%s\"", getLabel(),
-                getFuseMountpoint(), mUuid);
-    } else {
-        mUuid = NULL;
-        snprintf(msg, sizeof(msg), "%s %s", getLabel(), getFuseMountpoint());
-    }
-
-    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeUuidChange, msg,
-            false);
-}
-
-void Volume::setUserLabel(const char* userLabel) {
-    char msg[256];
-
-    if (mUserLabel) {
-        free(mUserLabel);
-    }
-
-    if (userLabel) {
-        mUserLabel = strdup(userLabel);
-        snprintf(msg, sizeof(msg), "%s %s \"%s\"", getLabel(),
-                getFuseMountpoint(), mUserLabel);
-    } else {
-        mUserLabel = NULL;
-        snprintf(msg, sizeof(msg), "%s %s", getLabel(), getFuseMountpoint());
-    }
-
-    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeUserLabelChange,
-            msg, false);
-}
-
-void Volume::setState(int state) {
-    char msg[255];
-    int oldState = mState;
-
-    if (oldState == state) {
-        SLOGW("Duplicate state (%d)\n", state);
-        return;
-    }
-
-    if ((oldState == Volume::State_Pending) && (state != Volume::State_Idle)) {
-        mRetryMount = false;
-    }
-
-    mState = state;
-
-    SLOGD("Volume %s state changing %d (%s) -> %d (%s)", mLabel,
-         oldState, stateToStr(oldState), mState, stateToStr(mState));
-    snprintf(msg, sizeof(msg),
-             "Volume %s %s state changed from %d (%s) to %d (%s)", getLabel(),
-             getFuseMountpoint(), oldState, stateToStr(oldState), mState,
-             stateToStr(mState));
-
-    mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeStateChange,
-                                         msg, false);
-}
-
-int Volume::createDeviceNode(const char *path, int major, int minor) {
-    char *secontext = NULL;
-    mode_t mode = 0660 | S_IFBLK;
-    dev_t dev = (major << 8) | minor;
-    int rc;
-    if (sehandle) {
-        rc = selabel_lookup(sehandle, &secontext, path, S_IFBLK);
-        if (rc == 0)
-            setfscreatecon(secontext);
-    }
-    if (mknod(path, mode, dev) < 0) {
-        if (errno != EEXIST) {
-            int sverrno = errno;
-            if (secontext) {
-                freecon(secontext);
-                setfscreatecon(NULL);
-            }
-            errno = sverrno;
-            return -1;
-        }
-    }
-    if (secontext) {
-        setfscreatecon(NULL);
-        freecon(secontext);
-    }
-    return 0;
-}
-
-int Volume::formatVol(bool wipe) {
-
-    if (getState() == Volume::State_NoMedia) {
-        errno = ENODEV;
-        return -1;
-    } else if (getState() != Volume::State_Idle) {
-        errno = EBUSY;
-        return -1;
-    }
-
-    if (isMountpointMounted(getMountpoint())) {
-        SLOGW("Volume is idle but appears to be mounted - fixing");
-        setState(Volume::State_Mounted);
-        // mCurrentlyMountedKdev = XXX
-        errno = EBUSY;
-        return -1;
-    }
-
-    bool formatEntireDevice = (mPartIdx == -1);
-    char devicePath[255];
-    dev_t diskNode = getDiskDevice();
-    dev_t partNode =
-        MKDEV(MAJOR(diskNode),
-              MINOR(diskNode) + (formatEntireDevice ? 0 : mPartIdx));
-
-    setState(Volume::State_Formatting);
-
-    int ret = -1;
-    // Only initialize the MBR if we are formatting the entire device
-    if (formatEntireDevice) {
-        sprintf(devicePath, "/dev/block/vold/%d:%d",
-                major(diskNode), minor(diskNode));
-
-        if (initializeMbr(devicePath)) {
-            SLOGE("Failed to initialize MBR (%s)", strerror(errno));
-            goto err;
-        }
-    }
-
-    sprintf(devicePath, "/dev/block/vold/%d:%d",
-            major(partNode), minor(partNode));
-
-    if (mDebug) {
-        SLOGI("Formatting volume %s (%s)", getLabel(), devicePath);
-    }
-
-    if (Fat::format(devicePath, 0, wipe)) {
-        SLOGE("Failed to format (%s)", strerror(errno));
-        goto err;
-    }
-
-    ret = 0;
-
-err:
-    setState(Volume::State_Idle);
-    return ret;
-}
-
-bool Volume::isMountpointMounted(const char *path) {
-    FILE *fp = setmntent("/proc/mounts", "r");
-    if (fp == NULL) {
-        SLOGE("Error opening /proc/mounts (%s)", strerror(errno));
-        return false;
-    }
-
-    bool found_path = false;
-    mntent* mentry;
-    while ((mentry = getmntent(fp)) != NULL) {
-        if (strcmp(mentry->mnt_dir, path) == 0) {
-            found_path = true;
-            break;
-        }
-    }
-    endmntent(fp);
-    return found_path;
-}
-
-int Volume::mountVol() {
-    dev_t deviceNodes[4];
-    int n, i;
-    char errmsg[255];
-
-    int flags = getFlags();
-    bool providesAsec = (flags & VOL_PROVIDES_ASEC) != 0;
-
-    // TODO: handle "bind" style mounts, for emulated storage
-
-    char decrypt_state[PROPERTY_VALUE_MAX];
-    char crypto_state[PROPERTY_VALUE_MAX];
-    char encrypt_progress[PROPERTY_VALUE_MAX];
-
-    property_get("vold.decrypt", decrypt_state, "");
-    property_get("vold.encrypt_progress", encrypt_progress, "");
-
-    /* Don't try to mount the volumes if we have not yet entered the disk password
-     * or are in the process of encrypting.
-     */
-    if ((getState() == Volume::State_NoMedia) ||
-        ((!strcmp(decrypt_state, "1") || encrypt_progress[0]) && providesAsec)) {
-        snprintf(errmsg, sizeof(errmsg),
-                 "Volume %s %s mount failed - no media",
-                 getLabel(), getFuseMountpoint());
-        mVm->getBroadcaster()->sendBroadcast(
-                                         ResponseCode::VolumeMountFailedNoMedia,
-                                         errmsg, false);
-        errno = ENODEV;
-        return -1;
-    } else if (getState() != Volume::State_Idle) {
-        errno = EBUSY;
-        if (getState() == Volume::State_Pending) {
-            mRetryMount = true;
-        }
-        return -1;
-    }
-
-    if (isMountpointMounted(getMountpoint())) {
-        SLOGW("Volume is idle but appears to be mounted - fixing");
-        setState(Volume::State_Mounted);
-        // mCurrentlyMountedKdev = XXX
-        return 0;
-    }
-
-    n = getDeviceNodes((dev_t *) &deviceNodes, 4);
-    if (!n) {
-        SLOGE("Failed to get device nodes (%s)\n", strerror(errno));
-        return -1;
-    }
-
-    /* If we're running encrypted, and the volume is marked as encryptable and nonremovable,
-     * and also marked as providing Asec storage, then we need to decrypt
-     * that partition, and update the volume object to point to it's new decrypted
-     * block device
-     */
-    property_get("ro.crypto.state", crypto_state, "");
-    if (providesAsec &&
-        ((flags & (VOL_NONREMOVABLE | VOL_ENCRYPTABLE))==(VOL_NONREMOVABLE | VOL_ENCRYPTABLE)) &&
-        !strcmp(crypto_state, "encrypted") && !isDecrypted()) {
-       char new_sys_path[MAXPATHLEN];
-       char nodepath[256];
-       int new_major, new_minor;
-
-       if (n != 1) {
-           /* We only expect one device node returned when mounting encryptable volumes */
-           SLOGE("Too many device nodes returned when mounting %s\n", getMountpoint());
-           return -1;
-       }
-
-       if (cryptfs_setup_volume(getLabel(), MAJOR(deviceNodes[0]), MINOR(deviceNodes[0]),
-                                new_sys_path, sizeof(new_sys_path),
-                                &new_major, &new_minor)) {
-           SLOGE("Cannot setup encryption mapping for %s\n", getMountpoint());
-           return -1;
-       }
-       /* We now have the new sysfs path for the decrypted block device, and the
-        * majore and minor numbers for it.  So, create the device, update the
-        * path to the new sysfs path, and continue.
-        */
-        snprintf(nodepath,
-                 sizeof(nodepath), "/dev/block/vold/%d:%d",
-                 new_major, new_minor);
-        if (createDeviceNode(nodepath, new_major, new_minor)) {
-            SLOGE("Error making device node '%s' (%s)", nodepath,
-                                                       strerror(errno));
-        }
-
-        // Todo: Either create sys filename from nodepath, or pass in bogus path so
-        //       vold ignores state changes on this internal device.
-        updateDeviceInfo(nodepath, new_major, new_minor);
-
-        /* Get the device nodes again, because they just changed */
-        n = getDeviceNodes((dev_t *) &deviceNodes, 4);
-        if (!n) {
-            SLOGE("Failed to get device nodes (%s)\n", strerror(errno));
-            return -1;
-        }
-    }
-
-    for (i = 0; i < n; i++) {
-        char devicePath[255];
-
-        sprintf(devicePath, "/dev/block/vold/%d:%d", major(deviceNodes[i]),
-                minor(deviceNodes[i]));
-
-        SLOGI("%s being considered for volume %s\n", devicePath, getLabel());
-
-        errno = 0;
-        setState(Volume::State_Checking);
-
-        if (Fat::check(devicePath)) {
-            if (errno == ENODATA) {
-                SLOGW("%s does not contain a FAT filesystem\n", devicePath);
-                continue;
-            }
-            errno = EIO;
-            /* Badness - abort the mount */
-            SLOGE("%s failed FS checks (%s)", devicePath, strerror(errno));
-            setState(Volume::State_Idle);
-            return -1;
-        }
-
-        errno = 0;
-
-        if (Fat::doMount(devicePath, getMountpoint(), false, false, false,
-                AID_MEDIA_RW, AID_MEDIA_RW, 0007, true)) {
-            SLOGE("%s failed to mount via VFAT (%s)\n", devicePath, strerror(errno));
-            continue;
-        }
-
-        extractMetadata(devicePath);
-
-        if (providesAsec && mountAsecExternal() != 0) {
-            SLOGE("Failed to mount secure area (%s)", strerror(errno));
-            umount(getMountpoint());
-            setState(Volume::State_Idle);
-            return -1;
-        }
-
-        char service[64];
-        snprintf(service, 64, "fuse_%s", getLabel());
-        property_set("ctl.start", service);
-
-        setState(Volume::State_Mounted);
-        mCurrentlyMountedKdev = deviceNodes[i];
-        return 0;
-    }
-
-    SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());
-    setState(Volume::State_Idle);
-
-    return -1;
-}
-
-int Volume::mountAsecExternal() {
-    char legacy_path[PATH_MAX];
-    char secure_path[PATH_MAX];
-
-    snprintf(legacy_path, PATH_MAX, "%s/android_secure", getMountpoint());
-    snprintf(secure_path, PATH_MAX, "%s/.android_secure", getMountpoint());
-
-    // Recover legacy secure path
-    if (!access(legacy_path, R_OK | X_OK) && access(secure_path, R_OK | X_OK)) {
-        if (rename(legacy_path, secure_path)) {
-            SLOGE("Failed to rename legacy asec dir (%s)", strerror(errno));
-        }
-    }
-
-    if (fs_prepare_dir(secure_path, 0770, AID_MEDIA_RW, AID_MEDIA_RW) != 0) {
-        SLOGW("fs_prepare_dir failed: %s", strerror(errno));
-        return -1;
-    }
-
-    if (mount(secure_path, SEC_ASECDIR_EXT, "", MS_BIND, NULL)) {
-        SLOGE("Failed to bind mount points %s -> %s (%s)", secure_path,
-                SEC_ASECDIR_EXT, strerror(errno));
-        return -1;
-    }
-
-    return 0;
-}
-
-int Volume::doUnmount(const char *path, bool force) {
-    int retries = 10;
-
-    if (mDebug) {
-        SLOGD("Unmounting {%s}, force = %d", path, force);
-    }
-
-    while (retries--) {
-        if (!umount(path) || errno == EINVAL || errno == ENOENT) {
-            SLOGI("%s sucessfully unmounted", path);
-            return 0;
-        }
-
-        int action = 0;
-
-        if (force) {
-            if (retries == 1) {
-                action = 2; // SIGKILL
-            } else if (retries == 2) {
-                action = 1; // SIGHUP
-            }
-        }
-
-        SLOGW("Failed to unmount %s (%s, retries %d, action %d)",
-                path, strerror(errno), retries, action);
-
-        Process::killProcessesWithOpenFiles(path, action);
-        usleep(1000*1000);
-    }
-    errno = EBUSY;
-    SLOGE("Giving up on unmount %s (%s)", path, strerror(errno));
-    return -1;
-}
-
-int Volume::unmountVol(bool force, bool revert) {
-    int flags = getFlags();
-    bool providesAsec = (flags & VOL_PROVIDES_ASEC) != 0;
-
-    if (getState() != Volume::State_Mounted) {
-        SLOGE("Volume %s unmount request when not mounted", getLabel());
-        errno = EINVAL;
-        return UNMOUNT_NOT_MOUNTED_ERR;
-    }
-
-    setState(Volume::State_Unmounting);
-    usleep(1000 * 1000); // Give the framework some time to react
-
-    char service[64];
-    snprintf(service, 64, "fuse_%s", getLabel());
-    property_set("ctl.stop", service);
-    /* Give it a chance to stop.  I wish we had a synchronous way to determine this... */
-    sleep(1);
-
-    // TODO: determine failure mode if FUSE times out
-
-    if (providesAsec && doUnmount(Volume::SEC_ASECDIR_EXT, force) != 0) {
-        SLOGE("Failed to unmount secure area on %s (%s)", getMountpoint(), strerror(errno));
-        goto out_mounted;
-    }
-
-    /* Now that the fuse daemon is dead, unmount it */
-    if (doUnmount(getFuseMountpoint(), force) != 0) {
-        SLOGE("Failed to unmount %s (%s)", getFuseMountpoint(), strerror(errno));
-        goto fail_remount_secure;
-    }
-
-    /* Unmount the real sd card */
-    if (doUnmount(getMountpoint(), force) != 0) {
-        SLOGE("Failed to unmount %s (%s)", getMountpoint(), strerror(errno));
-        goto fail_remount_secure;
-    }
-
-    SLOGI("%s unmounted successfully", getMountpoint());
-
-    /* If this is an encrypted volume, and we've been asked to undo
-     * the crypto mapping, then revert the dm-crypt mapping, and revert
-     * the device info to the original values.
-     */
-    if (revert && isDecrypted()) {
-        cryptfs_revert_volume(getLabel());
-        revertDeviceInfo();
-        SLOGI("Encrypted volume %s reverted successfully", getMountpoint());
-    }
-
-    setUuid(NULL);
-    setUserLabel(NULL);
-    setState(Volume::State_Idle);
-    mCurrentlyMountedKdev = -1;
-    return 0;
-
-fail_remount_secure:
-    if (providesAsec && mountAsecExternal() != 0) {
-        SLOGE("Failed to remount secure area (%s)", strerror(errno));
-        goto out_nomedia;
-    }
-
-out_mounted:
-    setState(Volume::State_Mounted);
-    return -1;
-
-out_nomedia:
-    setState(Volume::State_NoMedia);
-    return -1;
-}
-
-int Volume::initializeMbr(const char *deviceNode) {
-    struct disk_info dinfo;
-
-    memset(&dinfo, 0, sizeof(dinfo));
-
-    if (!(dinfo.part_lst = (struct part_info *) malloc(MAX_NUM_PARTS * sizeof(struct part_info)))) {
-        SLOGE("Failed to malloc prt_lst");
-        return -1;
-    }
-
-    memset(dinfo.part_lst, 0, MAX_NUM_PARTS * sizeof(struct part_info));
-    dinfo.device = strdup(deviceNode);
-    dinfo.scheme = PART_SCHEME_MBR;
-    dinfo.sect_size = 512;
-    dinfo.skip_lba = 2048;
-    dinfo.num_lba = 0;
-    dinfo.num_parts = 1;
-
-    struct part_info *pinfo = &dinfo.part_lst[0];
-
-    pinfo->name = strdup("android_sdcard");
-    pinfo->flags |= PART_ACTIVE_FLAG;
-    pinfo->type = PC_PART_TYPE_FAT32;
-    pinfo->len_kb = -1;
-
-    int rc = apply_disk_config(&dinfo, 0);
-
-    if (rc) {
-        SLOGE("Failed to apply disk configuration (%d)", rc);
-        goto out;
-    }
-
- out:
-    free(pinfo->name);
-    free(dinfo.device);
-    free(dinfo.part_lst);
-
-    return rc;
-}
-
-/*
- * Use blkid to extract UUID and label from device, since it handles many
- * obscure edge cases around partition types and formats. Always broadcasts
- * updated metadata values.
- */
-int Volume::extractMetadata(const char* devicePath) {
-    int res = 0;
-
-    std::string cmd;
-    cmd = BLKID_PATH;
-    cmd += " -c /dev/null ";
-    cmd += devicePath;
-
-    FILE* fp = popen(cmd.c_str(), "r");
-    if (!fp) {
-        ALOGE("Failed to run %s: %s", cmd.c_str(), strerror(errno));
-        res = -1;
-        goto done;
-    }
-
-    char line[1024];
-    char value[128];
-    if (fgets(line, sizeof(line), fp) != NULL) {
-        ALOGD("blkid identified as %s", line);
-
-        char* start = strstr(line, "UUID=");
-        if (start != NULL && sscanf(start + 5, "\"%127[^\"]\"", value) == 1) {
-            setUuid(value);
-        } else {
-            setUuid(NULL);
-        }
-
-        start = strstr(line, "LABEL=");
-        if (start != NULL && sscanf(start + 6, "\"%127[^\"]\"", value) == 1) {
-            setUserLabel(value);
-        } else {
-            setUserLabel(NULL);
-        }
-    } else {
-        ALOGW("blkid failed to identify %s", devicePath);
-        res = -1;
-    }
-
-    pclose(fp);
-
-done:
-    if (res == -1) {
-        setUuid(NULL);
-        setUserLabel(NULL);
-    }
-    return res;
-}
diff --git a/Volume.h b/Volume.h
deleted file mode 100644
index 1444ed3..0000000
--- a/Volume.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _VOLUME_H
-#define _VOLUME_H
-
-#include <utils/List.h>
-#include <fs_mgr.h>
-
-class NetlinkEvent;
-class VolumeManager;
-
-class Volume {
-private:
-    int mState;
-    int mFlags;
-
-public:
-    static const int State_Init       = -1;
-    static const int State_NoMedia    = 0;
-    static const int State_Idle       = 1;
-    static const int State_Pending    = 2;
-    static const int State_Checking   = 3;
-    static const int State_Mounted    = 4;
-    static const int State_Unmounting = 5;
-    static const int State_Formatting = 6;
-    static const int State_Shared     = 7;
-    static const int State_SharedMnt  = 8;
-
-    static const char *MEDIA_DIR;
-    static const char *FUSE_DIR;
-    static const char *SEC_ASECDIR_EXT;
-    static const char *SEC_ASECDIR_INT;
-    static const char *ASECDIR;
-    static const char *LOOPDIR;
-    static const char *BLKID_PATH;
-
-protected:
-    char* mLabel;
-    char* mUuid;
-    char* mUserLabel;
-    VolumeManager *mVm;
-    bool mDebug;
-    int mPartIdx;
-    int mOrigPartIdx;
-    bool mRetryMount;
-
-    /*
-     * The major/minor tuple of the currently mounted filesystem.
-     */
-    dev_t mCurrentlyMountedKdev;
-
-public:
-    Volume(VolumeManager *vm, const fstab_rec* rec, int flags);
-    virtual ~Volume();
-
-    int mountVol();
-    int unmountVol(bool force, bool revert);
-    int formatVol(bool wipe);
-
-    const char* getLabel() { return mLabel; }
-    const char* getUuid() { return mUuid; }
-    const char* getUserLabel() { return mUserLabel; }
-    int getState() { return mState; }
-    int getFlags() { return mFlags; };
-
-    /* Mountpoint of the raw volume */
-    virtual const char *getMountpoint() = 0;
-    virtual const char *getFuseMountpoint() = 0;
-
-    virtual int handleBlockEvent(NetlinkEvent *evt);
-    virtual dev_t getDiskDevice();
-    virtual dev_t getShareDevice();
-    virtual void handleVolumeShared();
-    virtual void handleVolumeUnshared();
-
-    void setDebug(bool enable);
-    virtual int getVolInfo(struct volume_info *v) = 0;
-
-protected:
-    void setUuid(const char* uuid);
-    void setUserLabel(const char* userLabel);
-    void setState(int state);
-
-    virtual int getDeviceNodes(dev_t *devs, int max) = 0;
-    virtual int updateDeviceInfo(char *new_path, int new_major, int new_minor) = 0;
-    virtual void revertDeviceInfo(void) = 0;
-    virtual int isDecrypted(void) = 0;
-
-    int createDeviceNode(const char *path, int major, int minor);
-
-private:
-    int initializeMbr(const char *deviceNode);
-    bool isMountpointMounted(const char *path);
-    int mountAsecExternal();
-    int doUnmount(const char *path, bool force);
-    int extractMetadata(const char* devicePath);
-};
-
-typedef android::List<Volume *> VolumeCollection;
-
-#endif
diff --git a/VolumeBase.cpp b/VolumeBase.cpp
new file mode 100644
index 0000000..4dcdb0e
--- /dev/null
+++ b/VolumeBase.cpp
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Utils.h"
+#include "VolumeBase.h"
+#include "VolumeManager.h"
+#include "ResponseCode.h"
+
+#include <base/stringprintf.h>
+#include <base/logging.h>
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+using android::base::StringPrintf;
+
+#define DEBUG 1
+
+namespace android {
+namespace vold {
+
+VolumeBase::VolumeBase(Type type) :
+        mType(type), mMountFlags(0), mMountUserId(-1), mCreated(false), mState(
+                State::kUnmounted), mSilent(false) {
+}
+
+VolumeBase::~VolumeBase() {
+    CHECK(!mCreated);
+}
+
+void VolumeBase::setState(State state) {
+    mState = state;
+    notifyEvent(ResponseCode::VolumeStateChanged, StringPrintf("%d", mState));
+}
+
+status_t VolumeBase::setDiskId(const std::string& diskId) {
+    if (mCreated) {
+        LOG(WARNING) << getId() << " diskId change requires destroyed";
+        return -EBUSY;
+    }
+
+    mDiskId = diskId;
+    return OK;
+}
+
+status_t VolumeBase::setPartGuid(const std::string& partGuid) {
+    if (mCreated) {
+        LOG(WARNING) << getId() << " partGuid change requires destroyed";
+        return -EBUSY;
+    }
+
+    mPartGuid = partGuid;
+    return OK;
+}
+
+status_t VolumeBase::setMountFlags(int mountFlags) {
+    if ((mState != State::kUnmounted) && (mState != State::kUnmountable)) {
+        LOG(WARNING) << getId() << " flags change requires state unmounted or unmountable";
+        return -EBUSY;
+    }
+
+    mMountFlags = mountFlags;
+    return OK;
+}
+
+status_t VolumeBase::setMountUserId(userid_t mountUserId) {
+    if ((mState != State::kUnmounted) && (mState != State::kUnmountable)) {
+        LOG(WARNING) << getId() << " user change requires state unmounted or unmountable";
+        return -EBUSY;
+    }
+
+    mMountUserId = mountUserId;
+    return OK;
+}
+
+status_t VolumeBase::setSilent(bool silent) {
+    if (mCreated) {
+        LOG(WARNING) << getId() << " silence change requires destroyed";
+        return -EBUSY;
+    }
+
+    mSilent = silent;
+    return OK;
+}
+
+status_t VolumeBase::setId(const std::string& id) {
+    if (mCreated) {
+        LOG(WARNING) << getId() << " id change requires not created";
+        return -EBUSY;
+    }
+
+    mId = id;
+    return OK;
+}
+
+status_t VolumeBase::setPath(const std::string& path) {
+    if (mState != State::kChecking) {
+        LOG(WARNING) << getId() << " path change requires state checking";
+        return -EBUSY;
+    }
+
+    mPath = path;
+    notifyEvent(ResponseCode::VolumePathChanged, mPath);
+    return OK;
+}
+
+status_t VolumeBase::setInternalPath(const std::string& internalPath) {
+    if (mState != State::kChecking) {
+        LOG(WARNING) << getId() << " internal path change requires state checking";
+        return -EBUSY;
+    }
+
+    mInternalPath = internalPath;
+    notifyEvent(ResponseCode::VolumeInternalPathChanged, mInternalPath);
+    return OK;
+}
+
+void VolumeBase::notifyEvent(int event) {
+    if (mSilent) return;
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
+            getId().c_str(), false);
+}
+
+void VolumeBase::notifyEvent(int event, const std::string& value) {
+    if (mSilent) return;
+    VolumeManager::Instance()->getBroadcaster()->sendBroadcast(event,
+            StringPrintf("%s %s", getId().c_str(), value.c_str()).c_str(), false);
+}
+
+void VolumeBase::addVolume(const std::shared_ptr<VolumeBase>& volume) {
+    mVolumes.push_back(volume);
+}
+
+void VolumeBase::removeVolume(const std::shared_ptr<VolumeBase>& volume) {
+    mVolumes.remove(volume);
+}
+
+std::shared_ptr<VolumeBase> VolumeBase::findVolume(const std::string& id) {
+    for (auto vol : mVolumes) {
+        if (vol->getId() == id) {
+            return vol;
+        }
+    }
+    return nullptr;
+}
+
+status_t VolumeBase::create() {
+    CHECK(!mCreated);
+
+    mCreated = true;
+    status_t res = doCreate();
+    notifyEvent(ResponseCode::VolumeCreated,
+            StringPrintf("%d \"%s\" \"%s\"", mType, mDiskId.c_str(), mPartGuid.c_str()));
+    setState(State::kUnmounted);
+    return res;
+}
+
+status_t VolumeBase::doCreate() {
+    return OK;
+}
+
+status_t VolumeBase::destroy() {
+    CHECK(mCreated);
+
+    if (mState == State::kMounted) {
+        unmount();
+        setState(State::kBadRemoval);
+    } else {
+        setState(State::kRemoved);
+    }
+
+    notifyEvent(ResponseCode::VolumeDestroyed);
+    status_t res = doDestroy();
+    mCreated = false;
+    return res;
+}
+
+status_t VolumeBase::doDestroy() {
+    return OK;
+}
+
+status_t VolumeBase::mount() {
+    if ((mState != State::kUnmounted) && (mState != State::kUnmountable)) {
+        LOG(WARNING) << getId() << " mount requires state unmounted or unmountable";
+        return -EBUSY;
+    }
+
+    setState(State::kChecking);
+    status_t res = doMount();
+    if (res == OK) {
+        setState(State::kMounted);
+    } else {
+        setState(State::kUnmountable);
+    }
+
+    return res;
+}
+
+status_t VolumeBase::unmount() {
+    if (mState != State::kMounted) {
+        LOG(WARNING) << getId() << " unmount requires state mounted";
+        return -EBUSY;
+    }
+
+    setState(State::kEjecting);
+    for (auto vol : mVolumes) {
+        if (vol->destroy()) {
+            LOG(WARNING) << getId() << " failed to destroy " << vol->getId()
+                    << " stacked above";
+        }
+    }
+    mVolumes.clear();
+
+    status_t res = doUnmount();
+    setState(State::kUnmounted);
+    return res;
+}
+
+status_t VolumeBase::format(const std::string& fsType) {
+    if (mState == State::kMounted) {
+        unmount();
+    }
+
+    if ((mState != State::kUnmounted) && (mState != State::kUnmountable)) {
+        LOG(WARNING) << getId() << " format requires state unmounted or unmountable";
+        return -EBUSY;
+    }
+
+    setState(State::kFormatting);
+    status_t res = doFormat(fsType);
+    setState(State::kUnmounted);
+    return res;
+}
+
+status_t VolumeBase::doFormat(const std::string& fsType) {
+    return -ENOTSUP;
+}
+
+}  // namespace vold
+}  // namespace android
diff --git a/VolumeBase.h b/VolumeBase.h
new file mode 100644
index 0000000..d417019
--- /dev/null
+++ b/VolumeBase.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_VOLUME_BASE_H
+#define ANDROID_VOLD_VOLUME_BASE_H
+
+#include "Utils.h"
+
+#include <cutils/multiuser.h>
+#include <utils/Errors.h>
+
+#include <sys/types.h>
+#include <list>
+#include <string>
+
+namespace android {
+namespace vold {
+
+/*
+ * Representation of a mounted volume ready for presentation.
+ *
+ * Various subclasses handle the different mounting prerequisites, such as
+ * encryption details, etc.  Volumes can also be "stacked" above other
+ * volumes to help communicate dependencies.  For example, an ASEC volume
+ * can be stacked on a vfat volume.
+ *
+ * Mounted volumes can be asked to manage bind mounts to present themselves
+ * to specific users on the device.
+ *
+ * When an unmount is requested, the volume recursively unmounts any stacked
+ * volumes and removes any bind mounts before finally unmounting itself.
+ */
+class VolumeBase {
+public:
+    virtual ~VolumeBase();
+
+    enum class Type {
+        kPublic = 0,
+        kPrivate,
+        kEmulated,
+        kAsec,
+        kObb,
+    };
+
+    enum MountFlags {
+        /* Flag that volume is primary external storage */
+        kPrimary = 1 << 0,
+        /* Flag that volume is visible to normal apps */
+        kVisible = 1 << 1,
+    };
+
+    enum class State {
+        kUnmounted = 0,
+        kChecking,
+        kMounted,
+        kMountedReadOnly,
+        kFormatting,
+        kEjecting,
+        kUnmountable,
+        kRemoved,
+        kBadRemoval,
+    };
+
+    const std::string& getId() { return mId; }
+    const std::string& getDiskId() { return mDiskId; }
+    const std::string& getPartGuid() { return mPartGuid; }
+    Type getType() { return mType; }
+    int getMountFlags() { return mMountFlags; }
+    userid_t getMountUserId() { return mMountUserId; }
+    State getState() { return mState; }
+    const std::string& getPath() { return mPath; }
+    const std::string& getInternalPath() { return mInternalPath; }
+
+    status_t setDiskId(const std::string& diskId);
+    status_t setPartGuid(const std::string& partGuid);
+    status_t setMountFlags(int mountFlags);
+    status_t setMountUserId(userid_t mountUserId);
+    status_t setSilent(bool silent);
+
+    void addVolume(const std::shared_ptr<VolumeBase>& volume);
+    void removeVolume(const std::shared_ptr<VolumeBase>& volume);
+
+    std::shared_ptr<VolumeBase> findVolume(const std::string& id);
+
+    status_t create();
+    status_t destroy();
+    status_t mount();
+    status_t unmount();
+    status_t format(const std::string& fsType);
+
+protected:
+    explicit VolumeBase(Type type);
+
+    virtual status_t doCreate();
+    virtual status_t doDestroy();
+    virtual status_t doMount() = 0;
+    virtual status_t doUnmount() = 0;
+    virtual status_t doFormat(const std::string& fsType);
+
+    status_t setId(const std::string& id);
+    status_t setPath(const std::string& path);
+    status_t setInternalPath(const std::string& internalPath);
+
+    void notifyEvent(int msg);
+    void notifyEvent(int msg, const std::string& value);
+
+private:
+    /* ID that uniquely references volume while alive */
+    std::string mId;
+    /* ID that uniquely references parent disk while alive */
+    std::string mDiskId;
+    /* Partition GUID of this volume */
+    std::string mPartGuid;
+    /* Volume type */
+    Type mType;
+    /* Flags used when mounting this volume */
+    int mMountFlags;
+    /* User that owns this volume, otherwise -1 */
+    userid_t mMountUserId;
+    /* Flag indicating object is created */
+    bool mCreated;
+    /* Current state of volume */
+    State mState;
+    /* Path to mounted volume */
+    std::string mPath;
+    /* Path to internal backing storage */
+    std::string mInternalPath;
+    /* Flag indicating that volume should emit no events */
+    bool mSilent;
+
+    /* Volumes stacked on top of this volume */
+    std::list<std::shared_ptr<VolumeBase>> mVolumes;
+
+    void setState(State state);
+
+    DISALLOW_COPY_AND_ASSIGN(VolumeBase);
+};
+
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index da4deb6..ce355df 100755
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -26,6 +26,7 @@
 #include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 #include <linux/kdev_t.h>
@@ -34,6 +35,8 @@
 
 #include <openssl/md5.h>
 
+#include <base/logging.h>
+#include <base/stringprintf.h>
 #include <cutils/fs.h>
 #include <cutils/log.h>
 
@@ -43,12 +46,15 @@
 
 #include <private/android_filesystem_config.h>
 
+#include "Benchmark.h"
+#include "EmulatedVolume.h"
 #include "VolumeManager.h"
-#include "DirectVolume.h"
+#include "NetlinkManager.h"
 #include "ResponseCode.h"
 #include "Loop.h"
-#include "Ext4.h"
-#include "Fat.h"
+#include "fs/Ext4.h"
+#include "fs/Vfat.h"
+#include "Utils.h"
 #include "Devmapper.h"
 #include "Process.h"
 #include "Asec.h"
@@ -60,9 +66,35 @@
 #define ROUND_UP_POWER_OF_2(number, po2) (((!!(number & ((1U << po2) - 1))) << po2)\
                                          + (number & (~((1U << po2) - 1))))
 
+using android::base::StringPrintf;
+
+/*
+ * Path to external storage where *only* root can access ASEC image files
+ */
+const char *VolumeManager::SEC_ASECDIR_EXT   = "/mnt/secure/asec";
+
+/*
+ * Path to internal storage where *only* root can access ASEC image files
+ */
+const char *VolumeManager::SEC_ASECDIR_INT   = "/data/app-asec";
+
+/*
+ * Path to where secure containers are mounted
+ */
+const char *VolumeManager::ASECDIR           = "/mnt/asec";
+
+/*
+ * Path to where OBBs are mounted
+ */
+const char *VolumeManager::LOOPDIR           = "/mnt/obb";
+
+static const char* kUserMountPath = "/mnt/user";
+
+static const unsigned int kMajorBlockMmc = 179;
+
 /* writes superblock at end of file or device given by name */
 static int writeSuperBlock(const char* name, struct asec_superblock *sb, unsigned int numImgSectors) {
-    int sbfd = open(name, O_RDWR);
+    int sbfd = open(name, O_RDWR | O_CLOEXEC);
     if (sbfd < 0) {
         SLOGE("Failed to open %s for superblock write (%s)", name, strerror(errno));
         return -1;
@@ -171,18 +203,15 @@
 
 VolumeManager::VolumeManager() {
     mDebug = false;
-    mVolumes = new VolumeCollection();
     mActiveContainers = new AsecIdCollection();
     mBroadcaster = NULL;
     mUmsSharingCount = 0;
     mSavedDirtyRatio = -1;
     // set dirty ratio to 0 when UMS is active
     mUmsDirtyRatio = 0;
-    mVolManagerDisabled = 0;
 }
 
 VolumeManager::~VolumeManager() {
-    delete mVolumes;
     delete mActiveContainers;
 }
 
@@ -218,96 +247,443 @@
     return buffer;
 }
 
-void VolumeManager::setDebug(bool enable) {
+int VolumeManager::setDebug(bool enable) {
     mDebug = enable;
-    VolumeCollection::iterator it;
-    for (it = mVolumes->begin(); it != mVolumes->end(); ++it) {
-        (*it)->setDebug(enable);
-    }
+    return 0;
 }
 
 int VolumeManager::start() {
+    // Always start from a clean slate by unmounting everything in
+    // directories that we own, in case we crashed.
+    unmountAll();
+
+    // Assume that we always have an emulated volume on internal
+    // storage; the framework will decide if it should be mounted.
+    CHECK(mInternalEmulated == nullptr);
+    mInternalEmulated = std::shared_ptr<android::vold::VolumeBase>(
+            new android::vold::EmulatedVolume("/data/media"));
+    mInternalEmulated->create();
+
     return 0;
 }
 
 int VolumeManager::stop() {
-    return 0;
-}
-
-int VolumeManager::addVolume(Volume *v) {
-    mVolumes->push_back(v);
+    CHECK(mInternalEmulated != nullptr);
+    mInternalEmulated->destroy();
+    mInternalEmulated = nullptr;
     return 0;
 }
 
 void VolumeManager::handleBlockEvent(NetlinkEvent *evt) {
-#ifdef NETLINK_DEBUG
-    const char *devpath = evt->findParam("DEVPATH");
-#endif
+    std::lock_guard<std::mutex> lock(mLock);
 
-    /* Lookup a volume to handle this device */
-    VolumeCollection::iterator it;
-    bool hit = false;
-    for (it = mVolumes->begin(); it != mVolumes->end(); ++it) {
-        if (!(*it)->handleBlockEvent(evt)) {
-#ifdef NETLINK_DEBUG
-            SLOGD("Device '%s' event handled by volume %s\n", devpath, (*it)->getLabel());
-#endif
-            hit = true;
-            break;
-        }
+    if (mDebug) {
+        LOG(VERBOSE) << "----------------";
+        LOG(VERBOSE) << "handleBlockEvent with action " << (int) evt->getAction();
+        evt->dump();
     }
 
-    if (!hit) {
-#ifdef NETLINK_DEBUG
-        SLOGW("No volumes handled block event for '%s'", devpath);
-#endif
+    std::string eventPath(evt->findParam("DEVPATH"));
+    std::string devType(evt->findParam("DEVTYPE"));
+
+    if (devType != "disk") return;
+
+    int major = atoi(evt->findParam("MAJOR"));
+    int minor = atoi(evt->findParam("MINOR"));
+    dev_t device = makedev(major, minor);
+
+    switch (evt->getAction()) {
+    case NetlinkEvent::Action::kAdd: {
+        for (auto source : mDiskSources) {
+            if (source->matches(eventPath)) {
+                // For now, assume that MMC devices are SD, and that
+                // everything else is USB
+                int flags = source->getFlags();
+                if (major == kMajorBlockMmc) {
+                    flags |= android::vold::Disk::Flags::kSd;
+                } else {
+                    flags |= android::vold::Disk::Flags::kUsb;
+                }
+
+                auto disk = new android::vold::Disk(eventPath, device,
+                        source->getNickname(), flags);
+                disk->create();
+                mDisks.push_back(std::shared_ptr<android::vold::Disk>(disk));
+                break;
+            }
+        }
+        break;
+    }
+    case NetlinkEvent::Action::kChange: {
+        LOG(DEBUG) << "Disk at " << major << ":" << minor << " changed";
+        for (auto disk : mDisks) {
+            if (disk->getDevice() == device) {
+                disk->readMetadata();
+                disk->readPartitions();
+            }
+        }
+        break;
+    }
+    case NetlinkEvent::Action::kRemove: {
+        auto i = mDisks.begin();
+        while (i != mDisks.end()) {
+            if ((*i)->getDevice() == device) {
+                (*i)->destroy();
+                i = mDisks.erase(i);
+            } else {
+                ++i;
+            }
+        }
+        break;
+    }
+    default: {
+        LOG(WARNING) << "Unexpected block event action " << (int) evt->getAction();
+        break;
+    }
     }
 }
 
-int VolumeManager::listVolumes(SocketClient *cli, bool broadcast) {
-    VolumeCollection::iterator i;
-    char msg[256];
+void VolumeManager::addDiskSource(const std::shared_ptr<DiskSource>& diskSource) {
+    mDiskSources.push_back(diskSource);
+}
 
-    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
-        char *buffer;
-        asprintf(&buffer, "%s %s %d",
-                 (*i)->getLabel(), (*i)->getFuseMountpoint(),
-                 (*i)->getState());
-        cli->sendMsg(ResponseCode::VolumeListResult, buffer, false);
-        free(buffer);
-        if (broadcast) {
-            if((*i)->getUuid()) {
-                snprintf(msg, sizeof(msg), "%s %s \"%s\"", (*i)->getLabel(),
-                    (*i)->getFuseMountpoint(), (*i)->getUuid());
-                mBroadcaster->sendBroadcast(ResponseCode::VolumeUuidChange,
-                    msg, false);
-            }
-            if((*i)->getUserLabel()) {
-                snprintf(msg, sizeof(msg), "%s %s \"%s\"", (*i)->getLabel(),
-                    (*i)->getFuseMountpoint(), (*i)->getUserLabel());
-                mBroadcaster->sendBroadcast(ResponseCode::VolumeUserLabelChange,
-                    msg, false);
-            }
+std::shared_ptr<android::vold::Disk> VolumeManager::findDisk(const std::string& id) {
+    for (auto disk : mDisks) {
+        if (disk->getId() == id) {
+            return disk;
         }
     }
-    cli->sendMsg(ResponseCode::CommandOkay, "Volumes listed.", false);
+    return nullptr;
+}
+
+std::shared_ptr<android::vold::VolumeBase> VolumeManager::findVolume(const std::string& id) {
+    if (mInternalEmulated->getId() == id) {
+        return mInternalEmulated;
+    }
+    for (auto disk : mDisks) {
+        auto vol = disk->findVolume(id);
+        if (vol != nullptr) {
+            return vol;
+        }
+    }
+    return nullptr;
+}
+
+void VolumeManager::listVolumes(android::vold::VolumeBase::Type type,
+        std::list<std::string>& list) {
+    list.clear();
+    for (auto disk : mDisks) {
+        disk->listVolumes(type, list);
+    }
+}
+
+nsecs_t VolumeManager::benchmarkPrivate(const std::string& id) {
+    std::string path;
+    if (id == "private" || id == "null") {
+        path = "/data";
+    } else {
+        auto vol = findVolume(id);
+        if (vol != nullptr && vol->getState() == android::vold::VolumeBase::State::kMounted) {
+            path = vol->getPath();
+        }
+    }
+
+    if (path.empty()) {
+        LOG(WARNING) << "Failed to find volume for " << id;
+        return -1;
+    }
+
+    return android::vold::BenchmarkPrivate(path);
+}
+
+int VolumeManager::forgetPartition(const std::string& partGuid) {
+    std::string normalizedGuid;
+    if (android::vold::NormalizeHex(partGuid, normalizedGuid)) {
+        LOG(WARNING) << "Invalid GUID " << partGuid;
+        return -1;
+    }
+
+    std::string keyPath = android::vold::BuildKeyPath(normalizedGuid);
+    if (unlink(keyPath.c_str()) != 0) {
+        LOG(ERROR) << "Failed to unlink " << keyPath;
+        return -1;
+    }
+
     return 0;
 }
 
-int VolumeManager::formatVolume(const char *label, bool wipe) {
-    Volume *v = lookupVolume(label);
+int VolumeManager::linkPrimary(userid_t userId) {
+    std::string source(mPrimary->getPath());
+    if (mPrimary->getType() == android::vold::VolumeBase::Type::kEmulated) {
+        source = StringPrintf("%s/%d", source.c_str(), userId);
+        fs_prepare_dir(source.c_str(), 0755, AID_ROOT, AID_ROOT);
+    }
 
-    if (!v) {
-        errno = ENOENT;
+    std::string target(StringPrintf("/mnt/user/%d/primary", userId));
+    if (TEMP_FAILURE_RETRY(unlink(target.c_str()))) {
+        if (errno != ENOENT) {
+            SLOGW("Failed to unlink %s: %s", target.c_str(), strerror(errno));
+        }
+    }
+    LOG(DEBUG) << "Linking " << source << " to " << target;
+    if (TEMP_FAILURE_RETRY(symlink(source.c_str(), target.c_str()))) {
+        SLOGW("Failed to link %s to %s: %s", source.c_str(), target.c_str(),
+                strerror(errno));
+        return -errno;
+    }
+    return 0;
+}
+
+int VolumeManager::onUserAdded(userid_t userId, int userSerialNumber) {
+    mAddedUsers[userId] = userSerialNumber;
+    return 0;
+}
+
+int VolumeManager::onUserRemoved(userid_t userId) {
+    mAddedUsers.erase(userId);
+    return 0;
+}
+
+int VolumeManager::onUserStarted(userid_t userId) {
+    // Note that sometimes the system will spin up processes from Zygote
+    // before actually starting the user, so we're okay if Zygote
+    // already created this directory.
+    std::string path(StringPrintf("%s/%d", kUserMountPath, userId));
+    fs_prepare_dir(path.c_str(), 0755, AID_ROOT, AID_ROOT);
+
+    mStartedUsers.insert(userId);
+    if (mPrimary) {
+        linkPrimary(userId);
+    }
+    return 0;
+}
+
+int VolumeManager::onUserStopped(userid_t userId) {
+    mStartedUsers.erase(userId);
+    return 0;
+}
+
+int VolumeManager::setPrimary(const std::shared_ptr<android::vold::VolumeBase>& vol) {
+    mPrimary = vol;
+    for (userid_t userId : mStartedUsers) {
+        linkPrimary(userId);
+    }
+    return 0;
+}
+
+static int sane_readlinkat(int dirfd, const char* path, char* buf, size_t bufsiz) {
+    ssize_t len = readlinkat(dirfd, path, buf, bufsiz);
+    if (len < 0) {
+        return -1;
+    } else if (len == (ssize_t) bufsiz) {
+        return -1;
+    } else {
+        buf[len] = '\0';
+        return 0;
+    }
+}
+
+static int unmount_tree(const char* path) {
+    size_t path_len = strlen(path);
+
+    FILE* fp = setmntent("/proc/mounts", "r");
+    if (fp == NULL) {
+        ALOGE("Error opening /proc/mounts: %s", strerror(errno));
+        return -errno;
+    }
+
+    // Some volumes can be stacked on each other, so force unmount in
+    // reverse order to give us the best chance of success.
+    std::list<std::string> toUnmount;
+    mntent* mentry;
+    while ((mentry = getmntent(fp)) != NULL) {
+        if (strncmp(mentry->mnt_dir, path, path_len) == 0) {
+            toUnmount.push_front(std::string(mentry->mnt_dir));
+        }
+    }
+    endmntent(fp);
+
+    for (auto path : toUnmount) {
+        if (umount2(path.c_str(), MNT_DETACH)) {
+            ALOGW("Failed to unmount %s: %s", path.c_str(), strerror(errno));
+        }
+    }
+    return 0;
+}
+
+int VolumeManager::remountUid(uid_t uid, const std::string& mode) {
+    LOG(DEBUG) << "Remounting " << uid << " as mode " << mode;
+
+    DIR* dir;
+    struct dirent* de;
+    char rootName[PATH_MAX];
+    char pidName[PATH_MAX];
+    int pidFd;
+    int nsFd;
+    struct stat sb;
+    pid_t child;
+
+    if (!(dir = opendir("/proc"))) {
+        PLOG(ERROR) << "Failed to opendir";
         return -1;
     }
 
-    if (mVolManagerDisabled) {
-        errno = EBUSY;
+    // Figure out root namespace to compare against below
+    if (sane_readlinkat(dirfd(dir), "1/ns/mnt", rootName, PATH_MAX) == -1) {
+        PLOG(ERROR) << "Failed to readlink";
+        closedir(dir);
         return -1;
     }
 
-    return v->formatVol(wipe);
+    // Poke through all running PIDs look for apps running as UID
+    while ((de = readdir(dir))) {
+        pidFd = -1;
+        nsFd = -1;
+
+        pidFd = openat(dirfd(dir), de->d_name, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
+        if (pidFd < 0) {
+            goto next;
+        }
+        if (fstat(pidFd, &sb) != 0) {
+            PLOG(WARNING) << "Failed to stat " << de->d_name;
+            goto next;
+        }
+        if (sb.st_uid != uid) {
+            goto next;
+        }
+
+        // Matches so far, but refuse to touch if in root namespace
+        LOG(DEBUG) << "Found matching PID " << de->d_name;
+        if (sane_readlinkat(pidFd, "ns/mnt", pidName, PATH_MAX) == -1) {
+            PLOG(WARNING) << "Failed to read namespace for " << de->d_name;
+            goto next;
+        }
+        if (!strcmp(rootName, pidName)) {
+            LOG(WARNING) << "Skipping due to root namespace";
+            goto next;
+        }
+
+        // We purposefully leave the namespace open across the fork
+        nsFd = openat(pidFd, "ns/mnt", O_RDONLY);
+        if (nsFd < 0) {
+            PLOG(WARNING) << "Failed to open namespace for " << de->d_name;
+            goto next;
+        }
+
+        if (!(child = fork())) {
+            if (setns(nsFd, CLONE_NEWNS) != 0) {
+                PLOG(ERROR) << "Failed to setns for " << de->d_name;
+                _exit(1);
+            }
+
+            unmount_tree("/storage");
+
+            std::string storageSource;
+            if (mode == "default") {
+                storageSource = "/mnt/runtime/default";
+            } else if (mode == "read") {
+                storageSource = "/mnt/runtime/read";
+            } else if (mode == "write") {
+                storageSource = "/mnt/runtime/write";
+            } else {
+                // Sane default of no storage visible
+                _exit(0);
+            }
+            if (TEMP_FAILURE_RETRY(mount(storageSource.c_str(), "/storage",
+                    NULL, MS_BIND | MS_REC | MS_SLAVE, NULL)) == -1) {
+                PLOG(ERROR) << "Failed to mount " << storageSource << " for "
+                        << de->d_name;
+                _exit(1);
+            }
+
+            // Mount user-specific symlink helper into place
+            userid_t user_id = multiuser_get_user_id(uid);
+            std::string userSource(StringPrintf("/mnt/user/%d", user_id));
+            if (TEMP_FAILURE_RETRY(mount(userSource.c_str(), "/storage/self",
+                    NULL, MS_BIND, NULL)) == -1) {
+                PLOG(ERROR) << "Failed to mount " << userSource << " for "
+                        << de->d_name;
+                _exit(1);
+            }
+
+            _exit(0);
+        }
+
+        if (child == -1) {
+            PLOG(ERROR) << "Failed to fork";
+            goto next;
+        } else {
+            TEMP_FAILURE_RETRY(waitpid(child, nullptr, 0));
+        }
+
+next:
+        close(nsFd);
+        close(pidFd);
+    }
+    closedir(dir);
+    return 0;
+}
+
+int VolumeManager::reset() {
+    // Tear down all existing disks/volumes and start from a blank slate so
+    // newly connected framework hears all events.
+    mInternalEmulated->destroy();
+    mInternalEmulated->create();
+    for (auto disk : mDisks) {
+        disk->destroy();
+        disk->create();
+    }
+    mAddedUsers.clear();
+    mStartedUsers.clear();
+    return 0;
+}
+
+int VolumeManager::shutdown() {
+    mInternalEmulated->destroy();
+    for (auto disk : mDisks) {
+        disk->destroy();
+    }
+    mDisks.clear();
+    return 0;
+}
+
+int VolumeManager::unmountAll() {
+    std::lock_guard<std::mutex> lock(mLock);
+
+    // First, try gracefully unmounting all known devices
+    if (mInternalEmulated != nullptr) {
+        mInternalEmulated->unmount();
+    }
+    for (auto disk : mDisks) {
+        disk->unmountAll();
+    }
+
+    // Worst case we might have some stale mounts lurking around, so
+    // force unmount those just to be safe.
+    FILE* fp = setmntent("/proc/mounts", "r");
+    if (fp == NULL) {
+        SLOGE("Error opening /proc/mounts: %s", strerror(errno));
+        return -errno;
+    }
+
+    // Some volumes can be stacked on each other, so force unmount in
+    // reverse order to give us the best chance of success.
+    std::list<std::string> toUnmount;
+    mntent* mentry;
+    while ((mentry = getmntent(fp)) != NULL) {
+        if (strncmp(mentry->mnt_dir, "/mnt/", 5) == 0
+                || strncmp(mentry->mnt_dir, "/storage/", 9) == 0) {
+            toUnmount.push_front(std::string(mentry->mnt_dir));
+        }
+    }
+    endmntent(fp);
+
+    for (auto path : toUnmount) {
+        SLOGW("Tearing down stale mount %s", path.c_str());
+        android::vold::ForceUnmount(path);
+    }
+
+    return 0;
 }
 
 int VolumeManager::getObbMountPath(const char *sourceFile, char *mountPath, int mountPathLen) {
@@ -318,7 +694,7 @@
     }
 
     memset(mountPath, 0, mountPathLen);
-    int written = snprintf(mountPath, mountPathLen, "%s/%s", Volume::LOOPDIR, idHash);
+    int written = snprintf(mountPath, mountPathLen, "%s/%s", VolumeManager::LOOPDIR, idHash);
     if ((written < 0) || (written >= mountPathLen)) {
         errno = EINVAL;
         return -1;
@@ -352,7 +728,7 @@
         return -1;
     }
 
-    int written = snprintf(buffer, maxlen, "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(buffer, maxlen, "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (written >= maxlen)) {
         SLOGE("getAsecMountPath failed for %s: couldn't construct path in buffer", id);
         errno = EINVAL;
@@ -424,12 +800,6 @@
         return -1;
     }
 
-    if (lookupVolume(id)) {
-        SLOGE("ASEC id '%s' currently exists", id);
-        errno = EADDRINUSE;
-        return -1;
-    }
-
     char asecFileName[255];
 
     if (!findAsec(id, asecFileName, sizeof(asecFileName))) {
@@ -439,7 +809,7 @@
         return -1;
     }
 
-    const char *asecDir = isExternal ? Volume::SEC_ASECDIR_EXT : Volume::SEC_ASECDIR_INT;
+    const char *asecDir = isExternal ? VolumeManager::SEC_ASECDIR_EXT : VolumeManager::SEC_ASECDIR_INT;
 
     int written = snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", asecDir, id);
     if ((written < 0) || (size_t(written) >= sizeof(asecFileName))) {
@@ -515,7 +885,7 @@
         int formatStatus;
         char mountPoint[255];
 
-        int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+        int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
         if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
             SLOGE("ASEC fs format failed: couldn't construct mountPoint");
             if (cleanupDm) {
@@ -527,9 +897,9 @@
         }
 
         if (usingExt4) {
-            formatStatus = Ext4::format(dmDevice, numImgSectors, mountPoint);
+            formatStatus = android::vold::ext4::Format(dmDevice, numImgSectors, mountPoint);
         } else {
-            formatStatus = Fat::format(dmDevice, numImgSectors, 0);
+            formatStatus = android::vold::vfat::Format(dmDevice, numImgSectors);
         }
 
         if (formatStatus < 0) {
@@ -556,10 +926,11 @@
 
         int mountStatus;
         if (usingExt4) {
-            mountStatus = Ext4::doMount(dmDevice, mountPoint, false, false, false);
+            mountStatus = android::vold::ext4::Mount(dmDevice, mountPoint,
+                    false, false, false);
         } else {
-            mountStatus = Fat::doMount(dmDevice, mountPoint, false, false, false, ownerUid, 0, 0000,
-                    false);
+            mountStatus = android::vold::vfat::Mount(dmDevice, mountPoint,
+                    false, false, false, ownerUid, 0, 0000, false);
         }
 
         if (mountStatus) {
@@ -573,7 +944,7 @@
         }
 
         if (usingExt4) {
-            int dirfd = open(mountPoint, O_DIRECTORY);
+            int dirfd = open(mountPoint, O_DIRECTORY | O_CLOEXEC);
             if (dirfd >= 0) {
                 if (fchown(dirfd, ownerUid, AID_SYSTEM)
                         || fchmod(dirfd, S_IRUSR | S_IWUSR | S_IXUSR | S_ISGID | S_IRGRP | S_IXGRP)) {
@@ -606,7 +977,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
        SLOGE("ASEC resize failed for %s: couldn't construct mountpoint", id);
        return -1;
@@ -622,7 +993,7 @@
     int fd;
     unsigned int oldNumSec = 0;
 
-    if ((fd = open(asecFileName, O_RDONLY)) < 0) {
+    if ((fd = open(asecFileName, O_RDONLY | O_CLOEXEC)) < 0) {
         SLOGE("Failed to open ASEC file (%s)", strerror(errno));
         return -1;
     }
@@ -718,7 +1089,7 @@
      */
     waitForDevMapper(dmDevice);
 
-    if (Ext4::resize(dmDevice, numImgSectors)) {
+    if (android::vold::ext4::Resize(dmDevice, numImgSectors)) {
         SLOGE("Unable to resize %s (%s)", id, strerror(errno));
         if (cleanupDm) {
             Devmapper::destroy(idHash);
@@ -767,7 +1138,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("ASEC finalize failed: couldn't construct mountPoint");
         return -1;
@@ -775,9 +1146,11 @@
 
     int result = 0;
     if (sb.c_opts & ASEC_SB_C_OPTS_EXT4) {
-        result = Ext4::doMount(loopDevice, mountPoint, true, true, true);
+        result = android::vold::ext4::Mount(loopDevice, mountPoint,
+                true, true, true);
     } else {
-        result = Fat::doMount(loopDevice, mountPoint, true, true, true, 0, 0, 0227, false);
+        result = android::vold::vfat::Mount(loopDevice, mountPoint,
+                true, true, true, 0, 0, 0227, false);
     }
 
     if (result) {
@@ -830,7 +1203,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("Unable remount to fix permissions for %s: couldn't construct mountpoint", id);
         return -1;
@@ -841,7 +1214,7 @@
         return 0;
     }
 
-    int ret = Ext4::doMount(loopDevice, mountPoint,
+    int ret = android::vold::ext4::Mount(loopDevice, mountPoint,
             false /* read-only */,
             true  /* remount */,
             false /* executable */);
@@ -868,7 +1241,7 @@
              */
             const bool privateFile = !strcmp(ftsent->fts_name, filename);
 
-            int fd = open(ftsent->fts_accpath, O_NOFOLLOW);
+            int fd = open(ftsent->fts_accpath, O_NOFOLLOW | O_CLOEXEC);
             if (fd < 0) {
                 SLOGE("Couldn't open file %s: %s", ftsent->fts_accpath, strerror(errno));
                 result = -1;
@@ -893,7 +1266,7 @@
         fts_close(fts);
 
         // Finally make the directory readable by everyone.
-        int dirfd = open(mountPoint, O_DIRECTORY);
+        int dirfd = open(mountPoint, O_DIRECTORY | O_CLOEXEC);
         if (dirfd < 0 || fchmod(dirfd, 0755)) {
             SLOGE("Couldn't change owner of existing directory %s: %s", mountPoint, strerror(errno));
             result |= -1;
@@ -903,7 +1276,7 @@
         result |= -1;
     }
 
-    result |= Ext4::doMount(loopDevice, mountPoint,
+    result |= android::vold::ext4::Mount(loopDevice, mountPoint,
             true /* read-only */,
             true /* remount */,
             true /* execute */);
@@ -945,7 +1318,7 @@
 
     asprintf(&asecFilename2, "%s/%s.asec", dir, id2);
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id1);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id1);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("Rename failed: couldn't construct mountpoint");
         goto out_err;
@@ -957,7 +1330,7 @@
         goto out_err;
     }
 
-    written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id2);
+    written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id2);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("Rename failed: couldn't construct mountpoint2");
         goto out_err;
@@ -1005,7 +1378,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("ASEC unmount failed for %s: couldn't construct mountpoint", id);
         return -1;
@@ -1029,7 +1402,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::LOOPDIR, idHash);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::LOOPDIR, idHash);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("OBB unmount failed for %s: couldn't construct mountpoint", fileName);
         return -1;
@@ -1060,16 +1433,16 @@
         SLOGW("%s unmount attempt %d failed (%s)",
               id, i, strerror(errno));
 
-        int action = 0; // default is to just complain
+        int signal = 0; // default is to just complain
 
         if (force) {
             if (i > (UNMOUNT_RETRIES - 2))
-                action = 2; // SIGKILL
+                signal = SIGKILL;
             else if (i > (UNMOUNT_RETRIES - 3))
-                action = 1; // SIGHUP
+                signal = SIGTERM;
         }
 
-        Process::killProcessesWithOpenFiles(mountPoint, action);
+        Process::killProcessesWithOpenFiles(mountPoint, signal);
         usleep(UNMOUNT_SLEEP_BETWEEN_RETRY_MS);
     }
 
@@ -1141,7 +1514,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("ASEC destroy failed for %s: couldn't construct mountpoint", id);
         return -1;
@@ -1201,7 +1574,7 @@
 }
 
 bool VolumeManager::isAsecInDirectory(const char *dir, const char *asecName) const {
-    int dirfd = open(dir, O_DIRECTORY);
+    int dirfd = open(dir, O_DIRECTORY | O_CLOEXEC);
     if (dirfd < 0) {
         SLOGE("Couldn't open internal ASEC dir (%s)", strerror(errno));
         return false;
@@ -1232,10 +1605,10 @@
     }
 
     const char *dir;
-    if (isAsecInDirectory(Volume::SEC_ASECDIR_INT, asecName)) {
-        dir = Volume::SEC_ASECDIR_INT;
-    } else if (isAsecInDirectory(Volume::SEC_ASECDIR_EXT, asecName)) {
-        dir = Volume::SEC_ASECDIR_EXT;
+    if (isAsecInDirectory(VolumeManager::SEC_ASECDIR_INT, asecName)) {
+        dir = VolumeManager::SEC_ASECDIR_INT;
+    } else if (isAsecInDirectory(VolumeManager::SEC_ASECDIR_EXT, asecName)) {
+        dir = VolumeManager::SEC_ASECDIR_EXT;
     } else {
         free(asecName);
         return -1;
@@ -1273,7 +1646,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::ASECDIR, id);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("ASEC mount failed for %s: couldn't construct mountpoint", id);
         return -1;
@@ -1339,9 +1712,11 @@
 
     int result;
     if (sb.c_opts & ASEC_SB_C_OPTS_EXT4) {
-        result = Ext4::doMount(dmDevice, mountPoint, readOnly, false, readOnly);
+        result = android::vold::ext4::Mount(dmDevice, mountPoint,
+                readOnly, false, readOnly);
     } else {
-        result = Fat::doMount(dmDevice, mountPoint, readOnly, false, readOnly, ownerUid, 0, 0222, false);
+        result = android::vold::vfat::Mount(dmDevice, mountPoint,
+                readOnly, false, readOnly, ownerUid, 0, 0222, false);
     }
 
     if (result) {
@@ -1360,19 +1735,6 @@
     return 0;
 }
 
-Volume* VolumeManager::getVolumeForFile(const char *fileName) {
-    VolumeCollection::iterator i;
-
-    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
-        const char* mountPoint = (*i)->getFuseMountpoint();
-        if (!strncmp(fileName, mountPoint, strlen(mountPoint))) {
-            return *i;
-        }
-    }
-
-    return NULL;
-}
-
 /**
  * Mounts an image file <code>img</code>.
  */
@@ -1385,7 +1747,7 @@
         return -1;
     }
 
-    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::LOOPDIR, idHash);
+    int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", VolumeManager::LOOPDIR, idHash);
     if ((written < 0) || (size_t(written) >= sizeof(mountPoint))) {
         SLOGE("OBB mount failed for %s: couldn't construct mountpoint", img);
         return -1;
@@ -1406,7 +1768,7 @@
     int fd;
     unsigned long nr_sec = 0;
 
-    if ((fd = open(loopDevice, O_RDWR)) < 0) {
+    if ((fd = open(loopDevice, O_RDWR | O_CLOEXEC)) < 0) {
         SLOGE("Failed to open loopdevice (%s)", strerror(errno));
         Loop::destroyByDevice(loopDevice);
         return -1;
@@ -1443,8 +1805,8 @@
      */
     waitForDevMapper(dmDevice);
 
-    if (Fat::doMount(dmDevice, mountPoint, true, false, true, 0, ownerGid,
-                     0227, false)) {
+    if (android::vold::vfat::Mount(dmDevice, mountPoint,
+            true, false, true, 0, ownerGid, 0227, false)) {
         SLOGE("Image mount failed (%s)", strerror(errno));
         if (cleanupDm) {
             Devmapper::destroy(idHash);
@@ -1460,17 +1822,6 @@
     return 0;
 }
 
-int VolumeManager::mountVolume(const char *label) {
-    Volume *v = lookupVolume(label);
-
-    if (!v) {
-        errno = ENOENT;
-        return -1;
-    }
-
-    return v->mountVol();
-}
-
 int VolumeManager::listMountedObbs(SocketClient* cli) {
     FILE *fp = setmntent("/proc/mounts", "r");
     if (fp == NULL) {
@@ -1479,16 +1830,16 @@
     }
 
     // Create a string to compare against that has a trailing slash
-    int loopDirLen = strlen(Volume::LOOPDIR);
+    int loopDirLen = strlen(VolumeManager::LOOPDIR);
     char loopDir[loopDirLen + 2];
-    strcpy(loopDir, Volume::LOOPDIR);
+    strcpy(loopDir, VolumeManager::LOOPDIR);
     loopDir[loopDirLen++] = '/';
     loopDir[loopDirLen] = '\0';
 
     mntent* mentry;
     while ((mentry = getmntent(fp)) != NULL) {
         if (!strncmp(mentry->mnt_dir, loopDir, loopDirLen)) {
-            int fd = open(mentry->mnt_fsname, O_RDONLY);
+            int fd = open(mentry->mnt_fsname, O_RDONLY | O_CLOEXEC);
             if (fd >= 0) {
                 struct loop_info64 li;
                 if (ioctl(fd, LOOP_GET_STATUS64, &li) >= 0) {
@@ -1503,299 +1854,9 @@
     return 0;
 }
 
-int VolumeManager::shareEnabled(const char *label, const char *method, bool *enabled) {
-    Volume *v = lookupVolume(label);
-
-    if (!v) {
-        errno = ENOENT;
-        return -1;
-    }
-
-    if (strcmp(method, "ums")) {
-        errno = ENOSYS;
-        return -1;
-    }
-
-    if (v->getState() != Volume::State_Shared) {
-        *enabled = false;
-    } else {
-        *enabled = true;
-    }
-    return 0;
-}
-
-int VolumeManager::shareVolume(const char *label, const char *method) {
-    Volume *v = lookupVolume(label);
-
-    if (!v) {
-        errno = ENOENT;
-        return -1;
-    }
-
-    /*
-     * Eventually, we'll want to support additional share back-ends,
-     * some of which may work while the media is mounted. For now,
-     * we just support UMS
-     */
-    if (strcmp(method, "ums")) {
-        errno = ENOSYS;
-        return -1;
-    }
-
-    if (v->getState() == Volume::State_NoMedia) {
-        errno = ENODEV;
-        return -1;
-    }
-
-    if (v->getState() != Volume::State_Idle) {
-        // You need to unmount manually befoe sharing
-        errno = EBUSY;
-        return -1;
-    }
-
-    if (mVolManagerDisabled) {
-        errno = EBUSY;
-        return -1;
-    }
-
-    dev_t d = v->getShareDevice();
-    if ((MAJOR(d) == 0) && (MINOR(d) == 0)) {
-        // This volume does not support raw disk access
-        errno = EINVAL;
-        return -1;
-    }
-
-    int fd;
-    char nodepath[255];
-    int written = snprintf(nodepath,
-             sizeof(nodepath), "/dev/block/vold/%d:%d",
-             major(d), minor(d));
-
-    if ((written < 0) || (size_t(written) >= sizeof(nodepath))) {
-        SLOGE("shareVolume failed: couldn't construct nodepath");
-        return -1;
-    }
-
-    if ((fd = open(MASS_STORAGE_FILE_PATH, O_WRONLY)) < 0) {
-        SLOGE("Unable to open ums lunfile (%s)", strerror(errno));
-        return -1;
-    }
-
-    if (write(fd, nodepath, strlen(nodepath)) < 0) {
-        SLOGE("Unable to write to ums lunfile (%s)", strerror(errno));
-        close(fd);
-        return -1;
-    }
-
-    close(fd);
-    v->handleVolumeShared();
-    if (mUmsSharingCount++ == 0) {
-        FILE* fp;
-        mSavedDirtyRatio = -1; // in case we fail
-        if ((fp = fopen("/proc/sys/vm/dirty_ratio", "r+"))) {
-            char line[16];
-            if (fgets(line, sizeof(line), fp) && sscanf(line, "%d", &mSavedDirtyRatio)) {
-                fprintf(fp, "%d\n", mUmsDirtyRatio);
-            } else {
-                SLOGE("Failed to read dirty_ratio (%s)", strerror(errno));
-            }
-            fclose(fp);
-        } else {
-            SLOGE("Failed to open /proc/sys/vm/dirty_ratio (%s)", strerror(errno));
-        }
-    }
-    return 0;
-}
-
-int VolumeManager::unshareVolume(const char *label, const char *method) {
-    Volume *v = lookupVolume(label);
-
-    if (!v) {
-        errno = ENOENT;
-        return -1;
-    }
-
-    if (strcmp(method, "ums")) {
-        errno = ENOSYS;
-        return -1;
-    }
-
-    if (v->getState() != Volume::State_Shared) {
-        errno = EINVAL;
-        return -1;
-    }
-
-    int fd;
-    if ((fd = open(MASS_STORAGE_FILE_PATH, O_WRONLY)) < 0) {
-        SLOGE("Unable to open ums lunfile (%s)", strerror(errno));
-        return -1;
-    }
-
-    char ch = 0;
-    if (write(fd, &ch, 1) < 0) {
-        SLOGE("Unable to write to ums lunfile (%s)", strerror(errno));
-        close(fd);
-        return -1;
-    }
-
-    close(fd);
-    v->handleVolumeUnshared();
-    if (--mUmsSharingCount == 0 && mSavedDirtyRatio != -1) {
-        FILE* fp;
-        if ((fp = fopen("/proc/sys/vm/dirty_ratio", "r+"))) {
-            fprintf(fp, "%d\n", mSavedDirtyRatio);
-            fclose(fp);
-        } else {
-            SLOGE("Failed to open /proc/sys/vm/dirty_ratio (%s)", strerror(errno));
-        }
-        mSavedDirtyRatio = -1;
-    }
-    return 0;
-}
-
-extern "C" int vold_disableVol(const char *label) {
+extern "C" int vold_unmountAll(void) {
     VolumeManager *vm = VolumeManager::Instance();
-    vm->disableVolumeManager();
-    vm->unshareVolume(label, "ums");
-    return vm->unmountVolume(label, true, false);
-}
-
-extern "C" int vold_getNumDirectVolumes(void) {
-    VolumeManager *vm = VolumeManager::Instance();
-    return vm->getNumDirectVolumes();
-}
-
-int VolumeManager::getNumDirectVolumes(void) {
-    VolumeCollection::iterator i;
-    int n=0;
-
-    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
-        if ((*i)->getShareDevice() != (dev_t)0) {
-            n++;
-        }
-    }
-    return n;
-}
-
-extern "C" int vold_getDirectVolumeList(struct volume_info *vol_list) {
-    VolumeManager *vm = VolumeManager::Instance();
-    return vm->getDirectVolumeList(vol_list);
-}
-
-int VolumeManager::getDirectVolumeList(struct volume_info *vol_list) {
-    VolumeCollection::iterator i;
-    int n=0;
-    dev_t d;
-
-    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
-        if ((d=(*i)->getShareDevice()) != (dev_t)0) {
-            (*i)->getVolInfo(&vol_list[n]);
-            snprintf(vol_list[n].blk_dev, sizeof(vol_list[n].blk_dev),
-                     "/dev/block/vold/%d:%d", major(d), minor(d));
-            n++;
-        }
-    }
-
-    return 0;
-}
-
-int VolumeManager::unmountVolume(const char *label, bool force, bool revert) {
-    Volume *v = lookupVolume(label);
-
-    if (!v) {
-        errno = ENOENT;
-        return -1;
-    }
-
-    if (v->getState() == Volume::State_NoMedia) {
-        errno = ENODEV;
-        return -1;
-    }
-
-    if (v->getState() != Volume::State_Mounted) {
-        SLOGW("Attempt to unmount volume which isn't mounted (%d)\n",
-             v->getState());
-        errno = EBUSY;
-        return UNMOUNT_NOT_MOUNTED_ERR;
-    }
-
-    cleanupAsec(v, force);
-
-    return v->unmountVol(force, revert);
-}
-
-extern "C" int vold_unmountAllAsecs(void) {
-    int rc;
-
-    VolumeManager *vm = VolumeManager::Instance();
-    rc = vm->unmountAllAsecsInDir(Volume::SEC_ASECDIR_EXT);
-    if (vm->unmountAllAsecsInDir(Volume::SEC_ASECDIR_INT)) {
-        rc = -1;
-    }
-    return rc;
-}
-
-#define ID_BUF_LEN 256
-#define ASEC_SUFFIX ".asec"
-#define ASEC_SUFFIX_LEN (sizeof(ASEC_SUFFIX) - 1)
-int VolumeManager::unmountAllAsecsInDir(const char *directory) {
-    DIR *d = opendir(directory);
-    int rc = 0;
-
-    if (!d) {
-        SLOGE("Could not open asec dir %s", directory);
-        return -1;
-    }
-
-    size_t dirent_len = offsetof(struct dirent, d_name) +
-            fpathconf(dirfd(d), _PC_NAME_MAX) + 1;
-
-    struct dirent *dent = (struct dirent *) malloc(dirent_len);
-    if (dent == NULL) {
-        SLOGE("Failed to allocate memory for asec dir");
-        return -1;
-    }
-
-    struct dirent *result;
-    while (!readdir_r(d, dent, &result) && result != NULL) {
-        if (dent->d_name[0] == '.')
-            continue;
-        if (dent->d_type != DT_REG)
-            continue;
-        size_t name_len = strlen(dent->d_name);
-        if (name_len > 5 && name_len < (ID_BUF_LEN + ASEC_SUFFIX_LEN - 1) &&
-                !strcmp(&dent->d_name[name_len - 5], ASEC_SUFFIX)) {
-            char id[ID_BUF_LEN];
-            strlcpy(id, dent->d_name, name_len - 4);
-            if (unmountAsec(id, true)) {
-                /* Register the error, but try to unmount more asecs */
-                rc = -1;
-            }
-        }
-    }
-    closedir(d);
-
-    free(dent);
-
-    return rc;
-}
-
-/*
- * Looks up a volume by it's label or mount-point
- */
-Volume *VolumeManager::lookupVolume(const char *label) {
-    VolumeCollection::iterator i;
-
-    for (i = mVolumes->begin(); i != mVolumes->end(); ++i) {
-        if (label[0] == '/') {
-            if (!strcmp(label, (*i)->getFuseMountpoint()))
-                return (*i);
-        } else {
-            if (!strcmp(label, (*i)->getLabel()))
-                return (*i);
-        }
-    }
-    return NULL;
+    return vm->unmountAll();
 }
 
 bool VolumeManager::isMountpointMounted(const char *mp)
@@ -1818,77 +1879,13 @@
     return found_mp;
 }
 
-int VolumeManager::cleanupAsec(Volume *v, bool force) {
-    int rc = 0;
-
-    char asecFileName[255];
-
-    AsecIdCollection removeAsec;
-    AsecIdCollection removeObb;
-
-    for (AsecIdCollection::iterator it = mActiveContainers->begin(); it != mActiveContainers->end();
-            ++it) {
-        ContainerData* cd = *it;
-
-        if (cd->type == ASEC) {
-            if (findAsec(cd->id, asecFileName, sizeof(asecFileName))) {
-                SLOGE("Couldn't find ASEC %s; cleaning up", cd->id);
-                removeAsec.push_back(cd);
-            } else {
-                SLOGD("Found ASEC at path %s", asecFileName);
-                if (!strncmp(asecFileName, Volume::SEC_ASECDIR_EXT,
-                        strlen(Volume::SEC_ASECDIR_EXT))) {
-                    removeAsec.push_back(cd);
-                }
-            }
-        } else if (cd->type == OBB) {
-            if (v == getVolumeForFile(cd->id)) {
-                removeObb.push_back(cd);
-            }
-        } else {
-            SLOGE("Unknown container type %d!", cd->type);
-        }
-    }
-
-    for (AsecIdCollection::iterator it = removeAsec.begin(); it != removeAsec.end(); ++it) {
-        ContainerData *cd = *it;
-        SLOGI("Unmounting ASEC %s (dependent on %s)", cd->id, v->getLabel());
-        if (unmountAsec(cd->id, force)) {
-            SLOGE("Failed to unmount ASEC %s (%s)", cd->id, strerror(errno));
-            rc = -1;
-        }
-    }
-
-    for (AsecIdCollection::iterator it = removeObb.begin(); it != removeObb.end(); ++it) {
-        ContainerData *cd = *it;
-        SLOGI("Unmounting OBB %s (dependent on %s)", cd->id, v->getLabel());
-        if (unmountObb(cd->id, force)) {
-            SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno));
-            rc = -1;
-        }
-    }
-
-    return rc;
-}
-
 int VolumeManager::mkdirs(char* path) {
-    // Require that path lives under a volume we manage and is mounted
-    const char* emulated_source = getenv("EMULATED_STORAGE_SOURCE");
-    const char* root = NULL;
-    if (emulated_source && !strncmp(path, emulated_source, strlen(emulated_source))) {
-        root = emulated_source;
+    // Only offer to create directories for paths managed by vold
+    if (strncmp(path, "/storage/", 9) == 0) {
+        // fs_mkdirs() does symlink checking and relative path enforcement
+        return fs_mkdirs(path, 0700);
     } else {
-        Volume* vol = getVolumeForFile(path);
-        if (vol && vol->getState() == Volume::State_Mounted) {
-            root = vol->getMountpoint();
-        }
-    }
-
-    if (!root) {
         SLOGE("Failed to find mounted volume for %s", path);
         return -EINVAL;
     }
-
-    /* fs_mkdirs() does symlink checking and relative path enforcement */
-    return fs_mkdirs(path, 0700);
 }
diff --git a/VolumeManager.h b/VolumeManager.h
index 17fa6f7..fa2237f 100644
--- a/VolumeManager.h
+++ b/VolumeManager.h
@@ -14,16 +14,29 @@
  * limitations under the License.
  */
 
-#ifndef _VOLUMEMANAGER_H
-#define _VOLUMEMANAGER_H
+#ifndef ANDROID_VOLD_VOLUME_MANAGER_H
+#define ANDROID_VOLD_VOLUME_MANAGER_H
 
 #include <pthread.h>
+#include <fnmatch.h>
+#include <stdlib.h>
 
 #ifdef __cplusplus
-#include <utils/List.h>
-#include <sysutils/SocketListener.h>
 
-#include "Volume.h"
+#include <list>
+#include <mutex>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+
+#include <cutils/multiuser.h>
+#include <utils/List.h>
+#include <utils/Timers.h>
+#include <sysutils/SocketListener.h>
+#include <sysutils/NetlinkEvent.h>
+
+#include "Disk.h"
+#include "VolumeBase.h"
 
 /* The length of an MD5 hash when encoded into ASCII hex characters */
 #define MD5_ASCII_LENGTH_PLUS_NULL ((MD5_DIGEST_LENGTH*2)+1)
@@ -51,13 +64,17 @@
 typedef android::List<ContainerData*> AsecIdCollection;
 
 class VolumeManager {
+public:
+    static const char *SEC_ASECDIR_EXT;
+    static const char *SEC_ASECDIR_INT;
+    static const char *ASECDIR;
+    static const char *LOOPDIR;
+
 private:
     static VolumeManager *sInstance;
 
-private:
     SocketListener        *mBroadcaster;
 
-    VolumeCollection      *mVolumes;
     AsecIdCollection      *mActiveContainers;
     bool                   mDebug;
 
@@ -65,26 +82,63 @@
     int                    mUmsSharingCount;
     int                    mSavedDirtyRatio;
     int                    mUmsDirtyRatio;
-    int                    mVolManagerDisabled;
 
 public:
     virtual ~VolumeManager();
 
+    // TODO: pipe all requests through VM to avoid exposing this lock
+    std::mutex& getLock() { return mLock; }
+
     int start();
     int stop();
 
     void handleBlockEvent(NetlinkEvent *evt);
 
-    int addVolume(Volume *v);
+    class DiskSource {
+    public:
+        DiskSource(const std::string& sysPattern, const std::string& nickname, int flags) :
+                mSysPattern(sysPattern), mNickname(nickname), mFlags(flags) {
+        }
 
-    int listVolumes(SocketClient *cli, bool broadcast);
-    int mountVolume(const char *label);
-    int unmountVolume(const char *label, bool force, bool revert);
-    int shareVolume(const char *label, const char *method);
-    int unshareVolume(const char *label, const char *method);
-    int shareEnabled(const char *path, const char *method, bool *enabled);
-    int formatVolume(const char *label, bool wipe);
-    void disableVolumeManager(void) { mVolManagerDisabled = 1; }
+        bool matches(const std::string& sysPath) {
+            return !fnmatch(mSysPattern.c_str(), sysPath.c_str(), 0);
+        }
+
+        const std::string& getNickname() { return mNickname; }
+        int getFlags() { return mFlags; }
+
+    private:
+        std::string mSysPattern;
+        std::string mNickname;
+        int mFlags;
+    };
+
+    void addDiskSource(const std::shared_ptr<DiskSource>& diskSource);
+
+    std::shared_ptr<android::vold::Disk> findDisk(const std::string& id);
+    std::shared_ptr<android::vold::VolumeBase> findVolume(const std::string& id);
+
+    void listVolumes(android::vold::VolumeBase::Type type, std::list<std::string>& list);
+
+    nsecs_t benchmarkPrivate(const std::string& id);
+
+    int forgetPartition(const std::string& partGuid);
+
+    int onUserAdded(userid_t userId, int userSerialNumber);
+    int onUserRemoved(userid_t userId);
+    int onUserStarted(userid_t userId);
+    int onUserStopped(userid_t userId);
+
+    int setPrimary(const std::shared_ptr<android::vold::VolumeBase>& vol);
+
+    int remountUid(uid_t uid, const std::string& mode);
+
+    /* Reset all internal state, typically during framework boot */
+    int reset();
+    /* Prepare for device shutdown, safely unmounting all devices */
+    int shutdown();
+    /* Unmount all volumes, usually for encryption */
+    int unmountAll();
 
     /* ASEC */
     int findAsec(const char *id, char *asecPath = NULL, size_t asecPathLen = 0,
@@ -118,16 +172,11 @@
     int unmountObb(const char *fileName, bool force);
     int getObbMountPath(const char *id, char *buffer, int maxlen);
 
-    Volume* getVolumeForFile(const char *fileName);
-
     /* Shared between ASEC and Loopback images */
     int unmountLoopImage(const char *containerId, const char *loopId,
             const char *fileName, const char *mountPoint, bool force);
 
-    void setDebug(bool enable);
-
-    // XXX: Post froyo this should be moved and cleaned up
-    int cleanupAsec(Volume *v, bool force);
+    int setDebug(bool enable);
 
     void setBroadcaster(SocketListener *sl) { mBroadcaster = sl; }
     SocketListener *getBroadcaster() { return mBroadcaster; }
@@ -136,11 +185,6 @@
 
     static char *asecHash(const char *id, char *buffer, size_t len);
 
-    Volume *lookupVolume(const char *label);
-    int getNumDirectVolumes(void);
-    int getDirectVolumeList(struct volume_info *vol_list);
-    int unmountAllAsecsInDir(const char *directory);
-
     /*
      * Ensure that all directories along given path exist, creating parent
      * directories as needed.  Validates that given path is absolute and that
@@ -156,15 +200,25 @@
     bool isMountpointMounted(const char *mp);
     bool isAsecInDirectory(const char *dir, const char *asec) const;
     bool isLegalAsecId(const char *id) const;
+
+    int linkPrimary(userid_t userId);
+
+    std::mutex mLock;
+
+    std::list<std::shared_ptr<DiskSource>> mDiskSources;
+    std::list<std::shared_ptr<android::vold::Disk>> mDisks;
+
+    std::unordered_map<userid_t, int> mAddedUsers;
+    std::unordered_set<userid_t> mStartedUsers;
+
+    std::shared_ptr<android::vold::VolumeBase> mInternalEmulated;
+    std::shared_ptr<android::vold::VolumeBase> mPrimary;
 };
 
 extern "C" {
 #endif /* __cplusplus */
 #define UNMOUNT_NOT_MOUNTED_ERR -2
-    int vold_disableVol(const char *label);
-    int vold_getNumDirectVolumes(void);
-    int vold_getDirectVolumeList(struct volume_info *v);
-    int vold_unmountAllAsecs(void);
+    int vold_unmountAll(void);
 #ifdef __cplusplus
 }
 #endif
diff --git a/bench/benchgen.py b/bench/benchgen.py
new file mode 100644
index 0000000..77262c4
--- /dev/null
+++ b/bench/benchgen.py
@@ -0,0 +1,337 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the 'License');
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an 'AS IS' BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Generates storage benchmark from captured strace output.
+
+Currently assumes that all mmap'ed regions are resource accesses, and emulates as pread().
+
+Usage:
+$ adb shell strace -p `pid zygote` -o /data/local/tmp/trace -f -ff -y -ttt -e trace=file,desc,munmap
+$ adb pull /data/local/tmp/trace*
+$ python benchgen.py trace.*
+
+"""
+
+import re, sys, collections, traceback, argparse
+
+from operator import itemgetter
+from collections import defaultdict
+
+class Event:
+    def __init__(self, thread, time, call, args, ret):
+        self.thread = thread
+        self.time = time
+        self.call = call
+        self.args = args
+        self.ret = ret
+
+    def __repr__(self):
+        return "%s(%s)=%s" % (self.call, repr(self.args), self.ret)
+
+
+class File:
+    def __init__(self, name, ident):
+        self.name = name
+        self.ident = ident
+        self.size = 0
+
+    def __repr__(self):
+        return self.name
+
+
+events = []
+files = {}
+
+def find_file(name):
+    name = name.strip('<>"')
+    if name not in files:
+        files[name] = File(name, len(files))
+    return files[name]
+
+def extract_file(e, arg):
+    if "<" in arg:
+        fd, path = arg.split("<")
+        path = path.strip(">")
+        handle = "t%sf%s" % (e.thread, fd)
+        return (fd, find_file(path), handle)
+    else:
+        return (None, None, None)
+
+def parse_args(s):
+    args = []
+    arg = ""
+    esc = False
+    quot = False
+    for c in s:
+        if esc:
+            esc = False
+            arg += c
+            continue
+
+        if c == '"':
+            if quot:
+                quot = False
+                continue
+            else:
+                quot = True
+                continue
+
+        if c == '\\':
+            esc = True
+            continue
+
+        if c == ',' and not quot:
+            args.append(arg.strip())
+            arg = ""
+        else:
+            arg += c
+
+    args.append(arg.strip())
+    return args
+
+
+bufsize = 1048576
+interesting = ["mmap2","read","write","pread64","pwrite64","fsync","fdatasync","openat","close","lseek","_llseek"]
+
+re_event = re.compile(r"^([\d\.]+) (.+?)\((.+?)\) = (.+?)$")
+re_arg = re.compile(r'''((?:[^,"']|"[^"]*"|'[^']*')+)''')
+for fn in sys.argv[1:]:
+    with open(fn) as f:
+        thread = int(fn.split(".")[-1])
+        for line in f:
+            line = re_event.match(line)
+            if not line: continue
+
+            time, call, args, ret = line.groups()
+            if call not in interesting: continue
+            if "/data/" not in args: continue
+
+            time = float(time)
+            args = parse_args(args)
+            events.append(Event(thread, time, call, args, ret))
+
+
+with open("BenchmarkGen.h", 'w') as bench:
+    print >>bench, """/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/******************************************************************
+ * THIS CODE WAS GENERATED BY benchgen.py, DO NOT MODIFY DIRECTLY *
+ ******************************************************************/
+
+
+#include <base/logging.h>
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sendfile.h>
+#include <fcntl.h>
+
+#include <algorithm>
+#include <string>
+
+#include <Utils.h>
+
+namespace android {
+namespace vold {
+
+static status_t BenchmarkRun() {
+"""
+
+    print >>bench, "char* buf = (char*) malloc(%d);" % (bufsize)
+
+    nread = 0
+    nwrite = 0
+    nsync = 0
+    events = sorted(events, key=lambda e: e.time)
+    active = set()
+    defined = set()
+    for e in events:
+        if e.call == "openat":
+            fd, f, handle = extract_file(e, e.ret)
+            if f:
+                active.add(handle)
+                if handle not in defined:
+                    print >>bench, "int ",
+                    defined.add(handle)
+                print >>bench, '%s = TEMP_FAILURE_RETRY(open("file%s", %s));' % (handle, f.ident, e.args[2])
+
+        elif e.call == "close":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                active.remove(handle)
+                print >>bench, 'close(%s);' % (handle)
+
+        elif e.call == "lseek":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                print >>bench, 'TEMP_FAILURE_RETRY(lseek(%s, %s, %s));' % (handle, e.args[1], e.args[2])
+
+        elif e.call == "_llseek":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                print >>bench, 'TEMP_FAILURE_RETRY(lseek(%s, %s, %s));' % (handle, e.args[1], e.args[3])
+
+        elif e.call == "read":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                # TODO: track actual file size instead of guessing
+                count = min(int(e.args[2]), bufsize)
+                f.size += count
+                print >>bench, 'TEMP_FAILURE_RETRY(read(%s, buf, %d));' % (handle, count)
+                nread += 1
+
+        elif e.call == "write":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                # TODO: track actual file size instead of guessing
+                count = min(int(e.args[2]), bufsize)
+                f.size += count
+                print >>bench, 'TEMP_FAILURE_RETRY(read(%s, buf, %d));' % (handle, count)
+                nwrite += 1
+
+        elif e.call == "pread64":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                f.size = max(f.size, int(e.args[2]) + int(e.args[3]))
+                count = min(int(e.args[2]), bufsize)
+                print >>bench, 'TEMP_FAILURE_RETRY(pread(%s, buf, %d, %s));' % (handle, count, e.args[3])
+                nread += 1
+
+        elif e.call == "pwrite64":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                f.size = max(f.size, int(e.args[2]) + int(e.args[3]))
+                count = min(int(e.args[2]), bufsize)
+                print >>bench, 'TEMP_FAILURE_RETRY(pwrite(%s, buf, %d, %s));' % (handle, count, e.args[3])
+                nwrite += 1
+
+        elif e.call == "fsync":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                print >>bench, 'TEMP_FAILURE_RETRY(fsync(%s));' % (handle)
+                nsync += 1
+
+        elif e.call == "fdatasync":
+            fd, f, handle = extract_file(e, e.args[0])
+            if handle in active:
+                print >>bench, 'TEMP_FAILURE_RETRY(fdatasync(%s));' % (handle)
+                nsync += 1
+
+        elif e.call == "mmap2":
+            fd, f, handle = extract_file(e, e.args[4])
+            if handle in active:
+                count = min(int(e.args[1]), bufsize)
+                offset = int(e.args[5], 0)
+                f.size = max(f.size, count + offset)
+                print >>bench, 'TEMP_FAILURE_RETRY(pread(%s, buf, %s, %s)); // mmap2' % (handle, count, offset)
+                nread += 1
+
+    for handle in active:
+        print >>bench, 'close(%s);' % (handle)
+
+    print >>bench, """
+free(buf);
+return 0;
+}
+
+static status_t CreateFile(const char* name, int len) {
+    int chunk = std::min(len, 65536);
+    int out = -1;
+    std::string buf;
+
+    if (android::vold::ReadRandomBytes(chunk, buf) != OK) {
+        LOG(ERROR) << "Failed to read random data";
+        return -EIO;
+    }
+    if ((out = TEMP_FAILURE_RETRY(open(name, O_WRONLY|O_CREAT|O_TRUNC))) < 0) {
+        PLOG(ERROR) << "Failed to open " << name;
+        return -errno;
+    }
+
+    while (len > 0) {
+        int n = write(out, buf.c_str(), std::min(len, chunk));
+        if (n < 0) {
+            PLOG(ERROR) << "Failed to write";
+            close(out);
+            return -errno;
+        }
+        len -= n;
+    }
+
+    close(out);
+    return OK;
+}
+
+static status_t BenchmarkCreate() {
+status_t res = 0;
+res |= CreateFile("stub", 0);
+"""
+    for f in files.values():
+        print >>bench, 'res |= CreateFile("file%s", %d);' % (f.ident, f.size)
+
+    print >>bench, """
+return res;
+}
+
+static status_t BenchmarkDestroy() {
+status_t res = 0;
+res |= unlink("stub");
+"""
+    for f in files.values():
+        print >>bench, 'res |= unlink("file%s");' % (f.ident)
+
+    print >>bench, """
+return res;
+}
+
+static std::string BenchmarkIdent() {"""
+    print >>bench, """return "r%d:w%d:s%d";""" % (nread, nwrite, nsync)
+    print >>bench, """}
+
+}  // namespace vold
+}  // namespace android
+"""
+
+
+size = sum([ f.size for f in files.values() ])
+print "Found", len(files), "data files accessed, total size", (size/1024), "kB"
+
+types = defaultdict(int)
+for e in events:
+    types[e.call] += 1
+
+print "Found syscalls:"
+for t, n in types.iteritems():
+    print str(n).rjust(8), t
+
+print
diff --git a/cryptfs.c b/cryptfs.c
index 5422f52..1a63a5b 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -61,6 +61,7 @@
 #include "Process.h"
 
 #include <hardware/keymaster0.h>
+#include <hardware/keymaster1.h>
 
 #define UNUSED __attribute__((unused))
 
@@ -78,8 +79,7 @@
 
 #define KEY_IN_FOOTER  "footer"
 
-// "default_password" encoded into hex (d=0x64 etc)
-#define DEFAULT_PASSWORD "64656661756c745f70617373776f7264"
+#define DEFAULT_PASSWORD "default_password"
 
 #define EXT4_FS 1
 #define F2FS_FS 2
@@ -89,6 +89,7 @@
 #define RSA_KEY_SIZE 2048
 #define RSA_KEY_SIZE_BYTES (RSA_KEY_SIZE / 8)
 #define RSA_EXPONENT 0x10001
+#define KEYMASTER_CRYPTFS_RATE_LIMIT 1  // Maximum one try per second
 
 #define RETRY_MOUNT_ATTEMPTS 10
 #define RETRY_MOUNT_DELAY_SECONDS 1
@@ -100,7 +101,8 @@
 static int  master_key_saved = 0;
 static struct crypt_persist_data *persist_data = NULL;
 
-static int keymaster_init(keymaster0_device_t **keymaster_dev)
+static int keymaster_init(keymaster0_device_t **keymaster0_dev,
+                          keymaster1_device_t **keymaster1_dev)
 {
     int rc;
 
@@ -108,50 +110,74 @@
     rc = hw_get_module_by_class(KEYSTORE_HARDWARE_MODULE_ID, NULL, &mod);
     if (rc) {
         ALOGE("could not find any keystore module");
-        goto out;
+        goto err;
     }
 
-    rc = keymaster0_open(mod, keymaster_dev);
+    SLOGI("keymaster module name is %s", mod->name);
+    SLOGI("keymaster version is %d", mod->module_api_version);
+
+    *keymaster0_dev = NULL;
+    *keymaster1_dev = NULL;
+    if (mod->module_api_version == KEYMASTER_MODULE_API_VERSION_1_0) {
+        SLOGI("Found keymaster1 module, using keymaster1 API.");
+        rc = keymaster1_open(mod, keymaster1_dev);
+    } else {
+        SLOGI("Found keymaster0 module, using keymaster0 API.");
+        rc = keymaster0_open(mod, keymaster0_dev);
+    }
+
     if (rc) {
         ALOGE("could not open keymaster device in %s (%s)",
-            KEYSTORE_HARDWARE_MODULE_ID, strerror(-rc));
-        goto out;
+              KEYSTORE_HARDWARE_MODULE_ID, strerror(-rc));
+        goto err;
     }
 
     return 0;
 
-out:
-    *keymaster_dev = NULL;
+err:
+    *keymaster0_dev = NULL;
+    *keymaster1_dev = NULL;
     return rc;
 }
 
 /* Should we use keymaster? */
 static int keymaster_check_compatibility()
 {
-    keymaster0_device_t *keymaster_dev = 0;
+    keymaster0_device_t *keymaster0_dev = 0;
+    keymaster1_device_t *keymaster1_dev = 0;
     int rc = 0;
 
-    if (keymaster_init(&keymaster_dev)) {
+    if (keymaster_init(&keymaster0_dev, &keymaster1_dev)) {
         SLOGE("Failed to init keymaster");
         rc = -1;
         goto out;
     }
 
-    SLOGI("keymaster version is %d", keymaster_dev->common.module->module_api_version);
+    if (keymaster1_dev) {
+        rc = 1;
+        goto out;
+    }
 
-    if (keymaster_dev->common.module->module_api_version
+    // TODO(swillden): Check to see if there's any reason to require v0.3.  I think v0.1 and v0.2
+    // should work.
+    if (keymaster0_dev->common.module->module_api_version
             < KEYMASTER_MODULE_API_VERSION_0_3) {
         rc = 0;
         goto out;
     }
 
-    if (!(keymaster_dev->flags & KEYMASTER_SOFTWARE_ONLY) &&
-        (keymaster_dev->flags & KEYMASTER_BLOBS_ARE_STANDALONE)) {
+    if (!(keymaster0_dev->flags & KEYMASTER_SOFTWARE_ONLY) &&
+        (keymaster0_dev->flags & KEYMASTER_BLOBS_ARE_STANDALONE)) {
         rc = 1;
     }
 
 out:
-    keymaster0_close(keymaster_dev);
+    if (keymaster1_dev) {
+        keymaster1_close(keymaster1_dev);
+    }
+    if (keymaster0_dev) {
+        keymaster0_close(keymaster0_dev);
+    }
     return rc;
 }
 
@@ -159,24 +185,67 @@
 static int keymaster_create_key(struct crypt_mnt_ftr *ftr)
 {
     uint8_t* key = 0;
-    keymaster0_device_t *keymaster_dev = 0;
+    keymaster0_device_t *keymaster0_dev = 0;
+    keymaster1_device_t *keymaster1_dev = 0;
 
-    if (keymaster_init(&keymaster_dev)) {
+    if (keymaster_init(&keymaster0_dev, &keymaster1_dev)) {
         SLOGE("Failed to init keymaster");
         return -1;
     }
 
     int rc = 0;
+    size_t key_size = 0;
+    if (keymaster1_dev) {
+        keymaster_key_param_t params[] = {
+            /* Algorithm & size specifications.  Stick with RSA for now.  Switch to AES later. */
+            keymaster_param_enum(KM_TAG_ALGORITHM, KM_ALGORITHM_RSA),
+            keymaster_param_int(KM_TAG_KEY_SIZE, RSA_KEY_SIZE),
+            keymaster_param_long(KM_TAG_RSA_PUBLIC_EXPONENT, RSA_EXPONENT),
 
-    keymaster_rsa_keygen_params_t params;
-    memset(&params, '\0', sizeof(params));
-    params.public_exponent = RSA_EXPONENT;
-    params.modulus_size = RSA_KEY_SIZE;
+	    /* The only allowed purpose for this key is signing. */
+	    keymaster_param_enum(KM_TAG_PURPOSE, KM_PURPOSE_SIGN),
 
-    size_t key_size;
-    if (keymaster_dev->generate_keypair(keymaster_dev, TYPE_RSA, &params,
-                                        &key, &key_size)) {
-        SLOGE("Failed to generate keypair");
+            /* Padding & digest specifications. */
+            keymaster_param_enum(KM_TAG_PADDING, KM_PAD_NONE),
+            keymaster_param_enum(KM_TAG_DIGEST, KM_DIGEST_NONE),
+
+            /* Require that the key be usable in standalone mode.  File system isn't available. */
+            keymaster_param_enum(KM_TAG_BLOB_USAGE_REQUIREMENTS, KM_BLOB_STANDALONE),
+
+            /* No auth requirements, because cryptfs is not yet integrated with gatekeeper. */
+            keymaster_param_bool(KM_TAG_NO_AUTH_REQUIRED),
+
+            /* Rate-limit key usage attempts, to rate-limit brute force */
+            keymaster_param_int(KM_TAG_MIN_SECONDS_BETWEEN_OPS, KEYMASTER_CRYPTFS_RATE_LIMIT),
+        };
+        keymaster_key_param_set_t param_set = { params, sizeof(params)/sizeof(*params) };
+        keymaster_key_blob_t key_blob;
+        keymaster_error_t error = keymaster1_dev->generate_key(keymaster1_dev, &param_set,
+                                                               &key_blob,
+                                                               NULL /* characteristics */);
+        if (error != KM_ERROR_OK) {
+            SLOGE("Failed to generate keymaster1 key, error %d", error);
+            rc = -1;
+            goto out;
+        }
+
+        key = (uint8_t*)key_blob.key_material;
+        key_size = key_blob.key_material_size;
+    }
+    else if (keymaster0_dev) {
+        keymaster_rsa_keygen_params_t params;
+        memset(&params, '\0', sizeof(params));
+        params.public_exponent = RSA_EXPONENT;
+        params.modulus_size = RSA_KEY_SIZE;
+
+        if (keymaster0_dev->generate_keypair(keymaster0_dev, TYPE_RSA, &params,
+                                             &key, &key_size)) {
+            SLOGE("Failed to generate keypair");
+            rc = -1;
+            goto out;
+        }
+    } else {
+        SLOGE("Cryptfs bug: keymaster_init succeeded but didn't initialize a device");
         rc = -1;
         goto out;
     }
@@ -191,7 +260,10 @@
     ftr->keymaster_blob_size = key_size;
 
 out:
-    keymaster0_close(keymaster_dev);
+    if (keymaster0_dev)
+        keymaster0_close(keymaster0_dev);
+    if (keymaster1_dev)
+        keymaster1_close(keymaster1_dev);
     free(key);
     return rc;
 }
@@ -204,20 +276,14 @@
                                  size_t *signature_size)
 {
     int rc = 0;
-    keymaster0_device_t *keymaster_dev = 0;
-    if (keymaster_init(&keymaster_dev)) {
+    keymaster0_device_t *keymaster0_dev = 0;
+    keymaster1_device_t *keymaster1_dev = 0;
+    if (keymaster_init(&keymaster0_dev, &keymaster1_dev)) {
         SLOGE("Failed to init keymaster");
-        return -1;
+        rc = -1;
+        goto out;
     }
 
-    /* We currently set the digest type to DIGEST_NONE because it's the
-     * only supported value for keymaster. A similar issue exists with
-     * PADDING_NONE. Long term both of these should likely change.
-     */
-    keymaster_rsa_sign_params_t params;
-    params.digest_type = DIGEST_NONE;
-    params.padding_type = PADDING_NONE;
-
     unsigned char to_sign[RSA_KEY_SIZE_BYTES];
     size_t to_sign_size = sizeof(to_sign);
     memset(to_sign, 0, RSA_KEY_SIZE_BYTES);
@@ -237,49 +303,103 @@
     //    necessary, but is necessary to ensure consistency in
     //    implementations.
     switch (ftr->kdf_type) {
-        case KDF_SCRYPT_KEYMASTER_UNPADDED:
-            // This is broken: It produces a message which is shorter than
-            // the public modulus, failing criterion 2.
-            memcpy(to_sign, object, object_size);
-            to_sign_size = object_size;
-            SLOGI("Signing unpadded object");
-            break;
-        case KDF_SCRYPT_KEYMASTER_BADLY_PADDED:
-            // This is broken: Since the value of object is uniformly
-            // distributed, it produces a message that is larger than the
-            // public modulus with probability 0.25.
-            memcpy(to_sign, object, min(RSA_KEY_SIZE_BYTES, object_size));
-            SLOGI("Signing end-padded object");
-            break;
         case KDF_SCRYPT_KEYMASTER:
             // This ensures the most significant byte of the signed message
             // is zero.  We could have zero-padded to the left instead, but
             // this approach is slightly more robust against changes in
             // object size.  However, it's still broken (but not unusably
-            // so) because we really should be using a proper RSA padding
-            // function, such as OAEP.
-            //
-            // TODO(paullawrence): When keymaster 0.4 is available, change
-            // this to use the padding options it provides.
+            // so) because we really should be using a proper deterministic
+            // RSA padding function, such as PKCS1.
             memcpy(to_sign + 1, object, min(RSA_KEY_SIZE_BYTES - 1, object_size));
             SLOGI("Signing safely-padded object");
             break;
         default:
             SLOGE("Unknown KDF type %d", ftr->kdf_type);
-            return -1;
+            rc = -1;
+            goto out;
     }
 
-    rc = keymaster_dev->sign_data(keymaster_dev,
-                                  &params,
-                                  ftr->keymaster_blob,
-                                  ftr->keymaster_blob_size,
-                                  to_sign,
-                                  to_sign_size,
-                                  signature,
-                                  signature_size);
+    if (keymaster0_dev) {
+        keymaster_rsa_sign_params_t params;
+        params.digest_type = DIGEST_NONE;
+        params.padding_type = PADDING_NONE;
 
-    keymaster0_close(keymaster_dev);
-    return rc;
+        rc = keymaster0_dev->sign_data(keymaster0_dev,
+                                      &params,
+                                      ftr->keymaster_blob,
+                                      ftr->keymaster_blob_size,
+                                      to_sign,
+                                      to_sign_size,
+                                      signature,
+                                      signature_size);
+        goto out;
+    } else if (keymaster1_dev) {
+        keymaster_key_blob_t key = { ftr->keymaster_blob, ftr->keymaster_blob_size };
+        keymaster_key_param_t params[] = {
+            keymaster_param_enum(KM_TAG_PADDING, KM_PAD_NONE),
+            keymaster_param_enum(KM_TAG_DIGEST, KM_DIGEST_NONE),
+        };
+        keymaster_key_param_set_t param_set = { params, sizeof(params)/sizeof(*params) };
+        keymaster_operation_handle_t op_handle;
+        keymaster_error_t error = keymaster1_dev->begin(keymaster1_dev, KM_PURPOSE_SIGN, &key,
+                                                        &param_set, NULL /* out_params */,
+                                                        &op_handle);
+        if (error == KM_ERROR_KEY_RATE_LIMIT_EXCEEDED) {
+            // Key usage has been rate-limited.  Wait a bit and try again.
+            sleep(KEYMASTER_CRYPTFS_RATE_LIMIT);
+            error = keymaster1_dev->begin(keymaster1_dev, KM_PURPOSE_SIGN, &key,
+                                          &param_set, NULL /* out_params */,
+                                          &op_handle);
+        }
+        if (error != KM_ERROR_OK) {
+            SLOGE("Error starting keymaster signature transaction: %d", error);
+            rc = -1;
+            goto out;
+        }
+
+        keymaster_blob_t input = { to_sign, to_sign_size };
+        size_t input_consumed;
+        error = keymaster1_dev->update(keymaster1_dev, op_handle, NULL /* in_params */,
+                                       &input, &input_consumed, NULL /* out_params */,
+                                       NULL /* output */);
+        if (error != KM_ERROR_OK) {
+            SLOGE("Error sending data to keymaster signature transaction: %d", error);
+            rc = -1;
+            goto out;
+        }
+        if (input_consumed != to_sign_size) {
+            // This should never happen.  If it does, it's a bug in the keymaster implementation.
+            SLOGE("Keymaster update() did not consume all data.");
+            keymaster1_dev->abort(keymaster1_dev, op_handle);
+            rc = -1;
+            goto out;
+        }
+
+        keymaster_blob_t tmp_sig;
+        error = keymaster1_dev->finish(keymaster1_dev, op_handle, NULL /* in_params */,
+                                       NULL /* verify signature */, NULL /* out_params */,
+                                       &tmp_sig);
+        if (error != KM_ERROR_OK) {
+            SLOGE("Error finishing keymaster signature transaction: %d", error);
+            rc = -1;
+            goto out;
+        }
+
+        *signature = (uint8_t*)tmp_sig.data;
+        *signature_size = tmp_sig.data_length;
+    } else {
+        SLOGE("Cryptfs bug: keymaster_init succeded but didn't initialize a device.");
+        rc = -1;
+        goto out;
+    }
+
+    out:
+        if (keymaster1_dev)
+            keymaster1_close(keymaster1_dev);
+        if (keymaster0_dev)
+            keymaster0_close(keymaster0_dev);
+
+        return rc;
 }
 
 /* Store password when userdata is successfully decrypted and mounted.
@@ -395,7 +515,7 @@
     struct ext4_super_block sb;
     off64_t len;
 
-    if ((fd = open(dev, O_RDONLY)) < 0) {
+    if ((fd = open(dev, O_RDONLY|O_CLOEXEC)) < 0) {
         SLOGE("Cannot open device to get filesystem size ");
         return 0;
     }
@@ -438,7 +558,7 @@
     fs_mgr_get_crypt_info(fstab, key_loc, real_blkdev, sizeof(key_loc));
 
     if (!strcmp(key_loc, KEY_IN_FOOTER)) {
-      if ( (fd = open(real_blkdev, O_RDWR)) < 0) {
+      if ( (fd = open(real_blkdev, O_RDWR|O_CLOEXEC)) < 0) {
         SLOGE("Cannot open real block device %s\n", real_blkdev);
         return -1;
       }
@@ -500,7 +620,7 @@
     SLOGE("Unexpected value for crypto key location\n");
     return -1;
   }
-  if ( (fd = open(fname, O_RDWR | O_CREAT, 0600)) < 0) {
+  if ( (fd = open(fname, O_RDWR | O_CREAT|O_CLOEXEC, 0600)) < 0) {
     SLOGE("Cannot open footer file %s for put\n", fname);
     return -1;
   }
@@ -638,7 +758,7 @@
     SLOGE("Unexpected value for crypto key location\n");
     return -1;
   }
-  if ( (fd = open(fname, O_RDWR)) < 0) {
+  if ( (fd = open(fname, O_RDWR|O_CLOEXEC)) < 0) {
     SLOGE("Cannot open footer file %s for get\n", fname);
     return -1;
   }
@@ -763,7 +883,7 @@
         return -1;
     }
 
-    fd = open(fname, O_RDONLY);
+    fd = open(fname, O_RDONLY|O_CLOEXEC);
     if (fd < 0) {
         SLOGE("Cannot open %s metadata file", fname);
         return -1;
@@ -844,7 +964,7 @@
         return -1;
     }
 
-    fd = open(fname, O_RDWR);
+    fd = open(fname, O_RDWR|O_CLOEXEC);
     if (fd < 0) {
         SLOGE("Cannot open %s metadata file", fname);
         return -1;
@@ -914,76 +1034,31 @@
     return -1;
 }
 
-static int hexdigit (char c)
-{
-    if (c >= '0' && c <= '9') return c - '0';
-    c = tolower(c);
-    if (c >= 'a' && c <= 'f') return c - 'a' + 10;
-    return -1;
-}
-
-static unsigned char* convert_hex_ascii_to_key(const char* master_key_ascii,
-                                               unsigned int* out_keysize)
-{
-    unsigned int i;
-    *out_keysize = 0;
-
-    size_t size = strlen (master_key_ascii);
-    if (size % 2) {
-        SLOGE("Trying to convert ascii string of odd length");
-        return NULL;
-    }
-
-    unsigned char* master_key = (unsigned char*) malloc(size / 2);
-    if (master_key == 0) {
-        SLOGE("Cannot allocate");
-        return NULL;
-    }
-
-    for (i = 0; i < size; i += 2) {
-        int high_nibble = hexdigit (master_key_ascii[i]);
-        int low_nibble = hexdigit (master_key_ascii[i + 1]);
-
-        if(high_nibble < 0 || low_nibble < 0) {
-            SLOGE("Invalid hex string");
-            free (master_key);
-            return NULL;
-        }
-
-        master_key[*out_keysize] = high_nibble * 16 + low_nibble;
-        (*out_keysize)++;
-    }
-
-    return master_key;
-}
-
 /* Convert a binary key of specified length into an ascii hex string equivalent,
  * without the leading 0x and with null termination
  */
-static void convert_key_to_hex_ascii(unsigned char *master_key, unsigned int keysize,
-                              char *master_key_ascii)
-{
-  unsigned int i, a;
-  unsigned char nibble;
+static void convert_key_to_hex_ascii(const unsigned char *master_key,
+                                     unsigned int keysize, char *master_key_ascii) {
+    unsigned int i, a;
+    unsigned char nibble;
 
-  for (i=0, a=0; i<keysize; i++, a+=2) {
-    /* For each byte, write out two ascii hex digits */
-    nibble = (master_key[i] >> 4) & 0xf;
-    master_key_ascii[a] = nibble + (nibble > 9 ? 0x37 : 0x30);
+    for (i=0, a=0; i<keysize; i++, a+=2) {
+        /* For each byte, write out two ascii hex digits */
+        nibble = (master_key[i] >> 4) & 0xf;
+        master_key_ascii[a] = nibble + (nibble > 9 ? 0x37 : 0x30);
 
-    nibble = master_key[i] & 0xf;
-    master_key_ascii[a+1] = nibble + (nibble > 9 ? 0x37 : 0x30);
-  }
+        nibble = master_key[i] & 0xf;
+        master_key_ascii[a+1] = nibble + (nibble > 9 ? 0x37 : 0x30);
+    }
 
-  /* Add the null termination */
-  master_key_ascii[a] = '\0';
+    /* Add the null termination */
+    master_key_ascii[a] = '\0';
 
 }
 
-static int load_crypto_mapping_table(struct crypt_mnt_ftr *crypt_ftr, unsigned char *master_key,
-                                     char *real_blk_name, const char *name, int fd,
-                                     char *extra_params)
-{
+static int load_crypto_mapping_table(struct crypt_mnt_ftr *crypt_ftr,
+        const unsigned char *master_key, const char *real_blk_name,
+        const char *name, int fd, const char *extra_params) {
   _Alignas(struct dm_ioctl) char buffer[DM_CRYPT_BUF_SIZE];
   struct dm_ioctl *io;
   struct dm_target_spec *tgt;
@@ -1072,9 +1147,9 @@
     return -1;
 }
 
-static int create_crypto_blk_dev(struct crypt_mnt_ftr *crypt_ftr, unsigned char *master_key,
-                                    char *real_blk_name, char *crypto_blk_name, const char *name)
-{
+static int create_crypto_blk_dev(struct crypt_mnt_ftr *crypt_ftr,
+        const unsigned char *master_key, const char *real_blk_name,
+        char *crypto_blk_name, const char *name) {
   char buffer[DM_CRYPT_BUF_SIZE];
   struct dm_ioctl *io;
   unsigned int minor;
@@ -1084,7 +1159,7 @@
   char *extra_params;
   int load_count;
 
-  if ((fd = open("/dev/device-mapper", O_RDWR)) < 0 ) {
+  if ((fd = open("/dev/device-mapper", O_RDWR|O_CLOEXEC)) < 0 ) {
     SLOGE("Cannot open device-mapper\n");
     goto errout;
   }
@@ -1149,7 +1224,7 @@
   struct dm_ioctl *io;
   int retval = -1;
 
-  if ((fd = open("/dev/device-mapper", O_RDWR)) < 0 ) {
+  if ((fd = open("/dev/device-mapper", O_RDWR|O_CLOEXEC)) < 0 ) {
     SLOGE("Cannot open device-mapper\n");
     goto errout;
   }
@@ -1178,14 +1253,10 @@
     SLOGI("Using pbkdf2 for cryptfs KDF");
 
     /* Turn the password into a key and IV that can decrypt the master key */
-    unsigned int keysize;
-    char* master_key = (char*)convert_hex_ascii_to_key(passwd, &keysize);
-    if (!master_key) return -1;
-    PKCS5_PBKDF2_HMAC_SHA1(master_key, keysize, salt, SALT_LEN,
+    PKCS5_PBKDF2_HMAC_SHA1(passwd, strlen(passwd),
+                           salt, SALT_LEN,
                            HASH_COUNT, KEY_LEN_BYTES+IV_LEN_BYTES, ikey);
 
-    memset(master_key, 0, keysize);
-    free (master_key);
     return 0;
 }
 
@@ -1202,14 +1273,11 @@
 
     /* Turn the password into a key and IV that can decrypt the master key */
     unsigned int keysize;
-    unsigned char* master_key = convert_hex_ascii_to_key(passwd, &keysize);
-    if (!master_key) return -1;
-    crypto_scrypt(master_key, keysize, salt, SALT_LEN, N, r, p, ikey,
-            KEY_LEN_BYTES + IV_LEN_BYTES);
+    crypto_scrypt((const uint8_t*)passwd, strlen(passwd),
+                  salt, SALT_LEN, N, r, p, ikey,
+                  KEY_LEN_BYTES + IV_LEN_BYTES);
 
-    memset(master_key, 0, keysize);
-    free (master_key);
-    return 0;
+   return 0;
 }
 
 static int scrypt_keymaster(const char *passwd, const unsigned char *salt,
@@ -1218,7 +1286,6 @@
     SLOGI("Using scrypt with keymaster for cryptfs KDF");
 
     int rc;
-    unsigned int key_size;
     size_t signature_size;
     unsigned char* signature;
     struct crypt_mnt_ftr *ftr = (struct crypt_mnt_ftr *) params;
@@ -1227,16 +1294,9 @@
     int r = 1 << ftr->r_factor;
     int p = 1 << ftr->p_factor;
 
-    unsigned char* master_key = convert_hex_ascii_to_key(passwd, &key_size);
-    if (!master_key) {
-        SLOGE("Failed to convert passwd from hex");
-        return -1;
-    }
-
-    rc = crypto_scrypt(master_key, key_size, salt, SALT_LEN,
-                       N, r, p, ikey, KEY_LEN_BYTES + IV_LEN_BYTES);
-    memset(master_key, 0, key_size);
-    free(master_key);
+    rc = crypto_scrypt((const uint8_t*)passwd, strlen(passwd),
+                       salt, SALT_LEN, N, r, p, ikey,
+                       KEY_LEN_BYTES + IV_LEN_BYTES);
 
     if (rc) {
         SLOGE("scrypt failed");
@@ -1275,8 +1335,6 @@
     get_device_scrypt_params(crypt_ftr);
 
     switch (crypt_ftr->kdf_type) {
-    case KDF_SCRYPT_KEYMASTER_UNPADDED:
-    case KDF_SCRYPT_KEYMASTER_BADLY_PADDED:
     case KDF_SCRYPT_KEYMASTER:
         if (keymaster_create_key(crypt_ftr)) {
             SLOGE("keymaster_create_key failed");
@@ -1397,9 +1455,7 @@
 
 static void get_kdf_func(struct crypt_mnt_ftr *ftr, kdf_func *kdf, void** kdf_params)
 {
-    if (ftr->kdf_type == KDF_SCRYPT_KEYMASTER_UNPADDED ||
-        ftr->kdf_type == KDF_SCRYPT_KEYMASTER_BADLY_PADDED ||
-        ftr->kdf_type == KDF_SCRYPT_KEYMASTER) {
+    if (ftr->kdf_type == KDF_SCRYPT_KEYMASTER) {
         *kdf = scrypt_keymaster;
         *kdf_params = ftr;
     } else if (ftr->kdf_type == KDF_SCRYPT) {
@@ -1437,7 +1493,7 @@
     unsigned char key_buf[KEY_LEN_BYTES];
 
     /* Get some random bits for a key */
-    fd = open("/dev/urandom", O_RDONLY);
+    fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC);
     read(fd, key_buf, sizeof(key_buf));
     read(fd, salt, SALT_LEN);
     close(fd);
@@ -1470,10 +1526,10 @@
         if (kill) {
             if (i == (WAIT_UNMOUNT_COUNT - 3)) {
                 SLOGW("sending SIGHUP to processes with open files\n");
-                vold_killProcessesWithOpenFiles(mountpoint, 1);
+                vold_killProcessesWithOpenFiles(mountpoint, SIGTERM);
             } else if (i == (WAIT_UNMOUNT_COUNT - 2)) {
                 SLOGW("sending SIGKILL to processes with open files\n");
-                vold_killProcessesWithOpenFiles(mountpoint, 2);
+                vold_killProcessesWithOpenFiles(mountpoint, SIGKILL);
             }
         }
 
@@ -1492,7 +1548,7 @@
     return rc;
 }
 
-#define DATA_PREP_TIMEOUT 200
+#define DATA_PREP_TIMEOUT 1000
 static int prep_data_fs(void)
 {
     int i;
@@ -1510,7 +1566,7 @@
         if (*p == '1') {
             break;
         } else {
-            usleep(250000);
+            usleep(50000);
         }
     }
     if (i == DATA_PREP_TIMEOUT) {
@@ -1904,36 +1960,18 @@
   return rc;
 }
 
-/* Called by vold when it wants to undo the crypto mapping of a volume it
- * manages.  This is usually in response to a factory reset, when we want
- * to undo the crypto mapping so the volume is formatted in the clear.
- */
-int cryptfs_revert_volume(const char *label)
-{
-    return delete_crypto_blk_dev((char *)label);
-}
-
 /*
- * Called by vold when it's asked to mount an encrypted, nonremovable volume.
- * Setup a dm-crypt mapping, use the saved master key from
- * setting up the /data mapping, and return the new device path.
+ * Called by vold when it's asked to mount an encrypted external
+ * storage volume. The incoming partition has no crypto header/footer,
+ * as any metadata is been stored in a separate, small partition.
+ *
+ * out_crypto_blkdev must be MAXPATHLEN.
  */
-int cryptfs_setup_volume(const char *label, int major, int minor,
-                         char *crypto_sys_path, unsigned int max_path,
-                         int *new_major, int *new_minor)
-{
-    char real_blkdev[MAXPATHLEN], crypto_blkdev[MAXPATHLEN];
-    struct crypt_mnt_ftr sd_crypt_ftr;
-    struct stat statbuf;
-
-    sprintf(real_blkdev, "/dev/block/vold/%d:%d", major, minor);
-
-    get_crypt_ftr_and_key(&sd_crypt_ftr);
-
-    /* Update the fs_size field to be the size of the volume */
-    int fd = open(real_blkdev, O_RDONLY);
+int cryptfs_setup_ext_volume(const char* label, const char* real_blkdev,
+        const unsigned char* key, int keysize, char* out_crypto_blkdev) {
+    int fd = open(real_blkdev, O_RDONLY|O_CLOEXEC);
     if (fd == -1) {
-        SLOGE("Cannot open volume %s\n", real_blkdev);
+        SLOGE("Failed to open %s: %s", real_blkdev, strerror(errno));
         return -1;
     }
 
@@ -1942,25 +1980,26 @@
     close(fd);
 
     if (nr_sec == 0) {
-        SLOGE("Cannot get size of volume %s\n", real_blkdev);
+        SLOGE("Failed to get size of %s: %s", real_blkdev, strerror(errno));
         return -1;
     }
 
-    sd_crypt_ftr.fs_size = nr_sec;
-    create_crypto_blk_dev(&sd_crypt_ftr, saved_master_key, real_blkdev, 
-                          crypto_blkdev, label);
+    struct crypt_mnt_ftr ext_crypt_ftr;
+    memset(&ext_crypt_ftr, 0, sizeof(ext_crypt_ftr));
+    ext_crypt_ftr.fs_size = nr_sec;
+    ext_crypt_ftr.keysize = keysize;
+    strcpy((char*) ext_crypt_ftr.crypto_type_name, "aes-cbc-essiv:sha256");
 
-    if (stat(crypto_blkdev, &statbuf) < 0) {
-        SLOGE("Error get stat for crypto_blkdev %s. err=%d(%s)\n",
-              crypto_blkdev, errno, strerror(errno));
-    }
-    *new_major = MAJOR(statbuf.st_rdev);
-    *new_minor = MINOR(statbuf.st_rdev);
+    return create_crypto_blk_dev(&ext_crypt_ftr, key, real_blkdev,
+            out_crypto_blkdev, label);
+}
 
-    /* Create path to sys entry for this block device */
-    snprintf(crypto_sys_path, max_path, "/devices/virtual/block/%s", strrchr(crypto_blkdev, '/')+1);
-
-    return 0;
+/*
+ * Called by vold when it's asked to unmount an encrypted external
+ * storage volume.
+ */
+int cryptfs_revert_ext_volume(const char* label) {
+    return delete_crypto_blk_dev((char*) label);
 }
 
 int cryptfs_crypto_complete(void)
@@ -1986,68 +2025,6 @@
     return 0;
 }
 
-/*
- * TODO - transition patterns to new format in calling code
- *        and remove this vile hack, and the use of hex in
- *        the password passing code.
- *
- * Patterns are passed in zero based (i.e. the top left dot
- * is represented by zero, the top middle one etc), but we want
- * to store them '1' based.
- * This is to allow us to migrate the calling code to use this
- * convention. It also solves a nasty problem whereby scrypt ignores
- * trailing zeros, so patterns ending at the top left could be
- * truncated, and similarly, you could add the top left to any
- * pattern and still match.
- * adjust_passwd is a hack function that returns the alternate representation
- * if the password appears to be a pattern (hex numbers all less than 09)
- * If it succeeds we need to try both, and in particular try the alternate
- * first. If the original matches, then we need to update the footer
- * with the alternate.
- * All code that accepts passwords must adjust them first. Since
- * cryptfs_check_passwd is always the first function called after a migration
- * (and indeed on any boot) we only need to do the double try in this
- * function.
- */
-char* adjust_passwd(const char* passwd)
-{
-    size_t index, length;
-
-    if (!passwd) {
-        return 0;
-    }
-
-    // Check even length. Hex encoded passwords are always
-    // an even length, since each character encodes to two characters.
-    length = strlen(passwd);
-    if (length % 2) {
-        SLOGW("Password not correctly hex encoded.");
-        return 0;
-    }
-
-    // Check password is old-style pattern - a collection of hex
-    // encoded bytes less than 9 (00 through 08)
-    for (index = 0; index < length; index +=2) {
-        if (passwd[index] != '0'
-            || passwd[index + 1] < '0' || passwd[index + 1] > '8') {
-            return 0;
-        }
-    }
-
-    // Allocate room for adjusted passwd and null terminate
-    char* adjusted = malloc(length + 1);
-    adjusted[length] = 0;
-
-    // Add 0x31 ('1') to each character
-    for (index = 0; index < length; index += 2) {
-        // output is 31 through 39 so set first byte to three, second to src + 1
-        adjusted[index] = '3';
-        adjusted[index + 1] = passwd[index + 1] + 1;
-    }
-
-    return adjusted;
-}
-
 int cryptfs_check_passwd(char *passwd)
 {
     SLOGI("cryptfs_check_passwd");
@@ -2062,31 +2039,8 @@
     if (rc)
         return rc;
 
-    char* adjusted_passwd = adjust_passwd(passwd);
-    if (adjusted_passwd) {
-        int failed_decrypt_count = crypt_ftr.failed_decrypt_count;
-        rc = test_mount_encrypted_fs(&crypt_ftr, adjusted_passwd,
-                                     DATA_MNT_POINT, "userdata");
-
-        // Maybe the original one still works?
-        if (rc) {
-            // Don't double count this failure
-            crypt_ftr.failed_decrypt_count = failed_decrypt_count;
-            rc = test_mount_encrypted_fs(&crypt_ftr, passwd,
-                                         DATA_MNT_POINT, "userdata");
-            if (!rc) {
-                // cryptfs_changepw also adjusts so pass original
-                // Note that adjust_passwd only recognises patterns
-                // so we can safely use CRYPT_TYPE_PATTERN
-                SLOGI("Updating pattern to new format");
-                cryptfs_changepw(CRYPT_TYPE_PATTERN, passwd);
-            }
-        }
-        free(adjusted_passwd);
-    } else {
-        rc = test_mount_encrypted_fs(&crypt_ftr, passwd,
-                                     DATA_MNT_POINT, "userdata");
-    }
+    rc = test_mount_encrypted_fs(&crypt_ftr, passwd,
+                                 DATA_MNT_POINT, "userdata");
 
     if (rc == 0 && crypt_ftr.crypt_type != CRYPT_TYPE_DEFAULT) {
         cryptfs_clear_password();
@@ -2132,11 +2086,6 @@
         /* If the device has no password, then just say the password is valid */
         rc = 0;
     } else {
-        char* adjusted_passwd = adjust_passwd(passwd);
-        if (adjusted_passwd) {
-            passwd = adjusted_passwd;
-        }
-
         decrypt_master_key(passwd, decrypted_master_key, &crypt_ftr, 0, 0);
         if (!memcmp(decrypted_master_key, saved_master_key, crypt_ftr.keysize)) {
             /* They match, the password is correct */
@@ -2146,8 +2095,6 @@
             sleep(1);
             rc = 1;
         }
-
-        free(adjusted_passwd);
     }
 
     return rc;
@@ -2491,14 +2438,14 @@
     data.real_blkdev = real_blkdev;
     data.crypto_blkdev = crypto_blkdev;
 
-    if ( (data.realfd = open(real_blkdev, O_RDWR)) < 0) {
+    if ( (data.realfd = open(real_blkdev, O_RDWR|O_CLOEXEC)) < 0) {
         SLOGE("Error opening real_blkdev %s for inplace encrypt. err=%d(%s)\n",
               real_blkdev, errno, strerror(errno));
         rc = -1;
         goto errout;
     }
 
-    if ( (data.cryptofd = open(crypto_blkdev, O_WRONLY)) < 0) {
+    if ( (data.cryptofd = open(crypto_blkdev, O_WRONLY|O_CLOEXEC)) < 0) {
         SLOGE("Error opening crypto_blkdev %s for ext4 inplace encrypt. err=%d(%s)\n",
               crypto_blkdev, errno, strerror(errno));
         rc = ENABLE_INPLACE_ERR_DEV;
@@ -2622,12 +2569,12 @@
     data.crypto_blkdev = crypto_blkdev;
     data.realfd = -1;
     data.cryptofd = -1;
-    if ( (data.realfd = open64(real_blkdev, O_RDWR)) < 0) {
+    if ( (data.realfd = open64(real_blkdev, O_RDWR|O_CLOEXEC)) < 0) {
         SLOGE("Error opening real_blkdev %s for f2fs inplace encrypt\n",
               real_blkdev);
         goto errout;
     }
-    if ( (data.cryptofd = open64(crypto_blkdev, O_WRONLY)) < 0) {
+    if ( (data.cryptofd = open64(crypto_blkdev, O_WRONLY|O_CLOEXEC)) < 0) {
         SLOGE("Error opening crypto_blkdev %s for f2fs inplace encrypt. err=%d(%s)\n",
               crypto_blkdev, errno, strerror(errno));
         rc = ENABLE_INPLACE_ERR_DEV;
@@ -2694,12 +2641,12 @@
     off64_t one_pct, cur_pct, new_pct;
     off64_t blocks_already_done, tot_numblocks;
 
-    if ( (realfd = open(real_blkdev, O_RDONLY)) < 0) { 
+    if ( (realfd = open(real_blkdev, O_RDONLY|O_CLOEXEC)) < 0) {
         SLOGE("Error opening real_blkdev %s for inplace encrypt\n", real_blkdev);
         return ENABLE_INPLACE_ERR_OTHER;
     }
 
-    if ( (cryptofd = open(crypto_blkdev, O_WRONLY)) < 0) { 
+    if ( (cryptofd = open(crypto_blkdev, O_WRONLY|O_CLOEXEC)) < 0) {
         SLOGE("Error opening crypto_blkdev %s for inplace encrypt. err=%d(%s)\n",
               crypto_blkdev, errno, strerror(errno));
         close(realfd);
@@ -2855,15 +2802,9 @@
 
 #define FRAMEWORK_BOOT_WAIT 60
 
-static inline int should_encrypt(struct volume_info *volume)
-{
-    return (volume->flags & (VOL_ENCRYPTABLE | VOL_NONREMOVABLE)) ==
-            (VOL_ENCRYPTABLE | VOL_NONREMOVABLE);
-}
-
 static int cryptfs_SHA256_fileblock(const char* filename, __le8* buf)
 {
-    int fd = open(filename, O_RDONLY);
+    int fd = open(filename, O_RDONLY|O_CLOEXEC);
     if (fd == -1) {
         SLOGE("Error opening file %s", filename);
         return -1;
@@ -2963,10 +2904,7 @@
     char encrypted_state[PROPERTY_VALUE_MAX];
     char lockid[32] = { 0 };
     char key_loc[PROPERTY_VALUE_MAX];
-    char fuse_sdcard[PROPERTY_VALUE_MAX];
-    char *sd_mnt_point;
     int num_vols;
-    struct volume_info *vol_list = 0;
     off64_t previously_encrypted_upto = 0;
 
     if (!strcmp(howarg, "wipe")) {
@@ -3006,7 +2944,7 @@
     fs_mgr_get_crypt_info(fstab, 0, real_blkdev, sizeof(real_blkdev));
 
     /* Get the size of the real block device */
-    int fd = open(real_blkdev, O_RDONLY);
+    int fd = open(real_blkdev, O_RDONLY|O_CLOEXEC);
     if (fd == -1) {
         SLOGE("Cannot open block device %s\n", real_blkdev);
         goto error_unencrypted;
@@ -3041,55 +2979,15 @@
     snprintf(lockid, sizeof(lockid), "enablecrypto%d", (int) getpid());
     acquire_wake_lock(PARTIAL_WAKE_LOCK, lockid);
 
-    /* Get the sdcard mount point */
-    sd_mnt_point = getenv("EMULATED_STORAGE_SOURCE");
-    if (!sd_mnt_point) {
-       sd_mnt_point = getenv("EXTERNAL_STORAGE");
-    }
-    if (!sd_mnt_point) {
-        sd_mnt_point = "/mnt/sdcard";
-    }
-
-    /* TODO
-     * Currently do not have test devices with multiple encryptable volumes.
-     * When we acquire some, re-add support.
-     */
-    num_vols=vold_getNumDirectVolumes();
-    vol_list = malloc(sizeof(struct volume_info) * num_vols);
-    vold_getDirectVolumeList(vol_list);
-
-    for (i=0; i<num_vols; i++) {
-        if (should_encrypt(&vol_list[i])) {
-            SLOGE("Cannot encrypt if there are multiple encryptable volumes"
-                  "%s\n", vol_list[i].label);
-            goto error_unencrypted;
-        }
-    }
-
     /* The init files are setup to stop the class main and late start when
      * vold sets trigger_shutdown_framework.
      */
     property_set("vold.decrypt", "trigger_shutdown_framework");
     SLOGD("Just asked init to shut down class main\n");
 
-    if (vold_unmountAllAsecs()) {
-        /* Just report the error.  If any are left mounted,
-         * umounting /data below will fail and handle the error.
-         */
-        SLOGE("Error unmounting internal asecs");
-    }
-
-    property_get("ro.crypto.fuse_sdcard", fuse_sdcard, "");
-    if (!strcmp(fuse_sdcard, "true")) {
-        /* This is a device using the fuse layer to emulate the sdcard semantics
-         * on top of the userdata partition.  vold does not manage it, it is managed
-         * by the sdcard service.  The sdcard service was killed by the property trigger
-         * above, so just unmount it now.  We must do this _AFTER_ killing the framework,
-         * unlike the case for vold managed devices above.
-         */
-        if (wait_and_unmount(sd_mnt_point, false)) {
-            goto error_shutting_down;
-        }
+    /* Ask vold to unmount all devices that it manages */
+    if (vold_unmountAll()) {
+        SLOGE("Failed to unmount all vold managed devices");
     }
 
     /* Now unmount the /data partition. */
@@ -3237,8 +3135,6 @@
     /* Undo the dm-crypt mapping whether we succeed or not */
     delete_crypto_blk_dev("userdata");
 
-    free(vol_list);
-
     if (! rc) {
         /* Success */
         crypt_ftr.flags &= ~CRYPT_INCONSISTENT_STATE;
@@ -3279,7 +3175,7 @@
             /* wipe data if encryption failed */
             SLOGE("encryption failed - rebooting into recovery to wipe data\n");
             mkdir("/cache/recovery", 0700);
-            int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600);
+            int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0600);
             if (fd >= 0) {
                 write(fd, "--wipe_data\n", strlen("--wipe_data\n") + 1);
                 write(fd, "--reason=cryptfs_enable_internal\n", strlen("--reason=cryptfs_enable_internal\n") + 1);
@@ -3305,7 +3201,6 @@
     return rc;
 
 error_unencrypted:
-    free(vol_list);
     property_set("vold.encrypt_progress", "error_not_encrypted");
     if (lockid[0]) {
         release_wake_lock(lockid);
@@ -3322,7 +3217,6 @@
 
     /* shouldn't get here */
     property_set("vold.encrypt_progress", "error_shutting_down");
-    free(vol_list);
     if (lockid[0]) {
         release_wake_lock(lockid);
     }
@@ -3331,15 +3225,7 @@
 
 int cryptfs_enable(char *howarg, int type, char *passwd, int allow_reboot)
 {
-    char* adjusted_passwd = adjust_passwd(passwd);
-    if (adjusted_passwd) {
-        passwd = adjusted_passwd;
-    }
-
-    int rc = cryptfs_enable_internal(howarg, type, passwd, allow_reboot);
-
-    free(adjusted_passwd);
-    return rc;
+    return cryptfs_enable_internal(howarg, type, passwd, allow_reboot);
 }
 
 int cryptfs_enable_default(char *howarg, int allow_reboot)
@@ -3351,10 +3237,13 @@
 int cryptfs_changepw(int crypt_type, const char *newpw)
 {
     if (e4crypt_crypto_complete(DATA_MNT_POINT) == 0) {
-        return e4crypt_change_password(DATA_MNT_POINT, crypt_type, newpw);
+        return e4crypt_change_password(DATA_MNT_POINT, crypt_type,
+                    crypt_type == CRYPT_TYPE_DEFAULT ? DEFAULT_PASSWORD
+                                                     : newpw);
     }
 
     struct crypt_mnt_ftr crypt_ftr;
+    int rc;
 
     /* This is only allowed after we've successfully decrypted the master key */
     if (!master_key_saved) {
@@ -3375,23 +3264,19 @@
 
     crypt_ftr.crypt_type = crypt_type;
 
-    char* adjusted_passwd = adjust_passwd(newpw);
-    if (adjusted_passwd) {
-        newpw = adjusted_passwd;
-    }
-
-    encrypt_master_key(crypt_type == CRYPT_TYPE_DEFAULT ? DEFAULT_PASSWORD
+    rc = encrypt_master_key(crypt_type == CRYPT_TYPE_DEFAULT ? DEFAULT_PASSWORD
                                                         : newpw,
                        crypt_ftr.salt,
                        saved_master_key,
                        crypt_ftr.master_key,
                        &crypt_ftr);
-
+    if (rc) {
+        SLOGE("Encrypt master key failed: %d", rc);
+        return -1;
+    }
     /* save the key */
     put_crypt_ftr_and_key(&crypt_ftr);
 
-    free(adjusted_passwd);
-
 #ifdef CONFIG_HW_DISK_ENCRYPTION
     if (!strcmp((char *)crypt_ftr.crypto_type_name, "aes-xts")) {
         if (crypt_type == CRYPT_TYPE_DEFAULT) {
diff --git a/cryptfs.h b/cryptfs.h
index 7f082cc..94684e2 100644
--- a/cryptfs.h
+++ b/cryptfs.h
@@ -72,10 +72,7 @@
 /* Key Derivation Function algorithms */
 #define KDF_PBKDF2 1
 #define KDF_SCRYPT 2
-/* TODO(paullawrence): Remove KDF_SCRYPT_KEYMASTER_UNPADDED and KDF_SCRYPT_KEYMASTER_BADLY_PADDED
- * when it is safe to do so. */
-#define KDF_SCRYPT_KEYMASTER_UNPADDED 3
-#define KDF_SCRYPT_KEYMASTER_BADLY_PADDED 4
+/* Algorithms 3 & 4 deprecated before shipping outside of google, so removed */
 #define KDF_SCRYPT_KEYMASTER 5
 
 /* Maximum allowed keymaster blob size. */
@@ -176,20 +173,6 @@
   struct crypt_persist_entry persist_entry[0];
 };
 
-struct volume_info {
-   unsigned int size;
-   unsigned int flags;
-   struct crypt_mnt_ftr crypt_ftr;
-   char mnt_point[256];
-   char blk_dev[256];
-   char crypto_blkdev[256];
-   char label[256];
-};
-#define VOL_NONREMOVABLE   0x1
-#define VOL_ENCRYPTABLE    0x2
-#define VOL_PRIMARY        0x4
-#define VOL_PROVIDES_ASEC  0x8
-
 #define DATA_MNT_POINT "/data"
 
 /* Return values for cryptfs_crypto_complete */
@@ -238,11 +221,10 @@
   int cryptfs_enable(char *flag, int type, char *passwd, int allow_reboot);
   int cryptfs_changepw(int type, const char *newpw);
   int cryptfs_enable_default(char *flag, int allow_reboot);
+  int cryptfs_setup_ext_volume(const char* label, const char* real_blkdev,
+          const unsigned char* key, int keysize, char* out_crypto_blkdev);
+  int cryptfs_revert_ext_volume(const char* label);
   int cryptfs_enable_file();
-  int cryptfs_setup_volume(const char *label, int major, int minor,
-                           char *crypto_dev_path, unsigned int max_pathlen,
-                           int *new_major, int *new_minor);
-  int cryptfs_revert_volume(const char *label);
   int cryptfs_getfield(const char *fieldname, char *value, int len);
   int cryptfs_setfield(const char *fieldname, const char *value);
   int cryptfs_mount_default_encrypted(void);
diff --git a/fs/Ext4.cpp b/fs/Ext4.cpp
new file mode 100644
index 0000000..3ae4159
--- /dev/null
+++ b/fs/Ext4.cpp
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <vector>
+#include <string>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/wait.h>
+
+#include <linux/kdev_t.h>
+
+#define LOG_TAG "Vold"
+
+#include <base/logging.h>
+#include <base/stringprintf.h>
+#include <cutils/log.h>
+#include <cutils/properties.h>
+#include <logwrap/logwrap.h>
+#include <selinux/selinux.h>
+
+#include "Ext4.h"
+#include "Utils.h"
+#include "VoldUtil.h"
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+namespace ext4 {
+
+static const char* kResizefsPath = "/system/bin/resize2fs";
+static const char* kMkfsPath = "/system/bin/make_ext4fs";
+static const char* kFsckPath = "/system/bin/e2fsck";
+
+bool IsSupported() {
+    return access(kMkfsPath, X_OK) == 0
+            && access(kFsckPath, X_OK) == 0
+            && IsFilesystemSupported("ext4");
+}
+
+status_t Check(const std::string& source, const std::string& target) {
+    // The following is shamelessly borrowed from fs_mgr.c, so it should be
+    // kept in sync with any changes over there.
+
+    const char* c_source = source.c_str();
+    const char* c_target = target.c_str();
+
+    int status;
+    int ret;
+    long tmpmnt_flags = MS_NOATIME | MS_NOEXEC | MS_NOSUID;
+    char *tmpmnt_opts = (char*) "nomblk_io_submit,errors=remount-ro";
+
+    /*
+     * First try to mount and unmount the filesystem.  We do this because
+     * the kernel is more efficient than e2fsck in running the journal and
+     * processing orphaned inodes, and on at least one device with a
+     * performance issue in the emmc firmware, it can take e2fsck 2.5 minutes
+     * to do what the kernel does in about a second.
+     *
+     * After mounting and unmounting the filesystem, run e2fsck, and if an
+     * error is recorded in the filesystem superblock, e2fsck will do a full
+     * check.  Otherwise, it does nothing.  If the kernel cannot mount the
+     * filesytsem due to an error, e2fsck is still run to do a full check
+     * fix the filesystem.
+     */
+    ret = mount(c_source, c_target, "ext4", tmpmnt_flags, tmpmnt_opts);
+    if (!ret) {
+        int i;
+        for (i = 0; i < 5; i++) {
+            // Try to umount 5 times before continuing on.
+            // Should we try rebooting if all attempts fail?
+            int result = umount(c_target);
+            if (result == 0) {
+                break;
+            }
+            ALOGW("%s(): umount(%s)=%d: %s\n", __func__, c_target, result, strerror(errno));
+            sleep(1);
+        }
+    }
+
+    /*
+     * Some system images do not have e2fsck for licensing reasons
+     * (e.g. recent SDK system images). Detect these and skip the check.
+     */
+    if (access(kFsckPath, X_OK)) {
+        ALOGD("Not running %s on %s (executable not in system image)\n",
+                kFsckPath, c_source);
+    } else {
+        ALOGD("Running %s on %s\n", kFsckPath, c_source);
+
+        std::vector<std::string> cmd;
+        cmd.push_back(kFsckPath);
+        cmd.push_back("-y");
+        cmd.push_back(c_source);
+
+        // ext4 devices are currently always trusted
+        return ForkExecvp(cmd, sFsckContext);
+    }
+
+    return 0;
+}
+
+status_t Mount(const std::string& source, const std::string& target, bool ro,
+        bool remount, bool executable) {
+    int rc;
+    unsigned long flags;
+
+    const char* c_source = source.c_str();
+    const char* c_target = target.c_str();
+
+    flags = MS_NOATIME | MS_NODEV | MS_NOSUID | MS_DIRSYNC;
+
+    flags |= (executable ? 0 : MS_NOEXEC);
+    flags |= (ro ? MS_RDONLY : 0);
+    flags |= (remount ? MS_REMOUNT : 0);
+
+    rc = mount(c_source, c_target, "ext4", flags, NULL);
+
+    if (rc && errno == EROFS) {
+        SLOGE("%s appears to be a read only filesystem - retrying mount RO", c_source);
+        flags |= MS_RDONLY;
+        rc = mount(c_source, c_target, "ext4", flags, NULL);
+    }
+
+    return rc;
+}
+
+status_t Resize(const std::string& source, unsigned int numSectors) {
+    std::vector<std::string> cmd;
+    cmd.push_back(kResizefsPath);
+    cmd.push_back("-f");
+    cmd.push_back(source);
+    cmd.push_back(StringPrintf("%u", numSectors));
+
+    return ForkExecvp(cmd);
+}
+
+status_t Format(const std::string& source, unsigned int numSectors,
+        const std::string& target) {
+    std::vector<std::string> cmd;
+    cmd.push_back(kMkfsPath);
+    cmd.push_back("-J");
+
+    cmd.push_back("-a");
+    cmd.push_back(target);
+
+    if (numSectors) {
+        cmd.push_back("-l");
+        cmd.push_back(StringPrintf("%u", numSectors * 512));
+    }
+
+    // Always generate a real UUID
+    cmd.push_back("-u");
+    cmd.push_back(source);
+
+    return ForkExecvp(cmd);
+}
+
+}  // namespace ext4
+}  // namespace vold
+}  // namespace android
diff --git a/fs/Ext4.h b/fs/Ext4.h
new file mode 100644
index 0000000..a5efa74
--- /dev/null
+++ b/fs/Ext4.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_EXT4_H
+#define ANDROID_VOLD_EXT4_H
+
+#include <utils/Errors.h>
+
+#include <string>
+
+namespace android {
+namespace vold {
+namespace ext4 {
+
+bool IsSupported();
+
+status_t Check(const std::string& source, const std::string& target);
+status_t Mount(const std::string& source, const std::string& target, bool ro,
+        bool remount, bool executable);
+status_t Format(const std::string& source, unsigned int numSectors,
+        const std::string& target);
+status_t Resize(const std::string& source, unsigned int numSectors);
+
+}  // namespace ext4
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/fs/F2fs.cpp b/fs/F2fs.cpp
new file mode 100644
index 0000000..b947822
--- /dev/null
+++ b/fs/F2fs.cpp
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "F2fs.h"
+#include "Utils.h"
+
+#include <base/logging.h>
+#include <base/stringprintf.h>
+
+#include <vector>
+#include <string>
+
+#include <sys/mount.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+namespace f2fs {
+
+static const char* kMkfsPath = "/system/bin/make_f2fs";
+static const char* kFsckPath = "/system/bin/fsck.f2fs";
+
+bool IsSupported() {
+    return access(kMkfsPath, X_OK) == 0
+            && access(kFsckPath, X_OK) == 0
+            && IsFilesystemSupported("f2fs");
+}
+
+status_t Check(const std::string& source) {
+    std::vector<std::string> cmd;
+    cmd.push_back(kFsckPath);
+    cmd.push_back("-f");
+    cmd.push_back(source);
+
+    // f2fs devices are currently always trusted
+    return ForkExecvp(cmd, sFsckContext);
+}
+
+status_t Mount(const std::string& source, const std::string& target) {
+    const char* c_source = source.c_str();
+    const char* c_target = target.c_str();
+    unsigned long flags = MS_NOATIME | MS_NODEV | MS_NOSUID | MS_DIRSYNC;
+
+    int res = mount(c_source, c_target, "f2fs", flags, NULL);
+    if (res != 0) {
+        PLOG(ERROR) << "Failed to mount " << source;
+        if (errno == EROFS) {
+            res = mount(c_source, c_target, "f2fs", flags | MS_RDONLY, NULL);
+            if (res != 0) {
+                PLOG(ERROR) << "Failed to mount read-only " << source;
+            }
+        }
+    }
+
+    return res;
+}
+
+status_t Format(const std::string& source) {
+    std::vector<std::string> cmd;
+    cmd.push_back(kMkfsPath);
+    cmd.push_back(source);
+
+    return ForkExecvp(cmd);
+}
+
+}  // namespace f2fs
+}  // namespace vold
+}  // namespace android
diff --git a/fs/F2fs.h b/fs/F2fs.h
new file mode 100644
index 0000000..f710212
--- /dev/null
+++ b/fs/F2fs.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_F2FS_H
+#define ANDROID_VOLD_F2FS_H
+
+#include <utils/Errors.h>
+
+#include <string>
+
+namespace android {
+namespace vold {
+namespace f2fs {
+
+bool IsSupported();
+
+status_t Check(const std::string& source);
+status_t Mount(const std::string& source, const std::string& target);
+status_t Format(const std::string& source);
+
+}  // namespace f2fs
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/fs/Vfat.cpp b/fs/Vfat.cpp
new file mode 100644
index 0000000..7bd05ec
--- /dev/null
+++ b/fs/Vfat.cpp
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/wait.h>
+#include <linux/fs.h>
+#include <sys/ioctl.h>
+
+#include <linux/kdev_t.h>
+
+#define LOG_TAG "Vold"
+
+#include <base/logging.h>
+#include <base/stringprintf.h>
+#include <cutils/log.h>
+#include <cutils/properties.h>
+#include <selinux/selinux.h>
+
+#include <logwrap/logwrap.h>
+
+#include "Vfat.h"
+#include "Utils.h"
+#include "VoldUtil.h"
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace vold {
+namespace vfat {
+
+static const char* kMkfsPath = "/system/bin/newfs_msdos";
+static const char* kFsckPath = "/system/bin/fsck_msdos";
+
+bool IsSupported() {
+    return access(kMkfsPath, X_OK) == 0
+            && access(kFsckPath, X_OK) == 0
+            && IsFilesystemSupported("vfat");
+}
+
+status_t Check(const std::string& source) {
+    if (access(kFsckPath, X_OK)) {
+        SLOGW("Skipping fs checks\n");
+        return 0;
+    }
+
+    int pass = 1;
+    int rc = 0;
+    do {
+        std::vector<std::string> cmd;
+        cmd.push_back(kFsckPath);
+        cmd.push_back("-p");
+        cmd.push_back("-f");
+        cmd.push_back(source);
+
+        // Fat devices are currently always untrusted
+        rc = ForkExecvp(cmd, sFsckUntrustedContext);
+
+        if (rc < 0) {
+            SLOGE("Filesystem check failed due to logwrap error");
+            errno = EIO;
+            return -1;
+        }
+
+        switch(rc) {
+        case 0:
+            SLOGI("Filesystem check completed OK");
+            return 0;
+
+        case 2:
+            SLOGE("Filesystem check failed (not a FAT filesystem)");
+            errno = ENODATA;
+            return -1;
+
+        case 4:
+            if (pass++ <= 3) {
+                SLOGW("Filesystem modified - rechecking (pass %d)",
+                        pass);
+                continue;
+            }
+            SLOGE("Failing check after too many rechecks");
+            errno = EIO;
+            return -1;
+
+        default:
+            SLOGE("Filesystem check failed (unknown exit code %d)", rc);
+            errno = EIO;
+            return -1;
+        }
+    } while (0);
+
+    return 0;
+}
+
+status_t Mount(const std::string& source, const std::string& target, bool ro,
+        bool remount, bool executable, int ownerUid, int ownerGid, int permMask,
+        bool createLost) {
+    int rc;
+    unsigned long flags;
+    char mountData[255];
+
+    const char* c_source = source.c_str();
+    const char* c_target = target.c_str();
+
+    flags = MS_NODEV | MS_NOSUID | MS_DIRSYNC;
+
+    flags |= (executable ? 0 : MS_NOEXEC);
+    flags |= (ro ? MS_RDONLY : 0);
+    flags |= (remount ? MS_REMOUNT : 0);
+
+    sprintf(mountData,
+            "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,shortname=mixed",
+            ownerUid, ownerGid, permMask, permMask);
+
+    rc = mount(c_source, c_target, "vfat", flags, mountData);
+
+    if (rc && errno == EROFS) {
+        SLOGE("%s appears to be a read only filesystem - retrying mount RO", c_source);
+        flags |= MS_RDONLY;
+        rc = mount(c_source, c_target, "vfat", flags, mountData);
+    }
+
+    if (rc == 0 && createLost) {
+        char *lost_path;
+        asprintf(&lost_path, "%s/LOST.DIR", c_target);
+        if (access(lost_path, F_OK)) {
+            /*
+             * Create a LOST.DIR in the root so we have somewhere to put
+             * lost cluster chains (fsck_msdos doesn't currently do this)
+             */
+            if (mkdir(lost_path, 0755)) {
+                SLOGE("Unable to create LOST.DIR (%s)", strerror(errno));
+            }
+        }
+        free(lost_path);
+    }
+
+    return rc;
+}
+
+status_t Format(const std::string& source, unsigned int numSectors) {
+    std::vector<std::string> cmd;
+    cmd.push_back(kMkfsPath);
+    cmd.push_back("-F");
+    cmd.push_back("32");
+    cmd.push_back("-O");
+    cmd.push_back("android");
+    cmd.push_back("-c");
+    cmd.push_back("64");
+    cmd.push_back("-A");
+
+    if (numSectors) {
+        cmd.push_back("-s");
+        cmd.push_back(StringPrintf("%u", numSectors));
+    }
+
+    cmd.push_back(source);
+
+    int rc = ForkExecvp(cmd);
+    if (rc < 0) {
+        SLOGE("Filesystem format failed due to logwrap error");
+        errno = EIO;
+        return -1;
+    }
+
+    if (rc == 0) {
+        SLOGI("Filesystem formatted OK");
+        return 0;
+    } else {
+        SLOGE("Format failed (unknown exit code %d)", rc);
+        errno = EIO;
+        return -1;
+    }
+    return 0;
+}
+
+}  // namespace vfat
+}  // namespace vold
+}  // namespace android
diff --git a/fs/Vfat.h b/fs/Vfat.h
new file mode 100644
index 0000000..306c7db
--- /dev/null
+++ b/fs/Vfat.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_VOLD_VFAT_H
+#define ANDROID_VOLD_VFAT_H
+
+#include <utils/Errors.h>
+
+#include <string>
+
+namespace android {
+namespace vold {
+namespace vfat {
+
+bool IsSupported();
+
+status_t Check(const std::string& source);
+status_t Mount(const std::string& source, const std::string& target, bool ro,
+        bool remount, bool executable, int ownerUid, int ownerGid, int permMask,
+        bool createLost);
+status_t Format(const std::string& source, unsigned int numSectors);
+
+}  // namespace vfat
+}  // namespace vold
+}  // namespace android
+
+#endif
diff --git a/fstrim.c b/fstrim.c
deleted file mode 100644
index 2c24fc9..0000000
--- a/fstrim.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include <limits.h>
-#include <linux/fs.h>
-#include <time.h>
-#include <fs_mgr.h>
-#include <pthread.h>
-#define LOG_TAG "fstrim"
-#include "cutils/log.h"
-#include "hardware_legacy/power.h"
-
-/* These numbers must match what the MountService specified in
- * frameworks/base/services/java/com/android/server/EventLogTags.logtags
- */
-#define LOG_FSTRIM_START  2755
-#define LOG_FSTRIM_FINISH 2756
-
-#define FSTRIM_WAKELOCK "dofstrim"
-
-#define UNUSED __attribute__((unused))
-
-/* From a would-be kernel header */
-#define FIDTRIM         _IOWR('f', 128, struct fstrim_range)    /* Deep discard trim */
-
-static unsigned long long get_boot_time_ms(void)
-{
-    struct timespec t;
-    unsigned long long time_ms;
-
-    t.tv_sec = 0;
-    t.tv_nsec = 0;
-    clock_gettime(CLOCK_BOOTTIME, &t);
-    time_ms = (t.tv_sec * 1000LL) + (t.tv_nsec / 1000000);
-
-    return time_ms;
-}
-
-static void *do_fstrim_filesystems(void *thread_arg)
-{
-    int i;
-    int fd;
-    int ret = 0;
-    struct fstrim_range range = { 0 };
-    extern struct fstab *fstab;
-    int deep_trim = !!thread_arg;
-
-    SLOGI("Starting fstrim work...\n");
-
-    /* Get a wakelock as this may take a while, and we don't want the
-     * device to sleep on us.
-     */
-    acquire_wake_lock(PARTIAL_WAKE_LOCK, FSTRIM_WAKELOCK);
-
-    /* Log the start time in the event log */
-    LOG_EVENT_LONG(LOG_FSTRIM_START, get_boot_time_ms());
-
-    for (i = 0; i < fstab->num_entries; i++) {
-        /* Skip raw partitions */
-        if (!strcmp(fstab->recs[i].fs_type, "emmc") ||
-            !strcmp(fstab->recs[i].fs_type, "mtd")) {
-            continue;
-        }
-        /* Skip read-only filesystems */
-        if (fstab->recs[i].flags & MS_RDONLY) {
-            continue;
-        }
-        if (fs_mgr_is_voldmanaged(&fstab->recs[i])) {
-            continue; /* Should we trim fat32 filesystems? */
-        }
-
-        fd = open(fstab->recs[i].mount_point, O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
-        if (fd < 0) {
-            SLOGE("Cannot open %s for FITRIM\n", fstab->recs[i].mount_point);
-            ret = -1;
-            continue;
-        }
-
-        memset(&range, 0, sizeof(range));
-        range.len = ULLONG_MAX;
-        SLOGI("Invoking %s ioctl on %s", deep_trim ? "FIDTRIM" : "FITRIM", fstab->recs[i].mount_point);
-
-        ret = ioctl(fd, deep_trim ? FIDTRIM : FITRIM, &range);
-        if (ret) {
-            SLOGE("%s ioctl failed on %s (error %d/%s)", deep_trim ? "FIDTRIM" : "FITRIM", fstab->recs[i].mount_point, errno, strerror(errno));
-            ret = -1;
-        } else {
-            SLOGI("Trimmed %llu bytes on %s\n", range.len, fstab->recs[i].mount_point);
-        }
-        close(fd);
-    }
-
-    /* Log the finish time in the event log */
-    LOG_EVENT_LONG(LOG_FSTRIM_FINISH, get_boot_time_ms());
-
-    SLOGI("Finished fstrim work.\n");
-
-    /* Release the wakelock that let us work */
-    release_wake_lock(FSTRIM_WAKELOCK);
-
-    return (void *)(uintptr_t)ret;
-}
-
-int fstrim_filesystems(int deep_trim)
-{
-    pthread_t t;
-    int ret;
-
-    /* Depending on the emmc chip and size, this can take upwards
-     * of a few minutes.  If done in the same thread as the caller
-     * of this function, that would block vold from accepting any
-     * commands until the trim is finished.  So start another thread
-     * to do the work, and return immediately.
-     *
-     * This function should not be called more than once per day, but
-     * even if it is called a second time before the first one finishes,
-     * the kernel will "do the right thing" and split the work between
-     * the two ioctls invoked in separate threads.
-     */
-    ret = pthread_create(&t, NULL, do_fstrim_filesystems, (void *)(intptr_t)deep_trim);
-    if (ret) {
-        SLOGE("Cannot create thread to do fstrim");
-        return ret;
-    }
-
-    ret = pthread_detach(t);
-    if (ret) {
-        SLOGE("Cannot detach thread doing fstrim");
-        return ret;
-    }
-
-    return 0;
-}
diff --git a/fstrim.h b/fstrim.h
deleted file mode 100644
index 185d998..0000000
--- a/fstrim.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-    int fstrim_filesystems(int deep_trim);
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/main.cpp b/main.cpp
index c07f48d..648f36a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,49 +14,67 @@
  * limitations under the License.
  */
 
+#include "Disk.h"
+#include "VolumeManager.h"
+#include "CommandListener.h"
+#include "CryptCommandListener.h"
+#include "NetlinkManager.h"
+#include "cryptfs.h"
+#include "sehandle.h"
+
+#include <base/logging.h>
+#include <base/stringprintf.h>
+#include <cutils/klog.h>
+#include <cutils/properties.h>
+#include <cutils/sockets.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-
+#include <getopt.h>
 #include <fcntl.h>
 #include <dirent.h>
 #include <fs_mgr.h>
 
-#define LOG_TAG "Vold"
-
-#include "cutils/klog.h"
-#include "cutils/log.h"
-#include "cutils/properties.h"
-
-#include "VolumeManager.h"
-#include "CommandListener.h"
-#include "NetlinkManager.h"
-#include "DirectVolume.h"
-#include "cryptfs.h"
-#include "sehandle.h"
-
 static int process_config(VolumeManager *vm);
 static void coldboot(const char *path);
+static void parse_args(int argc, char** argv);
 
-#define FSTAB_PREFIX "/fstab."
 struct fstab *fstab;
 
 struct selabel_handle *sehandle;
 
-int main() {
+using android::base::StringPrintf;
+
+int main(int argc, char** argv) {
+    setenv("ANDROID_LOG_TAGS", "*:v", 1);
+    android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM));
+
+    LOG(INFO) << "Vold 3.0 (the awakening) firing up";
+
+    LOG(VERBOSE) << "Detected support for:"
+            << (android::vold::IsFilesystemSupported("ext4") ? " ext4" : "")
+            << (android::vold::IsFilesystemSupported("f2fs") ? " f2fs" : "")
+            << (android::vold::IsFilesystemSupported("vfat") ? " vfat" : "");
 
     VolumeManager *vm;
     CommandListener *cl;
+    CryptCommandListener *ccl;
     NetlinkManager *nm;
 
-    SLOGI("Vold 2.1 (the revenge) firing up");
+    parse_args(argc, argv);
 
     sehandle = selinux_android_file_context_handle();
-    if (sehandle)
+    if (sehandle) {
         selinux_android_set_sehandle(sehandle);
+    }
+
+    // Quickly throw a CLOEXEC on the socket we just inherited from init
+    fcntl(android_get_control_socket("vold"), F_SETFD, FD_CLOEXEC);
+    fcntl(android_get_control_socket("cryptd"), F_SETFD, FD_CLOEXEC);
 
     mkdir("/dev/block/vold", 0755);
 
@@ -65,31 +83,35 @@
 
     /* Create our singleton managers */
     if (!(vm = VolumeManager::Instance())) {
-        SLOGE("Unable to create VolumeManager");
+        LOG(ERROR) << "Unable to create VolumeManager";
         exit(1);
-    };
+    }
 
     if (!(nm = NetlinkManager::Instance())) {
-        SLOGE("Unable to create NetlinkManager");
+        LOG(ERROR) << "Unable to create NetlinkManager";
         exit(1);
-    };
+    }
 
+    if (property_get_bool("vold.debug", false)) {
+        vm->setDebug(true);
+    }
 
     cl = new CommandListener();
+    ccl = new CryptCommandListener();
     vm->setBroadcaster((SocketListener *) cl);
     nm->setBroadcaster((SocketListener *) cl);
 
     if (vm->start()) {
-        SLOGE("Unable to start VolumeManager (%s)", strerror(errno));
+        PLOG(ERROR) << "Unable to start VolumeManager";
         exit(1);
     }
 
     if (process_config(vm)) {
-        SLOGE("Error reading configuration (%s)... continuing anyways", strerror(errno));
+        PLOG(ERROR) << "Error reading configuration... continuing anyways";
     }
 
     if (nm->start()) {
-        SLOGE("Unable to start NetlinkManager (%s)", strerror(errno));
+        PLOG(ERROR) << "Unable to start NetlinkManager";
         exit(1);
     }
 
@@ -100,7 +122,12 @@
      * Now that we're up, we can respond to commands
      */
     if (cl->startListener()) {
-        SLOGE("Unable to start CommandListener (%s)", strerror(errno));
+        PLOG(ERROR) << "Unable to start CommandListener";
+        exit(1);
+    }
+
+    if (ccl->startListener()) {
+        PLOG(ERROR) << "Unable to start CryptCommandListener";
         exit(1);
     }
 
@@ -109,18 +136,41 @@
         sleep(1000);
     }
 
-    SLOGI("Vold exiting");
+    LOG(ERROR) << "Vold exiting";
     exit(0);
 }
 
-static void do_coldboot(DIR *d, int lvl)
-{
+static void parse_args(int argc, char** argv) {
+    static struct option opts[] = {
+        {"blkid_context", required_argument, 0, 'b' },
+        {"blkid_untrusted_context", required_argument, 0, 'B' },
+        {"fsck_context", required_argument, 0, 'f' },
+        {"fsck_untrusted_context", required_argument, 0, 'F' },
+    };
+
+    int c;
+    while ((c = getopt_long(argc, argv, "", opts, nullptr)) != -1) {
+        switch (c) {
+        case 'b': android::vold::sBlkidContext = optarg; break;
+        case 'B': android::vold::sBlkidUntrustedContext = optarg; break;
+        case 'f': android::vold::sFsckContext = optarg; break;
+        case 'F': android::vold::sFsckUntrustedContext = optarg; break;
+        }
+    }
+
+    CHECK(android::vold::sBlkidContext != nullptr);
+    CHECK(android::vold::sBlkidUntrustedContext != nullptr);
+    CHECK(android::vold::sFsckContext != nullptr);
+    CHECK(android::vold::sFsckUntrustedContext != nullptr);
+}
+
+static void do_coldboot(DIR *d, int lvl) {
     struct dirent *de;
     int dfd, fd;
 
     dfd = dirfd(d);
 
-    fd = openat(dfd, "uevent", O_WRONLY);
+    fd = openat(dfd, "uevent", O_WRONLY | O_CLOEXEC);
     if(fd >= 0) {
         write(fd, "add\n", 4);
         close(fd);
@@ -149,8 +199,7 @@
     }
 }
 
-static void coldboot(const char *path)
-{
+static void coldboot(const char *path) {
     DIR *d = opendir(path);
     if(d) {
         do_coldboot(d, 0);
@@ -158,55 +207,40 @@
     }
 }
 
-static int process_config(VolumeManager *vm)
-{
-    char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)];
-    char propbuf[PROPERTY_VALUE_MAX];
-    int i;
-    int ret = -1;
-    int flags;
-
-    property_get("ro.hardware", propbuf, "");
-    snprintf(fstab_filename, sizeof(fstab_filename), FSTAB_PREFIX"%s", propbuf);
-
-    fstab = fs_mgr_read_fstab(fstab_filename);
+static int process_config(VolumeManager *vm) {
+    std::string path(android::vold::DefaultFstabPath());
+    fstab = fs_mgr_read_fstab(path.c_str());
     if (!fstab) {
-        SLOGE("failed to open %s\n", fstab_filename);
+        PLOG(ERROR) << "Failed to open default fstab " << path;
         return -1;
     }
 
     /* Loop through entries looking for ones that vold manages */
-    for (i = 0; i < fstab->num_entries; i++) {
+    bool has_adoptable = false;
+    for (int i = 0; i < fstab->num_entries; i++) {
         if (fs_mgr_is_voldmanaged(&fstab->recs[i])) {
-            DirectVolume *dv = NULL;
-            flags = 0;
-
-            /* Set any flags that might be set for this volume */
             if (fs_mgr_is_nonremovable(&fstab->recs[i])) {
-                flags |= VOL_NONREMOVABLE;
+                LOG(WARNING) << "nonremovable no longer supported; ignoring volume";
+                continue;
             }
+
+            std::string sysPattern(fstab->recs[i].blk_device);
+            std::string nickname(fstab->recs[i].label);
+            int flags = 0;
+
             if (fs_mgr_is_encryptable(&fstab->recs[i])) {
-                flags |= VOL_ENCRYPTABLE;
+                flags |= android::vold::Disk::Flags::kAdoptable;
+                has_adoptable = true;
             }
-            /* Only set this flag if there is not an emulated sd card */
-            if (fs_mgr_is_noemulatedsd(&fstab->recs[i]) &&
-                !strcmp(fstab->recs[i].fs_type, "vfat")) {
-                flags |= VOL_PROVIDES_ASEC;
-            }
-            dv = new DirectVolume(vm, &(fstab->recs[i]), flags);
-
-            if (dv->addPath(fstab->recs[i].blk_device)) {
-                SLOGE("Failed to add devpath %s to volume %s",
-                      fstab->recs[i].blk_device, fstab->recs[i].label);
-                goto out_fail;
+            if (fs_mgr_is_noemulatedsd(&fstab->recs[i])
+                    || property_get_bool("vold.debug.default_primary", false)) {
+                flags |= android::vold::Disk::Flags::kDefaultPrimary;
             }
 
-            vm->addVolume(dv);
+            vm->addDiskSource(std::shared_ptr<VolumeManager::DiskSource>(
+                    new VolumeManager::DiskSource(sysPattern, nickname, flags)));
         }
     }
-
-    ret = 0;
-
-out_fail:
-    return ret;
+    property_set("vold.has_adoptable", has_adoptable ? "1" : "0");
+    return 0;
 }
diff --git a/secdiscard.cpp b/secdiscard.cpp
new file mode 100644
index 0000000..3f4ab2e
--- /dev/null
+++ b/secdiscard.cpp
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <linux/fs.h>
+#include <linux/fiemap.h>
+
+#define LOG_TAG "secdiscard"
+#include "cutils/log.h"
+
+// Deliberately limit ourselves to wiping small files.
+#define MAX_WIPE_LENGTH 4096
+#define INIT_BUFFER_SIZE 2048
+
+static void usage(char *progname);
+static void destroy_key(const std::string &path);
+static int file_device_range(const std::string &path, uint64_t range[2]);
+static int open_block_device_for_path(const std::string &path);
+static int read_file_as_string_atomically(const std::string &path, std::string &contents);
+static int find_block_device_for_path(
+    const std::string &mounts,
+    const std::string &path,
+    std::string &block_device);
+
+int main(int argc, char **argv) {
+    if (argc != 2 || argv[1][0] != '/') {
+        usage(argv[0]);
+        return -1;
+    }
+    SLOGD("Running: %s %s", argv[0], argv[1]);
+    std::string target(argv[1]);
+    destroy_key(target);
+    if (unlink(argv[1]) != 0 && errno != ENOENT) {
+        SLOGE("Unable to delete %s: %s",
+            argv[1], strerror(errno));
+        return -1;
+    }
+    return 0;
+}
+
+static void usage(char *progname) {
+    fprintf(stderr, "Usage: %s <absolute path>\n", progname);
+}
+
+// BLKSECDISCARD all content in "path", if it's small enough.
+static void destroy_key(const std::string &path) {
+    uint64_t range[2];
+    if (file_device_range(path, range) < 0) {
+        return;
+    }
+    int fs_fd = open_block_device_for_path(path);
+    if (fs_fd < 0) {
+        return;
+    }
+    if (ioctl(fs_fd, BLKSECDISCARD, range) != 0) {
+        SLOGE("Unable to BLKSECDISCARD %s: %s", path.c_str(), strerror(errno));
+        close(fs_fd);
+        return;
+    }
+    close(fs_fd);
+    SLOGD("Discarded %s", path.c_str());
+}
+
+// Find a short range that completely covers the file.
+// If there isn't one, return -1, otherwise 0.
+static int file_device_range(const std::string &path, uint64_t range[2])
+{
+    int fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
+    if (fd < 0) {
+        if (errno == ENOENT) {
+            SLOGD("Unable to open %s: %s", path.c_str(), strerror(errno));
+        } else {
+            SLOGE("Unable to open %s: %s", path.c_str(), strerror(errno));
+        }
+        return -1;
+    }
+    alignas(struct fiemap) char fiemap_buffer[offsetof(struct fiemap, fm_extents[1])];
+    memset(fiemap_buffer, 0, sizeof(fiemap_buffer));
+    struct fiemap *fiemap = (struct fiemap *)fiemap_buffer;
+    fiemap->fm_start = 0;
+    fiemap->fm_length = UINT64_MAX;
+    fiemap->fm_flags = 0;
+    fiemap->fm_extent_count = 1;
+    fiemap->fm_mapped_extents = 0;
+    if (ioctl(fd, FS_IOC_FIEMAP, fiemap) != 0) {
+        SLOGE("Unable to FIEMAP %s: %s", path.c_str(), strerror(errno));
+        close(fd);
+        return -1;
+    }
+    close(fd);
+    if (fiemap->fm_mapped_extents != 1) {
+        SLOGE("Expecting one extent, got %d in %s", fiemap->fm_mapped_extents, path.c_str());
+        return -1;
+    }
+    struct fiemap_extent *extent = &fiemap->fm_extents[0];
+    if (!(extent->fe_flags & FIEMAP_EXTENT_LAST)) {
+        SLOGE("First extent was not the last in %s", path.c_str());
+        return -1;
+    }
+    if (extent->fe_flags &
+            (FIEMAP_EXTENT_UNKNOWN | FIEMAP_EXTENT_DELALLOC | FIEMAP_EXTENT_NOT_ALIGNED)) {
+        SLOGE("Extent has unexpected flags %ulx: %s", extent->fe_flags, path.c_str());
+        return -1;
+    }
+    if (extent->fe_length > MAX_WIPE_LENGTH) {
+        SLOGE("Extent too big, %llu bytes in %s", extent->fe_length, path.c_str());
+        return -1;
+    }
+    range[0] = extent->fe_physical;
+    range[1] = extent->fe_length;
+    return 0;
+}
+
+// Given a file path, look for the corresponding
+// block device in /proc/mounts and open it.
+static int open_block_device_for_path(const std::string &path)
+{
+    std::string mountsfile("/proc/mounts");
+    std::string mounts;
+    if (read_file_as_string_atomically(mountsfile, mounts) < 0) {
+        return -1;
+    }
+    std::string block_device;
+    if (find_block_device_for_path(mounts, path, block_device) < 0) {
+        return -1;
+    }
+    SLOGD("For path %s block device is %s", path.c_str(), block_device.c_str());
+    int res = open(block_device.c_str(), O_RDWR | O_LARGEFILE | O_CLOEXEC);
+    if (res < 0) {
+        SLOGE("Failed to open device %s: %s", block_device.c_str(), strerror(errno));
+        return -1;
+    }
+    return res;
+}
+
+// Read a file into a buffer in a single gulp, for atomicity.
+// Null-terminate the buffer.
+// Retry until the buffer is big enough.
+static int read_file_as_string_atomically(const std::string &path, std::string &contents)
+{
+    ssize_t buffer_size = INIT_BUFFER_SIZE;
+    while (true) {
+        int fd = open(path.c_str(), O_RDONLY | O_CLOEXEC);
+        if (fd < 0) {
+            SLOGE("Failed to open %s: %s", path.c_str(), strerror(errno));
+            return -1;
+        }
+        contents.resize(buffer_size);
+        ssize_t read_size = read(fd, &contents[0], buffer_size);
+        if (read_size < 0) {
+            SLOGE("Failed to read from %s: %s", path.c_str(), strerror(errno));
+            close(fd);
+            return -1;
+        }
+        close(fd);
+        if (read_size < buffer_size) {
+            contents.resize(read_size);
+            return 0;
+        }
+        SLOGD("%s too big for buffer of size %zu", path.c_str(), buffer_size);
+        buffer_size <<= 1;
+    }
+}
+
+// Search a string representing the contents of /proc/mounts
+// for the mount point of a particular file by prefix matching
+// and return the corresponding block device.
+static int find_block_device_for_path(
+    const std::string &mounts,
+    const std::string &path,
+    std::string &block_device)
+{
+    auto line_begin = mounts.begin();
+    size_t best_prefix = 0;
+    std::string::const_iterator line_end;
+    while (line_begin != mounts.end()) {
+        line_end = std::find(line_begin, mounts.end(), '\n');
+        if (line_end == mounts.end()) {
+            break;
+        }
+        auto device_end = std::find(line_begin, line_end, ' ');
+        if (device_end == line_end) {
+            break;
+        }
+        auto mountpoint_begin = device_end + 1;
+        auto mountpoint_end = std::find(mountpoint_begin, line_end, ' ');
+        if (mountpoint_end == line_end) {
+            break;
+        }
+        if (std::find(line_begin, mountpoint_end, '\\') != mountpoint_end) {
+            // We don't correctly handle escape sequences, and we don't expect
+            // to encounter any, so fail if we do.
+            break;
+        }
+        size_t mountpoint_len = mountpoint_end - mountpoint_begin;
+        if (mountpoint_len > best_prefix &&
+                mountpoint_len < path.length() &&
+                path[mountpoint_len] == '/' &&
+                std::equal(mountpoint_begin, mountpoint_end, path.begin())) {
+            block_device = std::string(line_begin, device_end);
+            best_prefix = mountpoint_len;
+        }
+        line_begin = line_end + 1;
+    }
+    // All of the "break"s above are fatal parse errors.
+    if (line_begin != mounts.end()) {
+        auto bad_line = std::string(line_begin, line_end);
+        SLOGE("Unable to parse line in %s: %s", path.c_str(), bad_line.c_str());
+        return -1;
+    }
+    if (best_prefix == 0) {
+        SLOGE("No prefix found for path: %s", path.c_str());
+        return -1;
+    }
+    return 0;
+}
diff --git a/vdc.cpp b/vdc.cpp
index 3e80940..d8476b7 100644
--- a/vdc.cpp
+++ b/vdc.cpp
@@ -54,14 +54,19 @@
         exit(5);
     }
 
-    while ((sock = socket_local_client("vold",
+    const char* sockname = "vold";
+    if (!strcmp(argv[1], "cryptfs")) {
+        sockname = "cryptd";
+    }
+
+    while ((sock = socket_local_client(sockname,
                                  ANDROID_SOCKET_NAMESPACE_RESERVED,
                                  SOCK_STREAM)) < 0) {
         if(!wait_for_socket) {
             fprintf(stderr, "Error connecting (%s)\n", strerror(errno));
             exit(4);
         } else {
-            sleep(1);
+            usleep(10000);
         }
     }
 
@@ -74,6 +79,7 @@
 
 static int do_cmd(int sock, int argc, char **argv) {
     char final_cmd[255] = "0 "; /* 0 is a (now required) sequence number */
+
     int i;
     size_t ret;
 
@@ -166,4 +172,3 @@
     fprintf(stderr,
             "Usage: %s [--wait] <monitor>|<cmd> [arg1] [arg2...]\n", progname);
  }
-
