mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-15 08:44:14 +08:00
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>
This commit is contained in:
parent
b0af8dfdd6
commit
549c999a76
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user