diff options
-rw-r--r-- | fs/ubifs/debug.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 4e3aaeba4eca..0adfb29b8503 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -2208,16 +2208,17 @@ int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | |||
2208 | int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, | 2208 | int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, |
2209 | int offset, int len, int dtype) | 2209 | int offset, int len, int dtype) |
2210 | { | 2210 | { |
2211 | int err; | 2211 | int err, failing; |
2212 | 2212 | ||
2213 | if (in_failure_mode(desc)) | 2213 | if (in_failure_mode(desc)) |
2214 | return -EIO; | 2214 | return -EIO; |
2215 | if (do_fail(desc, lnum, 1)) | 2215 | failing = do_fail(desc, lnum, 1); |
2216 | if (failing) | ||
2216 | cut_data(buf, len); | 2217 | cut_data(buf, len); |
2217 | err = ubi_leb_write(desc, lnum, buf, offset, len, dtype); | 2218 | err = ubi_leb_write(desc, lnum, buf, offset, len, dtype); |
2218 | if (err) | 2219 | if (err) |
2219 | return err; | 2220 | return err; |
2220 | if (in_failure_mode(desc)) | 2221 | if (failing) |
2221 | return -EIO; | 2222 | return -EIO; |
2222 | return 0; | 2223 | return 0; |
2223 | } | 2224 | } |