summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-26 15:57:14 +0200
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 09:54:26 +0200
commit549c999a768a7a144c60a0faa58f34c48f39112b (patch)
treec1bdefb19fafb74164331c21ebaee7b2a987441c
parentLinux 3.0-rc5 (diff)
downloadlinux-549c999a768a7a144c60a0faa58f34c48f39112b.tar.xz
linux-549c999a768a7a144c60a0faa58f34c48f39112b.zip
UBIFS: return EROFS in case of broken commit
If commit failed and it is in broken state, UBIFS switches to R/O mode. Most operations return -EROFS in this case, except of commit which returns -EINVAL. Make it return -EROFS too for consistency. This is also important for our power cut emulation testing. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--fs/ubifs/commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c
index 87cd0ead8633..8ab03d12d5c0 100644
--- a/fs/ubifs/commit.c
+++ b/fs/ubifs/commit.c
@@ -418,7 +418,7 @@ int ubifs_run_commit(struct ubifs_info *c)
spin_lock(&c->cs_lock);
if (c->cmt_state == COMMIT_BROKEN) {
- err = -EINVAL;
+ err = -EROFS;
goto out;
}
@@ -444,7 +444,7 @@ int ubifs_run_commit(struct ubifs_info *c)
* re-check it.
*/
if (c->cmt_state == COMMIT_BROKEN) {
- err = -EINVAL;
+ err = -EROFS;
goto out_cmt_unlock;
}