mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>,
	Zoltan Sogor <weth@inf.u-szeged.hu>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH] UBIFS: ensure UBIFS switches to read-only on error
Date: Wed, 13 Aug 2008 13:17:36 +0300	[thread overview]
Message-ID: <1218622675-28853-8-git-send-email-dedekind@infradead.org> (raw)
In-Reply-To: <1218622675-28853-1-git-send-email-dedekind@infradead.org>

From: Adrian Hunter <ext-adrian.hunter@nokia.com>

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);
-- 
1.5.4.1


  parent reply	other threads:[~2008-08-13  8:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13 10:17 UBIFS updates for 2.6.27 Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] Documentation: fix typo in ubifs.txt Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: print volume name as well Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: fix budgeting calculations Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: improve debugging Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: free budget in delete_inode as well Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: fix error return in failure mode Artem Bityutskiy
2008-08-13 10:17 ` Artem Bityutskiy [this message]
2008-08-13 10:17 ` [PATCH] UBIFS: make ubifs_ro_mode() not inline Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: do not write orphans back Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: remove unneeded function parameter Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: remove another " Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: increment commit number earlier Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: optimize deletions Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: do not union creat_sqnum and del_cmtno Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: fix typos in comments Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: correct orphan deletion order Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: improve budgeting checks Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: align inode data to eight Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: print pid in dump function Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: reserve more space for index Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: minor tweaks in commit Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: support splice_write Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: correct spelling of "thrice" Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: always set i_generation to 0 Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: improve arguments checking in debugging messages Artem Bityutskiy
2008-08-13 10:17 ` [PATCH] UBIFS: fix budgeting request alignment in xattr code Artem Bityutskiy
2008-08-14 19:27 ` UBIFS updates for 2.6.27 Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1218622675-28853-8-git-send-email-dedekind@infradead.org \
    --to=dedekind@infradead.org \
    --cc=ext-adrian.hunter@nokia.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weth@inf.u-szeged.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®