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: fix error return in failure mode
Date: Wed, 13 Aug 2008 13:17:35 +0300 [thread overview]
Message-ID: <1218622675-28853-7-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>
UBIFS recovery testing debug facility simulates media failures.
When simulating an IO error, the error code returned must be
-EIO but it was not always if the user switched off the
debug recovery testing option at the same time.
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
---
fs/ubifs/debug.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 4e3aaeb..0adfb29 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2208,16 +2208,17 @@ int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
int offset, int len, int dtype)
{
- int err;
+ int err, failing;
if (in_failure_mode(desc))
return -EIO;
- if (do_fail(desc, lnum, 1))
+ failing = do_fail(desc, lnum, 1);
+ if (failing)
cut_data(buf, len);
err = ubi_leb_write(desc, lnum, buf, offset, len, dtype);
if (err)
return err;
- if (in_failure_mode(desc))
+ if (failing)
return -EIO;
return 0;
}
--
1.5.4.1
next prev parent reply other threads:[~2008-08-13 8:41 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 ` Artem Bityutskiy [this message]
2008-08-13 10:17 ` [PATCH] UBIFS: ensure UBIFS switches to read-only on error Artem Bityutskiy
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-7-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®