Skip to content

Commit

Permalink
UBIFS: return EROFS in case of broken commit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 4, 2011
1 parent b0af8df commit 549c999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ubifs/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 549c999

Please sign in to comment.