From: Edward Shishkin <edward.shishkin@gmail.com>
To: "Mathieu Bélanger" <b747xx@gmail.com>
Cc: Reiserfs development mailing list <reiserfs-devel@vger.kernel.org>
Subject: Re: [BUG] Big fiability issue?
Date: Tue, 5 Apr 2016 17:43:45 +0200 [thread overview]
Message-ID: <5703DD31.50604@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
Hello Mathieu,
I found that by default reiser4 still relies on a block layer feature,
which is not longer supported. This is so-called "barriers". And yes,
on the power outage bad things are bound to happen. However, it
is up to bad luck.
The attached patch removes the rest of block barriers support in
reiser4. So, now we honestly wait for IO completion of wandered
blocks (overwrite set) before submitting a journal header (journal
footer).
Not sure if it will address your problem though. Also, data corruption
after rw-mounting of checked (rebuild-fs) partition is still a concern.
Thanks,
Edward.
[-- Attachment #2: reiser4-drop-barriers-support.patch --]
[-- Type: text/x-patch, Size: 5377 bytes --]
Drop residual block barriers support.
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
---
fs/reiser4/init_super.c | 2 --
fs/reiser4/super.h | 2 --
fs/reiser4/wander.c | 47 +++++++++++------------------------------------
fs/reiser4/writeout.h | 2 +-
4 files changed, 12 insertions(+), 41 deletions(-)
--- a/fs/reiser4/init_super.c
+++ b/fs/reiser4/init_super.c
@@ -492,8 +492,6 @@ int reiser4_init_super_data(struct super
PUSH_BIT_OPT("dont_load_bitmap", REISER4_DONT_LOAD_BITMAP);
/* disable transaction commits during write() */
PUSH_BIT_OPT("atomic_write", REISER4_ATOMIC_WRITE);
- /* disable use of write barriers in the reiser4 log writer. */
- PUSH_BIT_OPT("no_write_barrier", REISER4_NO_WRITE_BARRIER);
/* enable issuing of discard requests */
PUSH_BIT_OPT("discard", REISER4_DISCARD);
/* disable hole punching at flush time */
--- a/fs/reiser4/super.h
+++ b/fs/reiser4/super.h
@@ -50,8 +50,6 @@ typedef enum {
REISER4_DONT_LOAD_BITMAP = 5,
/* enforce atomicity during write(2) */
REISER4_ATOMIC_WRITE = 6,
- /* don't use write barriers in the log writer code. */
- REISER4_NO_WRITE_BARRIER = 7,
/* enable issuing of discard requests */
REISER4_DISCARD = 8,
/* disable hole punching at flush time */
--- a/fs/reiser4/wander.c
+++ b/fs/reiser4/wander.c
@@ -224,11 +224,6 @@ static void done_commit_handle(struct co
assert("zam-690", list_empty(&ch->tx_list));
}
-static inline int reiser4_use_write_barrier(struct super_block * s)
-{
- return !reiser4_is_set(s, REISER4_NO_WRITE_BARRIER);
-}
-
/* fill journal header block data */
static void format_journal_header(struct commit_handle *ch)
{
@@ -420,7 +415,7 @@ store_wmap_actor(txn_atom * atom UNUSED_
set is written to wandered locations and all wander records are written
also. Updated journal header blocks contains a pointer (block number) to
first wander record of the just written transaction */
-static int update_journal_header(struct commit_handle *ch, int use_barrier)
+static int update_journal_header(struct commit_handle *ch)
{
struct reiser4_super_info_data *sbinfo = get_super_private(ch->super);
jnode *jh = sbinfo->journal_header;
@@ -430,7 +425,7 @@ static int update_journal_header(struct
format_journal_header(ch);
ret = write_jnodes_to_disk_extent(jh, 1, jnode_get_block(jh), NULL,
- use_barrier ? WRITEOUT_BARRIER : 0);
+ WRITEOUT_FLUSH_FUA);
if (ret)
return ret;
@@ -450,7 +445,7 @@ static int update_journal_header(struct
/* This function is called after write-back is finished. We update journal
footer block and free blocks which were occupied by wandered blocks and
transaction wander records */
-static int update_journal_footer(struct commit_handle *ch, int use_barrier)
+static int update_journal_footer(struct commit_handle *ch)
{
reiser4_super_info_data *sbinfo = get_super_private(ch->super);
@@ -461,7 +456,7 @@ static int update_journal_footer(struct
format_journal_footer(ch);
ret = write_jnodes_to_disk_extent(jf, 1, jnode_get_block(jf), NULL,
- use_barrier ? WRITEOUT_BARRIER : 0);
+ WRITEOUT_FLUSH_FUA);
if (ret)
return ret;
@@ -713,7 +708,7 @@ static int write_jnodes_to_disk_extent(
flush_queue_t *fq, int flags)
{
struct super_block *super = reiser4_get_current_sb();
- int write_op = ( flags & WRITEOUT_BARRIER ) ? WRITE_FLUSH_FUA : WRITE;
+ int write_op = ( flags & WRITEOUT_FLUSH_FUA ) ? WRITE_FLUSH_FUA : WRITE;
jnode *cur = first;
reiser4_block_nr block;
@@ -1101,7 +1096,6 @@ static int alloc_tx(struct commit_handle
static int commit_tx(struct commit_handle *ch)
{
flush_queue_t *fq;
- int barrier;
int ret;
/* Grab more space for wandered records. */
@@ -1126,23 +1120,16 @@ static int commit_tx(struct commit_handl
reiser4_fq_put(fq);
if (ret)
return ret;
- barrier = reiser4_use_write_barrier(ch->super);
- if (!barrier) {
- ret = current_atom_finish_all_fq();
- if (ret)
- return ret;
- }
- ret = update_journal_header(ch, barrier);
- if (!barrier || ret)
+ ret = current_atom_finish_all_fq();
+ if (ret)
return ret;
- return current_atom_finish_all_fq();
+ return update_journal_header(ch);
}
static int write_tx_back(struct commit_handle * ch)
{
flush_queue_t *fq;
int ret;
- int barrier;
fq = get_fq_for_current_atom();
if (IS_ERR(fq))
@@ -1153,22 +1140,10 @@ static int write_tx_back(struct commit_h
reiser4_fq_put(fq);
if (ret)
return ret;
-
- barrier = reiser4_use_write_barrier(ch->super);
- if (!barrier) {
- ret = current_atom_finish_all_fq();
- if (ret)
- return ret;
- }
- ret = update_journal_footer(ch, barrier);
+ ret = current_atom_finish_all_fq();
if (ret)
return ret;
- if (barrier) {
- ret = current_atom_finish_all_fq();
- if (ret)
- return ret;
- }
- return 0;
+ return update_journal_footer(ch);
}
/* We assume that at this moment all captured blocks are marked as RELOC or
@@ -1486,7 +1461,7 @@ static int replay_transaction(const stru
}
}
- ret = update_journal_footer(&ch, 0);
+ ret = update_journal_footer(&ch);
free_ow_set:
--- a/fs/reiser4/writeout.h
+++ b/fs/reiser4/writeout.h
@@ -4,7 +4,7 @@
#define WRITEOUT_SINGLE_STREAM (0x1)
#define WRITEOUT_FOR_PAGE_RECLAIM (0x2)
-#define WRITEOUT_BARRIER (0x4)
+#define WRITEOUT_FLUSH_FUA (0x4)
extern int reiser4_get_writeout_flags(void);
next reply other threads:[~2016-04-05 15:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 15:43 Edward Shishkin [this message]
2016-04-06 0:23 ` [BUG] Big fiability issue? Ivan Shapovalov
2016-04-06 15:03 ` Edward Shishkin
2016-04-06 14:25 ` Mathieu Belanger
2016-04-06 14:35 ` Mathieu Belanger
2016-04-06 16:32 ` Edward Shishkin
-- strict thread matches above, loose matches on Subject: below --
2016-04-03 17:44 Mathieu Belanger
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=5703DD31.50604@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=b747xx@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.