#ifdef CONFIG_MTD_UBI_FAULT_INJECTION
 static DECLARE_FAULT_ATTR(fault_bitflips_attr);
-static DECLARE_FAULT_ATTR(fault_io_failures_attr);
+static DECLARE_FAULT_ATTR(fault_write_failure_attr);
+static DECLARE_FAULT_ATTR(fault_erase_failure_attr);
 static DECLARE_FAULT_ATTR(fault_power_cut_attr);
 
 #define FAIL_ACTION(name, fault_attr)                  \
 }
 
 FAIL_ACTION(bitflips,          fault_bitflips_attr)
-FAIL_ACTION(io_failures,       fault_io_failures_attr)
+FAIL_ACTION(write_failure,     fault_write_failure_attr)
+FAIL_ACTION(erase_failure,     fault_erase_failure_attr)
 FAIL_ACTION(power_cut,         fault_power_cut_attr)
 #endif
 
        fault_create_debugfs_attr("emulate_bitflips", dir,
                                  &fault_bitflips_attr);
 
-       fault_create_debugfs_attr("emulate_io_failures", dir,
-                                 &fault_io_failures_attr);
+       fault_create_debugfs_attr("emulate_write_failure", dir,
+                                 &fault_write_failure_attr);
+
+       fault_create_debugfs_attr("emulate_erase_failure", dir,
+                                 &fault_erase_failure_attr);
 
        fault_create_debugfs_attr("emulate_power_cut", dir,
                                  &fault_power_cut_attr);
 
 /* Emulate bit-flips */
 #define MASK_BITFLIPS                          (1 << 2)
 /* Emulates -EIO during write/erase */
-#define MASK_IO_FAILURE                                (1 << 3)
+#define MASK_WRITE_FAILURE                     (1 << 3)
+#define MASK_ERASE_FAILURE                     (1 << 4)
 
 extern bool should_fail_bitflips(void);
-extern bool should_fail_io_failures(void);
+extern bool should_fail_write_failure(void);
+extern bool should_fail_erase_failure(void);
 extern bool should_fail_power_cut(void);
 
 static inline bool ubi_dbg_fail_bitflip(const struct ubi_device *ubi)
 
 static inline bool ubi_dbg_fail_write(const struct ubi_device *ubi)
 {
-       if (ubi->dbg.emulate_failures & MASK_IO_FAILURE)
-               return should_fail_io_failures();
+       if (ubi->dbg.emulate_failures & MASK_WRITE_FAILURE)
+               return should_fail_write_failure();
        return false;
 }
 
 static inline bool ubi_dbg_fail_erase(const struct ubi_device *ubi)
 {
-       if (ubi->dbg.emulate_failures & MASK_IO_FAILURE)
-               return should_fail_io_failures();
+       if (ubi->dbg.emulate_failures & MASK_ERASE_FAILURE)
+               return should_fail_erase_failure();
        return false;
 }