UBIFS: ensure UBIFS switches to read-only on error

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, August 15, 2008 - 2:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2fb42b...
Commit:     2fb42b11f61cbcef7dfc225c1d26c4511436583d
Parent:     16dfd804b44ef7156d1c201f100bd0d9dc6b7c4b
Author:     Adrian Hunter <ext-adrian.hunter@nokia.com>
AuthorDate: Fri Jul 18 17:56:37 2008 +0300
Committer:  Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
CommitDate: Wed Aug 13 11:24:00 2008 +0300

    UBIFS: ensure UBIFS switches to read-only on error
    
    UBI transparently handles write errors by automatically copying
    and remapping the affected eraseblock. If UBI is unable to do
    that, for example its pool of eraseblocks reserved for bad block
    handling is empty, then the error is propagated to UBIFS. UBIFS
    must protect the media from falling into an inconsistent state
    by immediately switching to read-only mode. In the case of log
    updates, this was not being done.
    
    Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
---
 fs/ubifs/log.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c
index 36857b9..e14829e 100644
--- a/fs/ubifs/log.c
+++ b/fs/ubifs/log.c
@@ -317,6 +317,8 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
 	return 0;
 
 out_unlock:
+	if (err != -EAGAIN)
+		ubifs_ro_mode(c, err);
 	mutex_unlock(&c->log_mutex);
 	kfree(ref);
 	kfree(bud);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
UBIFS: ensure UBIFS switches to read-only on error, Linux Kernel Mailing List..., (Fri Aug 15, 2:59 pm)